cui/source/factory/dlgfact.cxx | 4 - cui/source/factory/dlgfact.hxx | 2 include/comphelper/windowsdebugoutput.hxx | 8 +- include/sfx2/app.hxx | 2 include/sfx2/event.hxx | 80 ++++++++++++++++++++++++++++ include/sfx2/sfxdlg.hxx | 2 include/svl/hint.hxx | 84 ++++++++++++++++++++++++++++++ include/vcl/ITiledRenderable.hxx | 3 + sd/source/ui/func/fuinsert.cxx | 21 ------- sd/source/ui/inc/View.hxx | 2 sd/source/ui/inc/Window.hxx | 1 sd/source/ui/view/sdview2.cxx | 13 ---- sd/source/ui/view/sdwindow.cxx | 20 +++++++ sfx2/source/appl/appserv.cxx | 3 - sw/source/uibase/app/docsh2.cxx | 2 sw/source/uibase/uno/unotxdoc.cxx | 2 vcl/headless/svpframe.cxx | 3 + vcl/source/window/dialog.cxx | 1 18 files changed, 212 insertions(+), 41 deletions(-)
New commits: commit c4ff1027fed8ee79fffd36fee9dac6788a9a579d Author: Tor Lillqvist <[email protected]> Date: Sun Mar 25 12:55:37 2018 +0300 Fix copy-paste error Change-Id: I01b20482aefadb1a755cc1d2f5705b2f7f7cf739 (cherry picked from commit 9c7f19a6a38eb6796df6216ff3f014db30dd635a) diff --git a/include/comphelper/windowsdebugoutput.hxx b/include/comphelper/windowsdebugoutput.hxx index 17c60b3d74cc..b8edf723443f 100644 --- a/include/comphelper/windowsdebugoutput.hxx +++ b/include/comphelper/windowsdebugoutput.hxx @@ -87,7 +87,7 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t else if (IsEqualIID(rIid, IID_IdentityUnmarshal)) stream << "=\"IdentityUnmarshal\""; else if (IsEqualIID(rIid, IID_IFastRundown)) - stream << "=\"IdentityUnmarshal\""; + stream << "=\"IFastRundown\""; else if (IsEqualIID(rIid, IID_IStdMarshalInfo)) stream << "=\"IStdMarshalInfo\""; else if (IsEqualIID(rIid, IID_IAgileObject)) commit 1f592e4eac40f9e1b291fb82fe77c6da31c1ab43 Author: Pranav Kant <[email protected]> Date: Fri Mar 23 16:24:24 2018 +0530 lok: don't post events on disposed window Change-Id: I7721380b1bb6e9ec21338a72523326d0cae6729e Reviewed-on: https://gerrit.libreoffice.org/51777 Tested-by: Jenkins <[email protected]> Reviewed-by: pranavk <[email protected]> (cherry picked from commit ed4df95f28d4081c8d244dc013fda53cee5f91b7) diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index b95ac6386829..e25cdd67506a 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -101,6 +101,9 @@ public: static void LOKPostAsyncEvent(void* pEv, void*) { LOKAsyncEventData* pLOKEv = static_cast<LOKAsyncEventData*>(pEv); + if (pLOKEv->mpWindow->IsDisposed()) + return; + switch (pLOKEv->mnEvent) { case VclEventId::WindowKeyInput: diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index a0b549b11329..2fbe632f650d 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3484,7 +3484,7 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) SolarMutexGuard aGuard; VclPtr<vcl::Window> pWindow = getDocWindow(); - if (!pWindow) + if (!pWindow || pWindow->IsDisposed()) return; LOKAsyncEventData* pLOKEv = new LOKAsyncEventData; commit fd3264a5538af601a965890483d7916b59f36e07 Author: Tor Lillqvist <[email protected]> Date: Tue Mar 20 14:30:55 2018 +0200 Mention that SfxApplication is a singleton Change-Id: Ib1f46c9172285245ed7bbc1fab299d29928c4d10 (cherry picked from commit c5fc1a0bbffa73d0a7249f8b38823588446831c8) diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index d3384e7f5a38..b4d31614917b 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -112,6 +112,8 @@ public: GetValue() const { return aLink; } }; +// This is a singleton class. Sad that there apparently is no other +// way than a comment like this to indicate that to the code reader. class SFX2_DLLPUBLIC SfxApplication: public SfxShell { std::unique_ptr<SfxAppData_Impl> pImpl; commit 7812d593f093b7e9019dcd26a8370a8ba2312874 Author: Tor Lillqvist <[email protected]> Date: Tue Mar 20 13:53:25 2018 +0200 Add debug output operator<< for SfxHintId, SvMacroItemId, and SfxEventHintId Change-Id: I36fd3efc630d99643fb7db3b89f777d4054ec87d Reviewed-on: https://gerrit.libreoffice.org/51651 Tested-by: Jenkins <[email protected]> Reviewed-by: Tor Lillqvist <[email protected]> (cherry picked from commit 406edb6407532ed725165c2d7e1d360680050377) diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx index 3e86bcd9989b..dc33329f990f 100644 --- a/include/sfx2/event.hxx +++ b/include/sfx2/event.hxx @@ -20,6 +20,9 @@ #define INCLUDED_SFX2_EVENT_HXX #include <sal/config.h> + +#include <ostream> + #include <sfx2/dllapi.h> #include <svl/hint.hxx> #include <unotools/eventcfg.hxx> @@ -70,6 +73,42 @@ enum class SvMacroItemId : sal_uInt16 { SwFrmMove = 20007, }; +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const SvMacroItemId& id ) +{ + switch(id) + { + case SvMacroItemId::NONE: return stream << "NONE"; + case SvMacroItemId::HtmlOnSubmitForm: return stream << "HtmlOnSubmitForm"; + case SvMacroItemId::HtmlOnResetForm: return stream << "HtmlOnResetForm"; + case SvMacroItemId::HtmlOnGetFocus: return stream << "HtmlOnGetFocus"; + case SvMacroItemId::HtmlOnLoseFocus: return stream << "HtmlOnLoseFocus"; + case SvMacroItemId::HtmlOnClick: return stream << "HtmlOnClick"; + case SvMacroItemId::HtmlOnClickItem: return stream << "HtmlOnClickItem"; + case SvMacroItemId::HtmlOnChange: return stream << "HtmlOnChange"; + case SvMacroItemId::HtmlOnSelect: return stream << "HtmlOnSelect"; + case SvMacroItemId::OpenDoc: return stream << "OpenDoc"; + case SvMacroItemId::PrepareCloseDoc: return stream << "PrepareCloseDoc"; + case SvMacroItemId::ActivateDoc: return stream << "ActivateDoc"; + case SvMacroItemId::DeactivateDoc: return stream << "DeactivateDoc"; + case SvMacroItemId::OnMouseOver: return stream << "OnMouseOver"; + case SvMacroItemId::OnClick: return stream << "OnClick"; + case SvMacroItemId::OnMouseOut: return stream << "OnMouseOut"; + case SvMacroItemId::OnImageLoadDone: return stream << "OnImageLoadDone"; + case SvMacroItemId::OnImageLoadCancel: return stream << "OnImageLoadCancel"; + case SvMacroItemId::OnImageLoadError: return stream << "OnImageLoadError"; + case SvMacroItemId::SwObjectSelect: return stream << "SwObjectSelect"; + case SvMacroItemId::SwStartInsGlossary: return stream << "SwStartInsGlossary"; + case SvMacroItemId::SwEndInsGlossary: return stream << "SwEndInsGlossary"; + case SvMacroItemId::SwFrmKeyInputAlpha: return stream << "SwFrmKeyInputAlpha"; + case SvMacroItemId::SwFrmKeyInputNoAlpha: return stream << "SwFrmKeyInputNoAlpha"; + case SvMacroItemId::SwFrmResize: return stream << "SwFrmResize"; + case SvMacroItemId::SwFrmMove: return stream << "SwFrmMove"; + default: return stream << "unk(" << std::to_string(int(id)) << ")"; + } +} + class SfxObjectShell; enum class SfxEventHintId { @@ -107,6 +146,47 @@ enum class SfxEventHintId { SwEventLayoutFinished, }; +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const SfxEventHintId& id ) +{ + switch(id) + { + case SfxEventHintId::NONE: return stream << "NONE"; + case SfxEventHintId::ActivateDoc: return stream << "ActivateDoc"; + case SfxEventHintId::CloseDoc: return stream << "CloseDoc"; + case SfxEventHintId::CloseView: return stream << "CloseView"; + case SfxEventHintId::CreateDoc: return stream << "CreateDoc"; + case SfxEventHintId::DeactivateDoc: return stream << "DeactivateDoc"; + case SfxEventHintId::DocCreated: return stream << "DocCreated"; + case SfxEventHintId::LoadFinished: return stream << "LoadFinished"; + case SfxEventHintId::ModifyChanged: return stream << "ModifyChanged"; + case SfxEventHintId::OpenDoc: return stream << "OpenDoc"; + case SfxEventHintId::PrepareCloseDoc: return stream << "PrepareCloseDoc"; + case SfxEventHintId::PrepareCloseView: return stream << "PrepareCloseView"; + case SfxEventHintId::PrintDoc: return stream << "PrintDoc"; + case SfxEventHintId::SaveAsDoc: return stream << "SaveAsDoc"; + case SfxEventHintId::SaveAsDocDone: return stream << "SaveAsDocDone"; + case SfxEventHintId::SaveAsDocFailed: return stream << "SaveAsDocFailed"; + case SfxEventHintId::SaveDoc: return stream << "SaveDoc"; + case SfxEventHintId::SaveDocDone: return stream << "SaveDocDone"; + case SfxEventHintId::SaveDocFailed: return stream << "SaveDocFailed"; + case SfxEventHintId::SaveToDoc: return stream << "SaveToDoc"; + case SfxEventHintId::SaveToDocDone: return stream << "SaveToDocDone"; + case SfxEventHintId::SaveToDocFailed: return stream << "SaveToDocFailed"; + case SfxEventHintId::StorageChanged: return stream << "StorageChanged"; + case SfxEventHintId::ViewCreated: return stream << "ViewCreated"; + case SfxEventHintId::VisAreaChanged: return stream << "VisAreaChanged"; + case SfxEventHintId::SwMailMerge: return stream << "SwMailMerge"; + case SfxEventHintId::SwMailMergeEnd: return stream << "SwMailMergeEnd"; + case SfxEventHintId::SwEventPageCount: return stream << "SwEventPageCount"; + case SfxEventHintId::SwEventFieldMerge: return stream << "SwEventFieldMerge"; + case SfxEventHintId::SwEventFieldMergeFinished: return stream << "SwEventFieldMergeFinished"; + case SfxEventHintId::SwEventLayoutFinished: return stream << "SwEventLayoutFinished"; + default: return stream << "unk(" << std::to_string(int(id)) << ")"; + } +} + class SFX2_DLLPUBLIC SfxEventHint : public SfxHint { SfxObjectShell* pObjShell; diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index 223151362e6d..d01d746fc2e2 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -19,6 +19,8 @@ #ifndef INCLUDED_SVL_HINT_HXX #define INCLUDED_SVL_HINT_HXX +#include <ostream> + #include <sal/types.h> #include <svl/svldllapi.h> @@ -117,6 +119,88 @@ enum class SfxHintId { SwSplitNodeOperation, }; +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const SfxHintId& id ) +{ + switch(id) + { + case SfxHintId::NONE: return stream << "NONE"; + case SfxHintId::Dying: return stream << "Dying"; + case SfxHintId::NameChanged: return stream << "NameChanged"; + case SfxHintId::TitleChanged: return stream << "TitleChanged"; + case SfxHintId::DataChanged: return stream << "DataChanged"; + case SfxHintId::DocChanged: return stream << "DocChanged"; + case SfxHintId::UpdateDone: return stream << "UpdateDone"; + case SfxHintId::Deinitializing: return stream << "Deinitializing"; + case SfxHintId::ModeChanged: return stream << "ModeChanged"; + case SfxHintId::ColorsChanged: return stream << "ColorsChanged"; + case SfxHintId::LanguageChanged: return stream << "LanguageChanged"; + case SfxHintId::RedlineChanged: return stream << "RedlineChanged"; + case SfxHintId::DocumentRepair: return stream << "DocumentRepair"; + case SfxHintId::TextParaInserted: return stream << "TextParaInserted"; + case SfxHintId::TextParaRemoved: return stream << "TextParaRemoved"; + case SfxHintId::TextParaContentChanged: return stream << "TextParaContentChanged"; + case SfxHintId::TextHeightChanged: return stream << "TextHeightChanged"; + case SfxHintId::TextFormatPara: return stream << "TextFormatPara"; + case SfxHintId::TextFormatted: return stream << "TextFormatted"; + case SfxHintId::TextModified: return stream << "TextModified"; + case SfxHintId::TextBlockNotificationStart: return stream << "TextBlockNotificationStart"; + case SfxHintId::TextBlockNotificationEnd: return stream << "TextBlockNotificationEnd"; + case SfxHintId::TextInputStart: return stream << "TextInputStart"; + case SfxHintId::TextInputEnd: return stream << "TextInputEnd"; + case SfxHintId::TextViewScrolled: return stream << "TextViewScrolled"; + case SfxHintId::TextViewSelectionChanged: return stream << "TextViewSelectionChanged"; + case SfxHintId::TextViewCaretChanged: return stream << "TextViewCaretChanged"; + case SfxHintId::BasicDataWanted: return stream << "BasicDataWanted"; + case SfxHintId::BasicDataChanged: return stream << "BasicDataChanged"; + case SfxHintId::BasicInfoWanted: return stream << "BasicInfoWanted"; + case SfxHintId::BasicStart: return stream << "BasicStart"; + case SfxHintId::BasicStop: return stream << "BasicStop"; + case SfxHintId::EditSourceParasMoved: return stream << "EditSourceParasMoved"; + case SfxHintId::EditSourceSelectionChanged: return stream << "EditSourceSelectionChanged"; + case SfxHintId::ScDataChanged: return stream << "ScDataChanged"; + case SfxHintId::ScTableOpDirty: return stream << "ScTableOpDirty"; + case SfxHintId::ScCalcAll: return stream << "ScCalcAll"; + case SfxHintId::ScReference: return stream << "ScReference"; + case SfxHintId::ScDrawLayerNew: return stream << "ScDrawLayerNew"; + case SfxHintId::ScDbAreasChanged: return stream << "ScDbAreasChanged"; + case SfxHintId::ScAreasChanged: return stream << "ScAreasChanged"; + case SfxHintId::ScTablesChanged: return stream << "ScTablesChanged"; + case SfxHintId::ScDrawChanged: return stream << "ScDrawChanged"; + case SfxHintId::ScDocNameChanged: return stream << "ScDocNameChanged"; + case SfxHintId::ScAreaLinksChanged: return stream << "ScAreaLinksChanged"; + case SfxHintId::ScShowRangeFinder: return stream << "ScShowRangeFinder"; + case SfxHintId::ScDocSaved: return stream << "ScDocSaved"; + case SfxHintId::ScForceSetTab: return stream << "ScForceSetTab"; + case SfxHintId::ScNavigatorUpdateAll: return stream << "ScNavigatorUpdateAll"; + case SfxHintId::ScAnyDataChanged: return stream << "ScAnyDataChanged"; + case SfxHintId::ScPrintOptions: return stream << "ScPrintOptions"; + case SfxHintId::ScRefModeChanged: return stream << "ScRefModeChanged"; + case SfxHintId::ScKillEditView: return stream << "ScKillEditView"; + case SfxHintId::ScKillEditViewNoPaint: return stream << "ScKillEditViewNoPaint"; + case SfxHintId::ScHiddenRowsChanged: return stream << "ScHiddenRowsChanged"; + case SfxHintId::ScSelectionChanged: return stream << "ScSelectionChanged"; + case SfxHintId::ScClearCache: return stream << "ScClearCache"; + case SfxHintId::ScAccTableChanged: return stream << "ScAccTableChanged"; + case SfxHintId::ScAccCursorChanged: return stream << "ScAccCursorChanged"; + case SfxHintId::ScAccVisAreaChanged: return stream << "ScAccVisAreaChanged"; + case SfxHintId::ScAccEnterEditMode: return stream << "ScAccEnterEditMode"; + case SfxHintId::ScAccLeaveEditMode: return stream << "ScAccLeaveEditMode"; + case SfxHintId::ScAccMakeDrawLayer: return stream << "ScAccMakeDrawLayer"; + case SfxHintId::ScAccWindowResized: return stream << "ScAccWindowResized"; + case SfxHintId::StyleSheetCreated: return stream << "StyleSheetCreated"; + case SfxHintId::StyleSheetModified: return stream << "StyleSheetModified"; + case SfxHintId::StyleSheetChanged: return stream << "StyleSheetChanged"; + case SfxHintId::StyleSheetErased: return stream << "StyleSheetErased"; + case SfxHintId::StyleSheetInDestruction: return stream << "StyleSheetInDestruction"; + case SfxHintId::MathFormatChanged: return stream << "MathFormatChanged"; + case SfxHintId::SwDrawViewsCreated: return stream << "SwDrawViewsCreated"; + case SfxHintId::SwSplitNodeOperation: return stream << "SwSplitNodeOperation"; + default: return stream << "unk(" << std::to_string(int(id)) << ")"; + } +} + class SVL_DLLPUBLIC SfxHint { private: commit 1af833522249c7ed0e4d41bfb742382814d54d97 Author: Jan Holesovsky <[email protected]> Date: Fri Mar 16 22:23:14 2018 +0100 lokdialog: Set parent for AutoCorrect Options... so that it can be tunneled. To get this dialog: Right-click on a mis-spelled word, and it's in the tunneled context menu. Still it should be converted to async though. Change-Id: Ia8f2aaf0d04f144c74999107de98e52cd51876e7 Reviewed-on: https://gerrit.libreoffice.org/51441 Reviewed-by: pranavk <[email protected]> Tested-by: pranavk <[email protected]> (cherry picked from commit 7b83827d7b5d07401878fe552c421331629a7880) Reviewed-on: https://gerrit.libreoffice.org/51548 Tested-by: Jenkins <[email protected]> Reviewed-by: Jan Holesovsky <[email protected]> (cherry picked from commit 67a023ef9b251c1e6e2a46521a51ad829c417451) diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index c903cc3b4d76..10d3724ce658 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -866,9 +866,9 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateFrameDialog( const R } // TabDialog outside the drawing layer -VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateAutoCorrTabDialog( const SfxItemSet* pAttrSet ) +VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateAutoCorrTabDialog(vcl::Window* pParent, const SfxItemSet* pAttrSet) { - VclPtrInstance<OfaAutoCorrDlg> pDlg( nullptr, pAttrSet ); + VclPtrInstance<OfaAutoCorrDlg> pDlg(pParent, pAttrSet); return VclPtr<CuiAbstractTabDialog_Impl>::Create( pDlg ); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index e997d784f261..221480ce530a 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -473,7 +473,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateFrameDialog( const css::uno::Reference< css::frame::XFrame >& rxFrame, sal_uInt32 nResId, const OUString& rParameter ) override; - virtual VclPtr<SfxAbstractTabDialog> CreateAutoCorrTabDialog( const SfxItemSet* pAttrSet ) override; + virtual VclPtr<SfxAbstractTabDialog> CreateAutoCorrTabDialog(vcl::Window* pParent, const SfxItemSet* pAttrSet) override; virtual VclPtr<SfxAbstractTabDialog> CreateCustomizeTabDialog( const SfxItemSet* pAttrSet, const css::uno::Reference< css::frame::XFrame >& xViewFrame ) override; diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index 35aaa384a15c..e6e8a4046695 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -129,7 +129,7 @@ public: virtual ~SfxAbstractDialogFactory() override; // needed for export of vtable static SfxAbstractDialogFactory* Create(); virtual VclPtr<VclAbstractDialog> CreateFrameDialog( const css::uno::Reference< css::frame::XFrame >& rFrame, sal_uInt32 nResId, const rtl::OUString& rParameter ) = 0; - virtual VclPtr<SfxAbstractTabDialog> CreateAutoCorrTabDialog( const SfxItemSet* pAttrSet ) = 0; + virtual VclPtr<SfxAbstractTabDialog> CreateAutoCorrTabDialog(vcl::Window* pParent, const SfxItemSet* pAttrSet) = 0; virtual VclPtr<SfxAbstractTabDialog> CreateCustomizeTabDialog( const SfxItemSet* pAttrSet, const css::uno::Reference< css::frame::XFrame >& xViewFrame ) = 0; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index b9c2ddad88f9..334330afda8e 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1600,7 +1600,8 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), false, &pItem ) == SfxItemState::SET ) aSet.Put( *pItem ); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateAutoCorrTabDialog( &aSet )); + const SfxViewFrame* pViewFrame = SfxViewFrame::Current(); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateAutoCorrTabDialog(pViewFrame? &pViewFrame->GetWindow(): nullptr, &aSet)); pDlg->Execute(); } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index efad6a1cf4e8..59a28f720d1e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -372,7 +372,7 @@ void SwDocShell::Execute(SfxRequest& rReq) aSet.Put( *static_cast<const SfxBoolItem*>(pOpenSmartTagOptionsItem) ); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - VclPtr<SfxAbstractTabDialog> pDlg = pFact->CreateAutoCorrTabDialog( &aSet ); + VclPtr<SfxAbstractTabDialog> pDlg = pFact->CreateAutoCorrTabDialog(&GetView()->GetViewFrame()->GetWindow(), &aSet); pDlg->Execute(); pDlg.disposeAndClear(); commit 80481f4e2c76bcfbc7e735f78f5c5c81f6ab0d67 Author: Tor Lillqvist <[email protected]> Date: Mon Mar 19 14:14:15 2018 +0200 Add BSTR handling Change-Id: I89fcb37a5848120d5a3b2d73d40384c18d6cc069 (cherry picked from commit 584063ccaa3c5b7b984f30e288380cdf3b2f0ec4) diff --git a/include/comphelper/windowsdebugoutput.hxx b/include/comphelper/windowsdebugoutput.hxx index d4e3372d5bec..17c60b3d74cc 100644 --- a/include/comphelper/windowsdebugoutput.hxx +++ b/include/comphelper/windowsdebugoutput.hxx @@ -291,7 +291,8 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t stream << *(double*)rVariant.byref; break; // FIXME case VT_BSTR: - stream << (OLECHAR*)rVariant.byref; + stream << std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>().to_bytes( + *(OLECHAR**)rVariant.byref); break; case VT_DISPATCH: stream << rVariant.byref; @@ -415,7 +416,8 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t stream << (double)rVariant.date; break; // FIXME case VT_BSTR: - stream << rVariant.bstrVal; + stream << std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>().to_bytes( + rVariant.bstrVal); break; case VT_DISPATCH: stream << rVariant.pdispVal; commit 2682c5a0975a4b8f43480eb66ff6a95bbf26fc5e Author: Jan Holesovsky <[email protected]> Date: Fri Mar 16 21:19:10 2018 +0100 lok: 14pt font is too large for the context menus. Change-Id: I8403b2bea81e61c4fa24ed205b8d2c77a235238b Reviewed-on: https://gerrit.libreoffice.org/51438 Reviewed-by: Michael Meeks <[email protected]> Tested-by: Michael Meeks <[email protected]> (cherry picked from commit 8e98b3150f7ac0b569b686dd67f4699b307b30f8) Reviewed-on: https://gerrit.libreoffice.org/51439 Reviewed-by: Jan Holesovsky <[email protected]> Tested-by: Jenkins <[email protected]> (cherry picked from commit 2dd2d2fd9924e50c5b68c8942c26bf8a07fa2bf0) diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 640c84136da5..25419302dc5f 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -421,6 +421,9 @@ void SvpSalFrame::UpdateSettings( AllSettings& rSettings ) aStdFont.SetWeight( WEIGHT_NORMAL ); aStdFont.SetFamilyName( "Liberation Sans" ); aStyleSettings.BatchSetFonts( aStdFont, aStdFont ); + + aStdFont.SetFontSize(Size(0, 12)); + aStyleSettings.SetMenuFont(aStdFont); } rSettings.SetStyleSettings( aStyleSettings ); commit 1d2dac5af592784b694cd5607ac98103d305f9a7 Author: Pranav Kant <[email protected]> Date: Mon Mar 19 11:50:26 2018 +0530 sd: fix incorrect visible center calculation Don't call PixelToLogic twice. Thanks Ashod for noticing. Change-Id: Id280dad7e310ceaf8678f900e6e70214848dd925 Reviewed-on: https://gerrit.libreoffice.org/51529 Tested-by: Jenkins <[email protected]> Reviewed-by: pranavk <[email protected]> (cherry picked from commit be8883bcb250bdbfbb77a76b244d97a30a97d77a) diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 9d34aad34ed0..f5c747ec8fec 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -693,7 +693,7 @@ Point Window::GetVisibleCenter() aWinSize.setWidth( maViewSize.Width() ); Point aPos; - aPos = ::tools::Rectangle(aPos, aWinSize).Center(); + aPos = ::tools::Rectangle(aPos, GetOutputSizePixel()).Center(); // For LOK bool bMapModeWasEnabled(IsMapModeEnabled()); commit 0a9bbbb9e28790a5b94997dde0adb7b0be9ab0fa Author: Pranav Kant <[email protected]> Date: Mon Mar 19 12:04:40 2018 +0530 cid#1430098: mbInSyncExecute is uninitialized Change-Id: Id5288ce8680b121522c1e35edc52ef24be4ead8b (cherry picked from commit 7be3dfa4b4705725be4987beeb79dbe5f6a4edae) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 797bf124144c..dc95f7772703 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -353,6 +353,7 @@ void Dialog::ImplInitDialogData() { mpWindowImpl->mbDialog = true; mbInExecute = false; + mbInSyncExecute = false; mbInClose = false; mbModalMode = false; mbPaintComplete = false; commit 4f728055e37dbc0a237925440faaed250e149653 Author: Pranav Kant <[email protected]> Date: Thu Mar 8 21:07:40 2018 +0100 sd lok: Enable mapmode in case of lok to calculate center This reverts the solution in 9fee132c18b658c9ea9fb1114c1fefa56b57532a. Also, calculate center using the new function for chart, image, and text shape insertion. Reviewed-on: https://gerrit.libreoffice.org/51343 Tested-by: Jenkins <[email protected]> Reviewed-by: pranavk <[email protected]> (cherry picked from commit 1990fc47bb561fcb9f98cbdcb7f986b93a54b876) Change-Id: Ie893050b7c875760db0194e7a3f0c2cd3068963b diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index e0ad64bd7169..9204c5ba6ffe 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -69,7 +69,6 @@ #include <sfx2/opengrf.hxx> #include <sfx2/viewfrm.hxx> #include <svx/charthelper.hxx> -#include <comphelper/lok.hxx> #include <app.hrc> #include <sdresid.hxx> @@ -170,20 +169,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq ) bSelectionReplaced = true; } - Point aPos; - // For LOK, set position to center of the page - if (comphelper::LibreOfficeKit::isActive()) - aPos = ::tools::Rectangle(aPos, mpView->GetSdrPageView()->GetPage()->GetSize()).Center(); - else - { - ::tools::Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() ); - aPos = aRect.Center(); - bool bMapModeWasEnabled(mpWindow->IsMapModeEnabled()); - mpWindow->EnableMapMode(/*true*/); - aPos = mpWindow->PixelToLogic(aPos); - mpWindow->EnableMapMode(bMapModeWasEnabled); - } - + Point aPos = mpWindow->GetVisibleCenter(); SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, aPos, pPickObj, nullptr); if(pGrafObj && bAsLink ) @@ -380,10 +366,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) aSize = OutputDevice::LogicToLogic(aSize, MapMode(aUnit), MapMode(MapUnit::Map100thMM)); } - Point aPos; - ::tools::Rectangle aWinRect(aPos, mpWindow->GetOutputSizePixel() ); - aPos = aWinRect.Center(); - aPos = mpWindow->PixelToLogic(aPos); + Point aPos = mpWindow->GetVisibleCenter(); aPos.X() -= aSize.Width() / 2; aPos.Y() -= aSize.Height() / 2; aRect = ::tools::Rectangle(aPos, aSize); diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 63b124b33f42..42d658cd40bc 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -91,7 +91,7 @@ public: void SelectAll(); void DoCut(); void DoCopy(); - void DoPaste(vcl::Window const * pWindow=nullptr); + void DoPaste(::sd::Window* pWindow=nullptr); virtual void DoConnect(SdrOle2Obj* pOleObj) override; virtual bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr = false); void StartDrag( const Point& rStartPos, vcl::Window* pWindow ); diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx index e60e35a89557..ad843324cb1d 100644 --- a/sd/source/ui/inc/Window.hxx +++ b/sd/source/ui/inc/Window.hxx @@ -131,6 +131,7 @@ public: void SetVisibleXY(double fX, double fY); double GetVisibleWidth(); double GetVisibleHeight(); + Point GetVisibleCenter(); double GetScrlLineWidth(); double GetScrlLineHeight(); double GetScrlPageWidth(); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 7a042c44623a..746caede60cf 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -264,7 +264,7 @@ void View::DoCopy() } } -void View::DoPaste (vcl::Window const * pWindow) +void View::DoPaste (::sd::Window* pWindow) { TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewSh->GetActiveWindow() ) ); if( !aDataHelper.GetTransferable().is() ) @@ -315,17 +315,8 @@ void View::DoPaste (vcl::Window const * pWindow) } else { - Point aPos; sal_Int8 nDnDAction = DND_ACTION_COPY; - - if( pWindow ) - { - if (comphelper::LibreOfficeKit::isActive()) - aPos = ::tools::Rectangle(aPos, GetSdrPageView()->GetPage()->GetSize()).Center(); - else - aPos = pWindow->PixelToLogic( ::tools::Rectangle( aPos, pWindow->GetOutputSizePixel() ).Center() ); - } - + Point aPos = pWindow->GetVisibleCenter(); DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpDocSh->GetViewShell() ); if (pDrViewSh != nullptr) diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index b3009d6f1b22..9d34aad34ed0 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -684,6 +684,26 @@ double Window::GetVisibleHeight() return ((double) aWinSize.Height() / maViewSize.Height()); } +Point Window::GetVisibleCenter() +{ + Size aWinSize = PixelToLogic(GetOutputSizePixel()); + if ( aWinSize.Height() > maViewSize.Height() ) + aWinSize.setHeight( maViewSize.Height() ); + if ( aWinSize.Width() > maViewSize.Width() ) + aWinSize.setWidth( maViewSize.Width() ); + + Point aPos; + aPos = ::tools::Rectangle(aPos, aWinSize).Center(); + + // For LOK + bool bMapModeWasEnabled(IsMapModeEnabled()); + EnableMapMode(/*true*/); + aPos = PixelToLogic(aPos); + EnableMapMode(bMapModeWasEnabled); + + return aPos; +} + /** * @returns width of a scroll column in proportion to the width of the whole * working area. _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
