sw/source/core/crsr/DropDownFormFieldButton.cxx | 2 +- sw/source/core/crsr/bookmrk.cxx | 8 +++++++- sw/source/core/doc/docbm.cxx | 5 ++--- sw/source/core/inc/bookmrk.hxx | 1 + sw/source/uibase/shells/textsh1.cxx | 13 +++++++++---- 5 files changed, 20 insertions(+), 9 deletions(-)
New commits: commit 4d3e17afe589d2207dd2cb6dc8c2aa0889227e91 Author: Tamás Zolnai <[email protected]> AuthorDate: Fri Mar 8 09:58:34 2019 +0100 Commit: Tamás Zolnai <[email protected]> CommitDate: Fri Mar 8 09:58:34 2019 +0100 More fixes about rendering Change-Id: I927fcf986a0282448e4a046d7db847fe7bc5e066 diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx index cf73102f6ba4..b2b45af15264 100644 --- a/sw/source/core/crsr/DropDownFormFieldButton.cxx +++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx @@ -196,7 +196,7 @@ void DropDownFormFieldButton::Paint(vcl::RenderContext& rRenderContext, const to = Color(lcl_GetFillColor(aLineColor.getBColor(), (m_pFieldPopup ? 0.5 : 0.75))); // Draw the frame around the field - // GTK3 backend cuts down the frame top and left border so add a padding around the frame + // GTK3 backend cuts down the frame's top and left border, to avoid that add a padding around the frame int nPadding = 1; Point aPos (nPadding, nPadding); Size aSize (m_aFieldFramePixel.GetSize().Width() - nPadding, m_aFieldFramePixel.GetSize().Height() - 2); diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 954b0bfaf821..2e2a5417d0a0 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -537,13 +537,19 @@ namespace sw { namespace mark if(!m_pButton) m_pButton = VclPtr<DropDownFormFieldButton>::Create(pEditWin, *this); m_pButton->CalcPosAndSize(m_aPortionPaintArea); - m_pButton->Show(false); // Hide the button here and make it visible later, to make transparent background work with SAL_USE_VCLPLUGIN=gen + m_pButton->Show(); } } void DropDownFieldmark::HideButton() { if(m_pButton) + m_pButton->Show(false); + } + + void DropDownFieldmark::RemoveButton() + { + if(m_pButton) m_pButton.disposeAndClear(); } }} diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index d9acb0f6a28f..13b1926ee62f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1166,8 +1166,7 @@ namespace sw { namespace mark if(pNewActiveFieldmark != m_pLastActiveFieldmark) { - if(m_pLastActiveFieldmark) - m_pLastActiveFieldmark->HideButton(); + ClearFieldActivation(); m_pLastActiveFieldmark = pNewActiveFieldmark; } } @@ -1175,7 +1174,7 @@ namespace sw { namespace mark void MarkManager::ClearFieldActivation() { if(m_pLastActiveFieldmark) - m_pLastActiveFieldmark->HideButton(); + m_pLastActiveFieldmark->RemoveButton(); m_pLastActiveFieldmark = nullptr; } diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index 22d55d723a5e..e14afc12ccf7 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -276,6 +276,7 @@ namespace sw { void ShowButton(SwEditWin* pEditWin); void HideButton(); + void RemoveButton(); private: SwRect m_aPortionPaintArea; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 3bcce84ca476..edda5ba52865 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -121,6 +121,7 @@ #include <memory> #include <xmloff/odffields.hxx> #include <swabstdlg.hxx> +#include <bookmrk.hxx> using namespace ::com::sun::star; using namespace com::sun::star::beans; @@ -1383,10 +1384,14 @@ void SwTextShell::Execute(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateDropDownFormFieldDialog(rWrtSh.GetView().GetFrameWeld(), pFieldBM)); - pDlg->Execute(); - pFieldBM->Invalidate(); - rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() ); - rWrtSh.UpdateCursor(); // cursor position might be invalid + if (pDlg->Execute() == RET_OK) + { + pFieldBM->Invalidate(); + rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() ); + rWrtSh.UpdateCursor(); // cursor position might be invalid + // Hide the button here and make it visible later, to make transparent background work with SAL_USE_VCLPLUGIN=gen + dynamic_cast<::sw::mark::DropDownFieldmark*>(pFieldBM)->HideButton(); + } } else { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
