Re-add clipboard functions

This commit is contained in:
elasota
2020-07-03 04:59:40 -04:00
parent 00ea1b2982
commit 58ad634085
11 changed files with 592 additions and 31 deletions

View File

@@ -122,8 +122,18 @@ namespace PortabilityLayer
bool MemoryManagerImpl::ResizeHandle(MMHandleBlock *hdl, size_t newSize)
{
if (hdl->m_contents == nullptr)
return false;
if (hdl->m_contents == nullptr)
{
if (newSize != 0)
{
void *newBuf = Alloc(newSize);
if (!newBuf)
return false;
hdl->m_contents = newBuf;
hdl->m_size = newSize;
}
}
if (newSize != hdl->m_size)
{

View File

@@ -4,6 +4,6 @@
void THandleBase::Dispose() const
{
if (m_hdl)
if (m_hdl)
PortabilityLayer::MemoryManager::GetInstance()->ReleaseHandle(m_hdl);
}

View File

@@ -82,5 +82,6 @@ void AppendMenuItem(MenuHandle menu, int8_t iconResID, uint8_t key, uint8_t subm
void SetMenuItemText(MenuHandle menu, int index, const PLPasStr &text)
{
PL_NotYetImplemented();
PortabilityLayer::MenuManager *mm = PortabilityLayer::MenuManager::GetInstance();
mm->SetItemText(menu, index - 1, text);
}