[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2023-02-16 Thread Caolán McNamara (via logerrit)
 include/sfx2/request.hxx   |2 +-
 sfx2/source/control/request.cxx|5 ++---
 sw/source/ui/misc/glossary.cxx |6 +++---
 sw/source/uibase/shells/basesh.cxx |2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 3e36caa1ec24a465a0918dd63976dfd970a41c1d
Author: Caolán McNamara 
AuthorDate: Thu Feb 16 10:50:36 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 16 19:18:29 2023 +

HasMacroRecorder can take a reference, never passed null

Change-Id: I213f2d93e49f03e88a5357af8fead32b97b2c37b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147149
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 5a97cb9e61b8..2d5939758eec 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -99,7 +99,7 @@ public:
 const SfxPoolItem*  GetReturnValue() const;
 
 static css::uno::Reference< css::frame::XDispatchRecorder > 
GetMacroRecorder( SfxViewFrame const * pFrame );
-static bool HasMacroRecorder( SfxViewFrame const * pFrame );
+static bool HasMacroRecorder(const SfxViewFrame& rFrame);
 SfxCallMode GetCallMode() const;
 voidAllowRecording( bool );
 boolAllowsRecording() const;
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index b43d1dd991bc..e7757adc82ef 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -709,12 +709,11 @@ css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorde
 return xRecorder;
 }
 
-bool SfxRequest::HasMacroRecorder( SfxViewFrame const * pView )
+bool SfxRequest::HasMacroRecorder(const SfxViewFrame& rView)
 {
-return GetMacroRecorder( pView ).is();
+return GetMacroRecorder().is();
 }
 
-
 bool SfxRequest::IsAPI() const
 
 /*  [Description]
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index e76702250033..aa7b83caf1c5 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -413,7 +413,7 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, 
void)
 ShowAutoText("", "");
 // update controls
 NameModify(*m_xShortNameEdit);
-if( SfxRequest::HasMacroRecorder( _pShell->GetView().GetViewFrame() ) )
+if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq( _pShell->GetView().GetViewFrame(), 
FN_SET_ACT_GLOSSARY );
 aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, 
getCurrentGlossary()));
@@ -436,7 +436,7 @@ void SwGlossaryDlg::Apply()
 {
 m_pGlossaryHdl->InsertGlossary(aGlosName);
 }
-if( SfxRequest::HasMacroRecorder( _pShell->GetView().GetViewFrame() ) )
+if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq( _pShell->GetView().GetViewFrame(), 
FN_INSERT_GLOSSARY );
 aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, 
getCurrentGlossary()));
@@ -593,7 +593,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OString&, 
rItemIdent, void)
 m_xShortNameEdit->set_text(aShortName);
 NameModify(*m_xNameED);   // for toggling the buttons
 
-if( SfxRequest::HasMacroRecorder( 
_pShell->GetView().GetViewFrame() ) )
+if 
(SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq(_pShell->GetView().GetViewFrame(), 
FN_NEW_GLOSSARY);
 aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, 
getCurrentGlossary()));
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 922e1c4c31ae..88cfb135ef84 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1272,7 +1272,7 @@ void SwBaseShell::Execute(SfxRequest )
 bool bInserted = false;
 //recording:
 SfxViewFrame& rViewFrame = GetView().GetViewFrame();
-if( SfxRequest::HasMacroRecorder() )
+if (SfxRequest::HasMacroRecorder(rViewFrame))
 {
 SfxRequest aReq( , nSlot);
 aReq.AppendItem( SfxStringItem( FN_PARAM_1, 
OUString(cDelim) ));


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2021-03-14 Thread Mike Kaganski (via logerrit)
 include/sfx2/tabdlg.hxx   |2 ++
 sfx2/source/dialog/tabdlg.cxx |7 ++-
 sw/source/ui/fldui/flddb.cxx  |4 
 sw/source/ui/fldui/flddb.hxx  |1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 0adf52a644aaf85ba2bd666147c62c134234ffbb
Author: Mike Kaganski 
AuthorDate: Sun Mar 14 14:42:15 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sun Mar 14 14:55:24 2021 +0100

tdf#141011: Postpone SwFieldDBPage::Reset to tab activation

This way, it will only ask for password when dialog is switched to that tab.

Change-Id: Ie2a453b0b6867ceb1ef3728a8565de4f6cbf4757
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112469
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 6397868a21d0..daa092b8d9b7 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -213,6 +213,8 @@ public:
 
 virtual boolFillItemSet( SfxItemSet* );
 virtual voidReset( const SfxItemSet* );
+// Allows to postpone some initialization to the first activation
+virtual boolDeferResetToFirstActivation();
 
 boolHasExchangeSupport() const
 { return bHasExchangeSupport; }
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 6f71e91fea88..47fa332390db 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -169,6 +169,8 @@ void SfxTabPage::Reset( const SfxItemSet* )
 {
 }
 
+bool SfxTabPage::DeferResetToFirstActivation() { return false; }
+
 void SfxTabPage::ActivatePage( const SfxItemSet& )
 /*  [Description]
 
@@ -920,7 +922,10 @@ void SfxTabDialogController::CreatePages()
 pDataObject->xTabPage->SetUserData(sUserData);
 
 PageCreated(pDataObject->sId, *pDataObject->xTabPage);
-pDataObject->xTabPage->Reset(m_pSet.get());
+if (pDataObject->xTabPage->DeferResetToFirstActivation())
+pDataObject->bRefresh = true; // Reset will be called in 
ActivatePageHdl
+else
+pDataObject->xTabPage->Reset(m_pSet.get());
 }
 }
 
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 963e1834533e..14492377629b 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -178,6 +178,10 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
 }
 }
 
+// SwFieldDBPage may ask for password to select current document's data source,
+// so only do that when activating the page, not when dialog is creating all 
pages
+bool SwFieldDBPage::DeferResetToFirstActivation() { return true; }
+
 bool SwFieldDBPage::FillItemSet(SfxItemSet* )
 {
 OUString sTableName;
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index e507fcb86ee0..b25c38699234 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -70,6 +70,7 @@ public:
 
 virtual boolFillItemSet( SfxItemSet* rSet ) override;
 virtual voidReset( const SfxItemSet* rSet ) override;
+virtual boolDeferResetToFirstActivation() override;
 
 virtual voidFillUserData() override;
 voidActivateMailMergeAddress();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2021-01-22 Thread Caolán McNamara (via logerrit)
 include/sfx2/ctrlitem.hxx|8 ++-
 sfx2/source/control/ctrlitem.cxx |   29 ++-
 sw/source/uibase/sidebar/PageFormatPanel.cxx |1 
 3 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 41372210fbbc497eb6353c998fca0b5502b331d9
Author: Caolán McNamara 
AuthorDate: Fri Jan 22 10:18:38 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 22 15:27:21 2021 +0100

tdf#135590 MapUnit::Map100thMM fallback is inappropiate for writer

which uses MapUnit::Twip

so directly after insert, envelope, ok the new document sidebar
was using MapUnit::Map100thMM to lookup paper sizes instead of
MapUnit::Twip giving inconsistent results against format, page

Change-Id: I6a92fddedfe9fef8ad7532ad00b2b38b9741bb69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109782
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
index 489fdb9461a8..da9f86f93e1c 100644
--- a/include/sfx2/ctrlitem.hxx
+++ b/include/sfx2/ctrlitem.hxx
@@ -30,9 +30,10 @@ class SfxBindings;
 class SFX2_DLLPUBLIC SfxControllerItem
 {
 private:
-sal_uInt16  nId;
+sal_uInt16  nId;
 SfxControllerItem*  pNext; // to notify next ControllerItem
 SfxBindings*pBindings;
+MapUnit eFallbackCoreMetric;
 
 public:
 SfxBindings &   GetBindings() {
@@ -67,6 +68,11 @@ public:
 virtual voidGetControlState( sal_uInt16 nSID, 
boost::property_tree::ptree& );
 
 MapUnit GetCoreMetric() const;
+// override what GetCoreMetric will return if it cannot determine the 
current CoreMetric
+voidSetFallbackCoreMetric(MapUnit eFallback)
+{
+eFallbackCoreMetric = eFallback;
+}
 
 static SfxItemState GetItemState( const SfxPoolItem* pState );
 
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index 1b039e44ad9d..308706f95b8c 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -152,9 +152,7 @@ void SfxControllerItem::ClearCache()
 pBindings->ClearCache_Impl( GetId() );
 }
 
-
 // replaces the successor in the list of bindings of the same id
-
 SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* 
pNewLink )
 {
 SfxControllerItem* pOldLink = pNext;
@@ -164,37 +162,32 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( 
SfxControllerItem* pNewLin
 
 
 // changes the id of unbound functions (e.g. for sub-menu-ids)
-
 void SfxControllerItem::SetId( sal_uInt16 nItemId )
 {
 DBG_ASSERT( !IsBound(), "changing id of bound binding" );
 nId = nItemId;
 }
 
-
 // creates an atomic item for a controller without registration.
-
-SfxControllerItem::SfxControllerItem():
-nId(0),
-pNext(this),
-pBindings(nullptr)
+SfxControllerItem::SfxControllerItem()
+: nId(0)
+, pNext(this)
+, pBindings(nullptr)
+, eFallbackCoreMetric(MapUnit::Map100thMM)
 {
 }
 
-
 // creates a representation of the function nId and registers it
-
-SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings  ):
-nId(nID),
-pNext(this),
-pBindings()
+SfxControllerItem::SfxControllerItem(sal_uInt16 nID, SfxBindings )
+: nId(nID)
+, pNext(this)
+, pBindings()
+, eFallbackCoreMetric(MapUnit::Map100thMM)
 {
 Bind(nId, );
 }
 
-
 // unregisters the item in the bindings
-
 SfxControllerItem::~SfxControllerItem()
 {
 dispose();
@@ -345,7 +338,7 @@ MapUnit SfxControllerItem::GetCoreMetric() const
 }
 
 SAL_INFO( "sfx.control", "W1: Can not find ItemPool!" );
-return MapUnit::Map100thMM;
+return eFallbackCoreMetric;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx 
b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 45019db48e9d..31d556ca15ee 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -139,6 +139,7 @@ void PageFormatPanel::dispose()
 void PageFormatPanel::Initialize()
 {
 mxPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Std );
+maPaperSizeController.SetFallbackCoreMetric(MapUnit::MapTwip);
 meUnit = maPaperSizeController.GetCoreMetric();
 mxPaperWidth->SetFieldUnit(meFUnit);
 mxPaperHeight->SetFieldUnit(meFUnit);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2020-02-28 Thread Grzegorz Araminowicz (via logerrit)
 include/sfx2/lokhelper.hxx |2 +-
 sfx2/source/view/lokhelper.cxx |7 +--
 sw/source/core/crsr/viscrs.cxx |   18 --
 3 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit ee78313613605f50795d8ba0fbcd4138c9845a51
Author: Grzegorz Araminowicz 
AuthorDate: Mon Oct 21 12:59:12 2019 +0200
Commit: Muhammet Kara 
CommitDate: Fri Feb 28 13:25:21 2020 +0100

lok: send hyperlink text and address under cursor

Change-Id: I827c51ae859b3d3649ec9d293b5ae8eaf4cbd630
Reviewed-on: https://gerrit.libreoffice.org/81219
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89691
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index f87432c792b8..e1827ef1967f 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -83,7 +83,7 @@ public:
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed.
 static void notifyInvalidation(SfxViewShell const* pThisView, const 
OString& rPayload);
 /// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, but tweaks it 
according to setOptionalFeatures() if needed.
-static void notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord = false);
+static void notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord = false, const 
OString& rHyperlink = "");
 /// Notifies all views with the given type and payload.
 static void notifyAllViews(int nType, const OString& rPayload);
 
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index f924ca8edaf4..56f7d7f4bc32 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -367,7 +367,7 @@ void 
SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
 }
 }
 
-void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord)
+void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord, const OString& 
rHyperlink)
 {
 if (DisableCallbacks::disabled())
 return;
@@ -375,8 +375,11 @@ void 
SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisVie
 OString sPayload;
 if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation())
 {
+OString sHyperlink = rHyperlink.isEmpty() ? "{}" : rHyperlink;
 sPayload = OStringLiteral("{ \"viewId\": \"") + 
OString::number(SfxLokHelper::getView()) +
-"\", \"rectangle\": \"" + rRectangle + "\", \"mispelledWord\": \"" 
+  OString::number(bMispelledWord ? 1 : 0) + "\" }";
+"\", \"rectangle\": \"" + rRectangle +
+"\", \"mispelledWord\": \"" +  OString::number(bMispelledWord ? 1 
: 0) +
+"\", \"hyperlink\": " + sHyperlink + " }";
 }
 else
 {
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 4c61a86bfbd5..400b79c869e1 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -238,18 +239,31 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * 
pViewShell)
 }
 }
 
+OString sHyperlink;
+SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr);
+if 
(const_cast(m_pCursorShell)->GetContentAtPos(aRect.Pos(), 
aContentAtPos))
+{
+const SwFormatINetFormat* pItem = static_cast(aContentAtPos.aFnd.pAttr);
+boost::property_tree::ptree aTree;
+aTree.put("text", aContentAtPos.sStr);
+aTree.put("link", pItem->GetValue());
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree, false);
+sHyperlink = OString(aStream.str().c_str()).trim();
+}
+
 if (pViewShell)
 {
 if (pViewShell == m_pCursorShell->GetSfxViewShell())
 {
-SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect, 
bIsWrong);
+SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect, 
bIsWrong, sHyperlink);
 }
 else
 
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, 
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
 }
 else
 {
-
SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), 
sRect, bIsWrong);
+
SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), 
sRect, bIsWrong, sHyperlink);
 SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2019-11-27 Thread Noel Grandin (via logerrit)
 include/sfx2/docfile.hxx |   27 +++
 include/sfx2/docinsert.hxx   |2 +-
 sfx2/source/doc/docfile.cxx  |   14 +++---
 sfx2/source/doc/sfxbasemodel.cxx |8 
 sw/source/core/unocore/unocrsrhelper.cxx |6 +++---
 5 files changed, 22 insertions(+), 35 deletions(-)

New commits:
commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2
Author: Noel Grandin 
AuthorDate: Wed Nov 27 11:47:57 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 28 08:30:09 2019 +0100

tdf#128898 import text from file with text-decode failed

regression from

commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844
tdf#127958 crash adding 2 or more files into writer master document

just make SfxMedium use shared_ptr, rather than the sometimes yes,
sometimes no, ownership.

Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1
Reviewed-on: https://gerrit.libreoffice.org/83930
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index ab2ea96aba28..2019b5738c01 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -69,35 +69,22 @@ class SFX2_DLLPUBLIC SfxMedium final : public SvRefBase
 public:
 
 SfxMedium();
-/**
- * @param pSet Takes ownership
- */
 SfxMedium( const OUString ,
StreamMode nOpenMode,
std::shared_ptr pFilter = 
nullptr,
-   std::unique_ptr pSet = nullptr 
);
-/**
- * @param pSet Takes ownership
- */
+   const std::shared_ptr& pSet = 
nullptr );
 SfxMedium( const OUString ,
const OUString ,
StreamMode nOpenMode,
std::shared_ptr pFilter = 
nullptr,
-   std::unique_ptr pSet = nullptr 
);
-
-/**
- * @param pSet does NOT take ownership
- */
+   const std::shared_ptr& pSet = 
nullptr );
 SfxMedium( const css::uno::Reference< 
css::embed::XStorage >& xStorage,
-const OUString& rBaseURL,
-const SfxItemSet* pSet=nullptr );
-/**
- * @param pSet does NOT take ownership
- */
+   const OUString& rBaseURL,
+   const std::shared_ptr& pSet = 
nullptr  );
 SfxMedium( const css::uno::Reference< 
css::embed::XStorage >& xStorage,
-const OUString& rBaseURL,
-const OUString& rTypeName,
-const SfxItemSet* pSet=nullptr );
+   const OUString& rBaseURL,
+   const OUString& rTypeName,
+   const std::shared_ptr& pSet = 
nullptr );
 SfxMedium( const css::uno::Sequence< 
css::beans::PropertyValue >& aArgs );
 
 virtual ~SfxMedium() override;
diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx
index 0148b854fed2..ae819299079c 100644
--- a/include/sfx2/docinsert.hxx
+++ b/include/sfx2/docinsert.hxx
@@ -50,7 +50,7 @@ private:
 
 std::unique_ptr
 m_pFileDlg;
-std::unique_ptr m_xItemSet;
+std::shared_ptr m_xItemSet;
 std::vector   m_pURLList;
 
 DECL_LINK(DialogClosedHdl, sfx2::FileDialogHelper*, void);
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 7f77ccc924dc..0e646ae723b5 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -287,7 +287,7 @@ public:
 OUString m_aLogicName;
 OUString m_aLongName;
 
-mutable std::unique_ptr m_pSet;
+mutable std::shared_ptr m_pSet;
 mutable std::unique_ptr m_pURLObj;
 
 std::shared_ptr m_pFilter;
@@ -3210,20 +3210,20 @@ void SfxMedium::CompleteReOpen()
 pImpl->bUseInteractionHandler = bUseInteractionHandler;
 }
 
-SfxMedium::SfxMedium(const OUString , StreamMode nOpenMode, 
std::shared_ptr pFilter, std::unique_ptr pInSet) :
+SfxMedium::SfxMedium(const OUString , StreamMode nOpenMode, 
std::shared_ptr pFilter, const std::shared_ptr& 
pInSet) :
 pImpl(new SfxMedium_Impl)
 {
-pImpl->m_pSet = std::move( pInSet );
+pImpl->m_pSet = pInSet;
 pImpl->m_pFilter = std::move(pFilter);
 pImpl->m_aLogicName = rName;
 pImpl->m_nStorOpenMode = nOpenMode;

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2019-09-26 Thread Caolán McNamara (via logerrit)
 include/sfx2/basedlgs.hxx|   27 
 sfx2/source/appl/sfxhelp.cxx |1 
 sfx2/source/dialog/basedlgs.cxx  |   59 ---
 sw/source/ui/inc/mmresultdialogs.hxx |1 
 sw/source/ui/index/cnttab.cxx|1 
 5 files changed, 3 insertions(+), 86 deletions(-)

New commits:
commit bc27ced45cf634ff3fbeef2605cae88ac1f1f0a1
Author: Caolán McNamara 
AuthorDate: Wed Sep 25 11:15:49 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 26 12:04:32 2019 +0200

drop newly unused SfxModalDialog

Change-Id: Ia06713c9766a6731995c83ed0516535d13665ff1
Reviewed-on: https://gerrit.libreoffice.org/79526
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index c01d6bd72b73..200cea5c40e5 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -32,34 +31,8 @@ class SfxBindings;
 class SfxChildWindow;
 struct SfxChildWinInfo;
 class SfxItemSet;
-class OKButton;
-class CancelButton;
-class HelpButton;
-class Button;
 class Timer;
 
-// class SfxModalDialog --
-
-class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog
-{
-OUStringaExtraData;
-
-private:
-SfxModalDialog(SfxModalDialog const &) = delete;
-SfxModalDialog& operator =(SfxModalDialog const &) = delete;
-
-SAL_DLLPRIVATE void SetDialogData_Impl();
-SAL_DLLPRIVATE void GetDialogData_Impl();
-DECL_DLLPRIVATE_STATIC_LINK(SfxModalDialog, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
-
-protected:
-SfxModalDialog(vcl::Window *pParent, const OUString& rID, const OUString& 
rUIXMLDescription);
-
-public:
-virtual ~SfxModalDialog() override;
-virtual void dispose() override;
-};
-
 class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController
 {
 private:
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index e6942da14fd6..73d2d2cc3619 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -69,6 +69,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 139e9eae1a88..c1906d547cf0 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -80,65 +80,6 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
 }
 }
 
-
-void SfxModalDialog::SetDialogData_Impl()
-{
-// save settings (position and user data)
-OUString sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8);
-SvtViewOptions aDlgOpt(EViewType::Dialog, sConfigId);
-aDlgOpt.SetWindowState(OStringToOUString(
-GetWindowState(WindowStateMask::Pos), RTL_TEXTENCODING_ASCII_US));
-if ( !aExtraData.isEmpty() )
-aDlgOpt.SetUserItem( USERITEM_NAME, makeAny( aExtraData ) );
-}
-
-
-void SfxModalDialog::GetDialogData_Impl()
-
-/*  [Description]
-
-Helper function, reads the dialogue position from the ini file and
-puts them on the transferred window.
-*/
-
-{
-OUString sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8);
-SvtViewOptions aDlgOpt(EViewType::Dialog, sConfigId);
-if ( aDlgOpt.Exists() )
-{
-// load settings
-SetWindowState( OUStringToOString( aDlgOpt.GetWindowState(), 
RTL_TEXTENCODING_ASCII_US ) );
-Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME );
-OUString aTemp;
-if ( aUserItem >>= aTemp )
-aExtraData = aTemp;
-}
-}
-
-SfxModalDialog::SfxModalDialog(vcl::Window *pParent, const OUString& rID, 
const OUString& rUIXMLDescription )
-:   ModalDialog(pParent, rID, rUIXMLDescription)
-{
-SetInstallLOKNotifierHdl(LINK(this, SfxModalDialog, 
InstallLOKNotifierHdl));
-GetDialogData_Impl();
-}
-
-IMPL_STATIC_LINK_NOARG(SfxModalDialog, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
-{
-return SfxViewShell::Current();
-}
-
-SfxModalDialog::~SfxModalDialog()
-{
-disposeOnce();
-}
-
-void SfxModalDialog::dispose()
-{
-SetDialogData_Impl();
-
-ModalDialog::dispose();
-}
-
 void SfxModelessDialogController::Initialize(SfxChildWinInfo const *pInfo)
 
 /*  [Description]
diff --git a/sw/source/ui/inc/mmresultdialogs.hxx 
b/sw/source/ui/inc/mmresultdialogs.hxx
index 12233b9eb9d1..70ffb08970f5 100644
--- a/sw/source/ui/inc/mmresultdialogs.hxx
+++ b/sw/source/ui/inc/mmresultdialogs.hxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 3afac2a604ce..d0b8a25c2d62 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-12-18 Thread Libreoffice Gerrit user
 include/sfx2/docinsert.hxx  |4 ++--
 sfx2/source/doc/docinsert.cxx   |   18 --
 sw/source/uibase/utlui/glbltree.cxx |9 -
 3 files changed, 14 insertions(+), 17 deletions(-)

New commits:
commit fb19a399fef73c05bbe570cb32d43ccf28d1b9c6
Author: Noel Grandin 
AuthorDate: Tue Dec 18 14:17:11 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 18 15:30:16 2018 +0100

use unique_ptr in SfxMediumList

fixing leak in SwGlobalTree::DialogClosedHdl

Change-Id: I4a8e883bfe62181d4e332b3a0bbb85bbb332f711
Reviewed-on: https://gerrit.libreoffice.org/65333
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx
index 21fb1a2a9c37..d7712fb4324e 100644
--- a/include/sfx2/docinsert.hxx
+++ b/include/sfx2/docinsert.hxx
@@ -33,7 +33,7 @@ namespace weld { class Window; }
 class SfxItemSet;
 enum class FileDialogFlags;
 
-typedef ::std::vector< SfxMedium* > SfxMediumList;
+typedef ::std::vector< std::unique_ptr > SfxMediumList;
 
 namespace sfx2 {
 
@@ -67,7 +67,7 @@ public:
 
 voidStartExecuteModal( const 
Link& _rDialogClosedLink );
 std::unique_ptr CreateMedium(char const* pFallbackHack = 
nullptr);
-SfxMediumList*  CreateMediumList();
+SfxMediumList CreateMediumList();
 };
 
 } // namespace sfx2
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index d919f317123b..7b64851e0071 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -136,16 +136,16 @@ std::unique_ptr 
DocumentInserter::CreateMedium(char const*const pFall
 return pMedium;
 }
 
-SfxMediumList* DocumentInserter::CreateMediumList()
+SfxMediumList DocumentInserter::CreateMediumList()
 {
-SfxMediumList* pMediumList = new SfxMediumList;
+SfxMediumList aMediumList;
 if (!m_nError && m_pItemSet && !m_pURLList.empty())
 {
 for (auto const& url : m_pURLList)
 {
-SfxMedium* pMedium = new SfxMedium(
+std::unique_ptr pMedium(new SfxMedium(
 url, SFX_STREAM_READONLY,
-SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( 
m_sFilter ), std::unique_ptr(m_pItemSet) );
+SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( 
m_sFilter ), std::unique_ptr(m_pItemSet) ));
 
 pMedium->UseInteractionHandler( true );
 
@@ -155,16 +155,14 @@ SfxMediumList* DocumentInserter::CreateMediumList()
 if ( nError == ERRCODE_NONE && pFilter )
 pMedium->SetFilter( pFilter );
 else
-DELETEZ( pMedium );
+pMedium.reset();
 
-if( pMedium && CheckPasswd_Impl( nullptr, pMedium ) != 
ERRCODE_ABORT )
-pMediumList->push_back( pMedium );
-else
-delete pMedium;
+if( pMedium && CheckPasswd_Impl( nullptr, pMedium.get() ) != 
ERRCODE_ABORT )
+aMediumList.push_back( std::move(pMedium) );
 }
 }
 
-return pMediumList;
+return aMediumList;
 }
 
 static void impl_FillURLList( sfx2::FileDialogHelper const * _pFileDlg, 
std::vector& _rpURLList )
diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 28709b329ae2..575d89b2b85e 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1356,13 +1356,13 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, 
sfx2::FileDialogHelper*, _pFileDlg, vo
 if ( ERRCODE_NONE != _pFileDlg->GetError() )
 return;
 
-std::unique_ptr 
pMedList(m_pDocInserter->CreateMediumList());
-if ( pMedList )
+SfxMediumList aMedList(m_pDocInserter->CreateMediumList());
+if ( !aMedList.empty() )
 {
-Sequence< OUString >aFileNames( pMedList->size() );
+Sequence< OUString >aFileNames( aMedList.size() );
 OUString* pFileNames = aFileNames.getArray();
 sal_Int32 nPos = 0;
-for (SfxMedium* pMed : *pMedList)
+for (std::unique_ptr& pMed : aMedList)
 {
 OUString sFileName = pMed->GetURLObject().GetMainURL( 
INetURLObject::DecodeMechanism::NONE )
 + OUStringLiteral1(sfx2::cTokenSeparator)
@@ -1370,7 +1370,6 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, 
sfx2::FileDialogHelper*, _pFileDlg, vo
 + OUStringLiteral1(sfx2::cTokenSeparator);
 pFileNames[nPos++] = sFileName;
 }
-pMedList.reset();
 InsertRegion( m_pDocContent.get(), aFileNames );
 m_pDocContent.reset();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-12-12 Thread Libreoffice Gerrit user
 include/sfx2/childwin.hxx |9 -
 sfx2/source/appl/childwin.cxx |4 ++--
 sw/source/uibase/inc/navipi.hxx   |2 +-
 sw/source/uibase/utlui/navipi.cxx |5 ++---
 4 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 2b7e93142916aaa5bf529ed7abefcf1829278510
Author: Noel Grandin 
AuthorDate: Wed Dec 12 08:49:11 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 12 09:57:55 2018 +0100

use unique_ptr in SfxChildWinContextCtor

Change-Id: I5ad26f30704708aac42f2c48fa38382c38f98b2a
Reviewed-on: https://gerrit.libreoffice.org/64998
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 03f7f20292b2..84ac2b31b12e 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -88,7 +88,7 @@ typedef std::unique_ptr (*SfxChildWinCtor)( 
vcl::Window *pParent
 SfxChildWinInfo *pInfo);
 
 // ChildWindowsContexts factory methods
-typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( vcl::Window 
*pParentWindow,
+typedef std::unique_ptr (*SfxChildWinContextCtor)( 
vcl::Window *pParentWindow,
 SfxBindings *pBindings,
 SfxChildWinInfo *pInfo);
 struct SfxChildWinContextFactory
@@ -218,7 +218,7 @@ public:
 
 //! The Macro of the future ...
 #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
-static  SfxChildWindowContext* CreateImpl(vcl::Window *pParent, \
+static  std::unique_ptr CreateImpl(vcl::Window 
*pParent, \
 SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
 static  void RegisterChildWindowContext(sal_uInt16, SfxModule 
*pMod=nullptr); \
 
@@ -227,11 +227,10 @@ public:
 // factory. As long as Id is set to 0 and patched in
 // SfxChildWindow::CreateContext
 #define SFX_IMPL_CHILDWINDOWCONTEXT(Class, MyID) \
-SfxChildWindowContext* Class::CreateImpl( vcl::Window *pParent, \
+std::unique_ptr Class::CreateImpl( vcl::Window 
*pParent, \
 SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
 {   \
-SfxChildWindowContext *pContext = new 
Class(pParent,0,pBindings,pInfo);\
-return pContext; \
+return o3tl::make_unique(pParent,0,pBindings,pInfo);\
 } \
 voidClass::RegisterChildWindowContext(sal_uInt16 nId, SfxModule* 
pMod)   \
 {   \
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 70dc1e7f3996..7966c3de1c95 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -433,7 +433,7 @@ void 
SfxChildWindow::InitializeChildWinFactory_Impl(sal_uInt16 nId, SfxChildWinI
 
 void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& 
rBindings )
 {
-SfxChildWindowContext *pCon = nullptr;
+std::unique_ptr pCon;
 SfxChildWinFactory* pFact=nullptr;
 SfxApplication *pApp = SfxGetpApp();
 SfxDispatcher *pDisp = rBindings.GetDispatcher_Impl();
@@ -508,7 +508,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, 
SfxBindings& rBinding
 return;
 }
 
-pContext.reset(pCon);
+pContext = std::move(pCon);
 pContext->GetWindow()->SetSizePixel( pWindow->GetOutputSizePixel() );
 pContext->GetWindow()->Show();
 }
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index f5c6659da7b8..17b86aada357 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -170,7 +170,7 @@ public:
 SfxBindings*  );
 
 //! soon obsolete !
-static  SfxChildWindowContext* CreateImpl(vcl::Window *pParent,
+static  std::unique_ptr CreateImpl(vcl::Window 
*pParent,
 SfxBindings *pBindings, SfxChildWinInfo* pInfo );
 static  void RegisterChildWindowContext(SfxModule *pMod);
 };
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 4015bd1aa922..cc36b1431f39 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -63,13 +63,12 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::frame;
 
 //! soon obsolete !
-SfxChildWindowContext* SwNavigationChild::CreateImpl( vcl::Window *pParent,
+std::unique_ptr SwNavigationChild::CreateImpl( 
vcl::Window *pParent,
 SfxBindings *pBindings, SfxChildWinInfo* /*pInfo*/ )
 {
-SfxChildWindowContext *pContext = new SwNavigationChild(pParent,
+return o3tl::make_unique(pParent,
 /* cast is safe here! */static_cast< sal_uInt16 
>(SwView::GetInterfaceId()),
 pBindings);
-return pContext;
 }
 voidSwNavigationChild::RegisterChildWindowContext(SfxModule* pMod)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-12-11 Thread Libreoffice Gerrit user
 include/sfx2/app.hxx  |2 +-
 include/sfx2/childwin.hxx |7 ---
 sfx2/source/appl/appchild.cxx |4 ++--
 sfx2/source/appl/childwin.cxx |4 ++--
 sfx2/source/appl/childwinimpl.cxx |4 ++--
 sfx2/source/inc/childwinimpl.hxx  |2 +-
 sw/source/uibase/utlui/navipi.cxx |4 ++--
 7 files changed, 14 insertions(+), 13 deletions(-)

New commits:
commit 4015034e08d14c5fbc0b2b2e8a7e1e56f651d2f0
Author: Noel Grandin 
AuthorDate: Tue Dec 11 11:30:20 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 11 11:51:35 2018 +0100

use unique_ptr for SfxChildWinContextFactory

Change-Id: Id0e30c5e591e7fb4b21fb55d47d15a5936fe1374
Reviewed-on: https://gerrit.libreoffice.org/64934
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index c5ed9b880bd0..701fa90475b3 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -191,7 +191,7 @@ public:
 
 // Object-Factories/global arrays
 SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, 
SfxChildWinFactory*);
-SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, 
sal_uInt16, SfxChildWinContextFactory*);
+SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, 
sal_uInt16, std::unique_ptr);
 SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, 
const SfxStbCtrlFactory&);
 SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const 
SfxTbxCtrlFactory&);
 SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 9a12bf896071..74efab5857de 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -138,7 +139,7 @@ public:
 
 static FloatingWindow* GetFloatingWindow(vcl::Window *pParent);
 
-static void RegisterChildWindowContext(SfxModule*, sal_uInt16, 
SfxChildWinContextFactory*);
+static void RegisterChildWindowContext(SfxModule*, sal_uInt16, 
std::unique_ptr);
 };
 
 class SFX2_DLLPUBLIC SfxChildWindow
@@ -234,9 +235,9 @@ public:
 } \
 voidClass::RegisterChildWindowContext(sal_uInt16 nId, SfxModule* 
pMod)   \
 {   \
-SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( \
+auto pFact = o3tl::make_unique( \
 Class::CreateImpl, nId );   \
-SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, 
pFact); \
+SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, 
std::move(pFact)); \
 }
 
 #define SFX_DECL_CHILDWINDOW(Class) \
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
index 4a629036c975..6003a8c547fb 100644
--- a/sfx2/source/appl/appchild.cxx
+++ b/sfx2/source/appl/appchild.cxx
@@ -58,7 +58,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule 
*pMod, SfxChildWinFacto
 }
 
 void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, 
sal_uInt16 nId,
-SfxChildWinContextFactory *pFact)
+std::unique_ptr pFact)
 {
 SfxChildWinFactArr_Impl *pFactories;
 SfxChildWinFactory *pF = nullptr;
@@ -116,7 +116,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( 
SfxModule *pMod, sal_uInt1
 {
 if ( !pF->pArr )
 pF->pArr.reset( new SfxChildWinContextArr_Impl );
-pF->pArr->push_back( pFact );
+pF->pArr->push_back( std::move(pFact) );
 return;
 }
 
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 6b64540fc120..ec50cf640a74 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -720,9 +720,9 @@ void SfxChildWindow::SetFrame( const css::uno::Reference< 
css::frame::XFrame > &
 }
 }
 
-void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, 
sal_uInt16 nId, SfxChildWinContextFactory* pFact)
+void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, 
sal_uInt16 nId, std::unique_ptr pFact)
 {
-SfxGetpApp()->RegisterChildWindowContext_Impl( pMod, nId, pFact );
+SfxGetpApp()->RegisterChildWindowContext_Impl( pMod, nId, std::move(pFact) 
);
 }
 
 void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, SfxChildWinFactory* 
pFact)
diff --git a/sfx2/source/appl/childwinimpl.cxx 
b/sfx2/source/appl/childwinimpl.cxx
index 6299edc88305..313ef0e91d8b 100644
--- a/sfx2/source/appl/childwinimpl.cxx
+++ b/sfx2/source/appl/childwinimpl.cxx
@@ -35,9 +35,9 @@ SfxChildWinContextFactory& 
SfxChildWinContextArr_Impl::operator []( size_t i )
 return *maData[i].get();
 }
 
-void SfxChildWinContextArr_Impl::push_back( SfxChildWinContextFactory* p )
+void SfxChildWinContextArr_Impl::push_back( 
std::unique_ptr p )
 {
-maData.push_back(std::unique_ptr(p));
+maData.push_back(std::move(p));
 }
 
 size_t 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-11-15 Thread Libreoffice Gerrit user
 include/sfx2/basedlgs.hxx |6 +++---
 include/sfx2/objsh.hxx|2 +-
 include/sfx2/progress.hxx |2 +-
 include/sfx2/sidebar/DeckTitleBar.hxx |2 +-
 sfx2/source/dialog/basedlgs.cxx   |6 +++---
 sfx2/source/sidebar/DeckTitleBar.cxx  |2 +-
 sfx2/source/sidebar/SidebarController.cxx |2 +-
 sfx2/source/view/classificationcontroller.cxx |6 +++---
 sw/source/core/layout/paintfrm.cxx|6 +++---
 sw/source/uibase/app/mainwn.cxx   |2 +-
 10 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit d197d524c5292cf6d66be802ec7d1fed78e30416
Author: Noel Grandin 
AuthorDate: Thu Nov 15 12:28:17 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 15 17:33:55 2018 +0100

loplugin:staticmethods in sfx2

Change-Id: Ide10d0186431e745c3bb17d321cf46724e801c8f
Reviewed-on: https://gerrit.libreoffice.org/63404
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 28bf55a93f2a..06c928265277 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -55,7 +55,7 @@ private:
 
 SAL_DLLPRIVATE void SetDialogData_Impl();
 SAL_DLLPRIVATE void GetDialogData_Impl();
-DECL_DLLPRIVATE_LINK(InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+DECL_DLLPRIVATE_STATIC_LINK(SfxModalDialog, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
 
 protected:
 SfxModalDialog(vcl::Window *pParent, const OUString& rID, const OUString& 
rUIXMLDescription);
@@ -86,7 +86,7 @@ class SFX2_DLLPUBLIC SfxModelessDialog: public ModelessDialog
 
 void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
 
-DECL_DLLPRIVATE_LINK(InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+DECL_DLLPRIVATE_STATIC_LINK(SfxModelessDialog, InstallLOKNotifierHdl, 
void*, vcl::ILibreOfficeKitNotifier*);
 protected:
 SfxModelessDialog( SfxBindings*, SfxChildWindow*,
 vcl::Window*, const OUString& rID, const OUString& rUIXMLDescription );
@@ -110,7 +110,7 @@ public:
 class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController
 {
 private:
-DECL_DLLPRIVATE_LINK(InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+DECL_DLLPRIVATE_STATIC_LINK(SfxDialogController, InstallLOKNotifierHdl, 
void*, vcl::ILibreOfficeKitNotifier*);
 public:
 SfxDialogController(weld::Widget* pParent, const OUString& rUIFile, const 
OString& rDialogId);
 };
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index ced0db56320d..af6c050c1dc8 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -750,7 +750,7 @@ public:
 SAL_DLLPRIVATE SignatureState ImplGetSignatureState( bool 
bScriptingContent = false );
 
 SAL_DLLPRIVATE bool QuerySaveSizeExceededModules_Impl( const 
css::uno::Reference< css::task::XInteractionHandler >& xHandler );
-SAL_DLLPRIVATE bool QueryAllowExoticFormat_Impl( const 
css::uno::Reference< css::task::XInteractionHandler >& xHandler,
+SAL_DLLPRIVATE static bool QueryAllowExoticFormat_Impl( const 
css::uno::Reference< css::task::XInteractionHandler >& xHandler,
  const OUString& rURL,
  const OUString& 
rFilterUIName);
 
diff --git a/include/sfx2/progress.hxx b/include/sfx2/progress.hxx
index 0734998c7357..10b9de3f22ec 100644
--- a/include/sfx2/progress.hxx
+++ b/include/sfx2/progress.hxx
@@ -55,7 +55,7 @@ public:
 voidSuspend();
 boolIsSuspended() const { return bSuspended; }
 
-voidReschedule();
+static void Reschedule();
 
 voidStop();
 
diff --git a/include/sfx2/sidebar/DeckTitleBar.hxx 
b/include/sfx2/sidebar/DeckTitleBar.hxx
index 73daefb4d8e4..26e1a29b4216 100644
--- a/include/sfx2/sidebar/DeckTitleBar.hxx
+++ b/include/sfx2/sidebar/DeckTitleBar.hxx
@@ -31,7 +31,7 @@ public:
  const std::function& rCloserAction);
 
 void SetCloserVisible(const bool bIsCloserVisible);
-tools::Rectangle GetDragArea() const;
+static tools::Rectangle GetDragArea();
 
 virtual void DataChanged(const DataChangedEvent& rEvent) override;
 virtual void MouseMove(const MouseEvent& rMouseEvent) override;
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index f3b35c63071d..7ad50b9b86ad 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -130,7 +130,7 @@ SfxModalDialog::SfxModalDialog(vcl::Window *pParent, const 
OUString& rID, const
 GetDialogData_Impl();
 }
 
-IMPL_LINK_NOARG(SfxModalDialog, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+IMPL_STATIC_LINK_NOARG(SfxModalDialog, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
 {
 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-08-30 Thread Libreoffice Gerrit user
 include/sfx2/mgetempl.hxx   |1 
 include/sfx2/styledlg.hxx   |   19 
 include/sfx2/tabdlg.hxx |6 ++
 sfx2/source/dialog/mgetempl.cxx |2 
 sfx2/source/dialog/styledlg.cxx |   84 +-
 sfx2/source/dialog/tabdlg.cxx   |   88 +---
 sw/source/uibase/app/docst.cxx  |2 
 7 files changed, 191 insertions(+), 11 deletions(-)

New commits:
commit 923c14135c21ffde2a19ca7875be6ebb79197740
Author: Caolán McNamara 
AuthorDate: Wed Aug 29 17:05:28 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 30 09:06:34 2018 +0200

add SfxStyleDialogController

Change-Id: I5b55b8adb46d894f87dcf68c97f6fd56059354a2
Reviewed-on: https://gerrit.libreoffice.org/59768
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 4a2c906ca9c2..238d662c33f5 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -64,6 +64,7 @@ class SfxManageStyleSheetPage final : public SfxTabPage
 std::unique_ptr m_xNameFt;
 
 friend class SfxStyleDialog;
+friend class SfxStyleDialogController;
 
 DECL_LINK(GetFocusHdl, weld::Widget&, void);
 DECL_LINK(LoseFocusHdl, weld::Widget&, void);
diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
index 5abf6c653d22..e86c6450e355 100644
--- a/include/sfx2/styledlg.hxx
+++ b/include/sfx2/styledlg.hxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-
 #include 
 
 class SfxStyleSheetBase;
@@ -45,6 +44,24 @@ public:
 const SfxStyleSheetBase&GetStyleSheet() const { return *pStyle; }
 
 virtual short   Ok() override;
+};
+
+class SFX2_DLLPUBLIC SfxStyleDialogController : public SfxTabDialogController
+{
+private:
+SfxStyleSheetBase& m_rStyle;
+DECL_DLLPRIVATE_LINK(CancelHdl, weld::Button&, void);
+
+public:
+SfxStyleDialogController(weld::Window* pParent,
+const OUString& rUIXMLDescription, const OString& rID, 
SfxStyleSheetBase&);
+
+virtual ~SfxStyleDialogController() override;
+
+SfxStyleSheetBase&  GetStyleSheet() { return m_rStyle; }
+const SfxStyleSheetBase&GetStyleSheet() const { return m_rStyle; }
+
+virtual short   Ok() override;
 
 static OUString GenerateUnusedName(SfxStyleSheetBasePool );
 };
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 64a8ebc5d6ae..ebcaf8c17268 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -230,6 +230,7 @@ protected:
 
 DECL_LINK(OkHdl, weld::Button&, void);
 DECL_LINK(ResetHdl, weld::Button&, void);
+DECL_LINK(BaseFmtHdl, weld::Button&, void);
 DECL_LINK(UserHdl, weld::Button&, void);
 DECL_LINK(CancelHdl, weld::Button&, void);
 private:
@@ -238,6 +239,7 @@ private:
 std::unique_ptr m_xUserBtn;
 std::unique_ptr m_xCancelBtn;
 std::unique_ptr m_xResetBtn;
+std::unique_ptr m_xBaseFmtBtn;
 std::unique_ptr m_xSizeGroup;
 
 std::unique_ptr   m_pSet;
@@ -245,6 +247,7 @@ private:
 std::unique_ptr  m_pImpl;
 std::unique_ptr m_pRanges;
 OString m_sAppPageId;
+boolm_bStandardPushed;
 
 DECL_DLLPRIVATE_LINK(ActivatePageHdl, const OString&, void);
 DECL_DLLPRIVATE_LINK(DeactivatePageHdl, const OString&, bool);
@@ -273,7 +276,7 @@ protected:
 void Start_Impl();
 public:
 SfxTabDialogController(weld::Window* pParent, const OUString& 
rUIXMLDescription, const OString& rID,
-   const SfxItemSet * = nullptr);
+   const SfxItemSet * = nullptr, bool bEditFmt = 
false);
 virtual ~SfxTabDialogController() override;
 
 voidAddTabPage( const OString& rName,   // Name of 
the label for the page in the notebook .ui
@@ -298,6 +301,7 @@ public:
 const weld::Button* GetUserButton() const { return m_xUserBtn.get(); }
 weld::Button*   GetUserButton() { return m_xUserBtn.get(); }
 voidRemoveResetButton();
+voidRemoveStandardButton();
 
 short   execute();
 static bool runAsync(const std::shared_ptr& 
rController,
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index b5d9634588ef..663a26295453 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -111,7 +111,7 @@ 
SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf
 if ( pStyle->GetName().isEmpty() && pPool )
 {
 // NullString as Name -> generate Name
-OUString aNoName(SfxStyleDialog::GenerateUnusedName(*pPool));
+OUString aNoName(SfxStyleDialogController::GenerateUnusedName(*pPool));
 pStyle->SetName( aNoName );
 aName = aNoName;
 aFollow = pStyle->GetFollow();
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-05-04 Thread Caolán McNamara
 include/sfx2/tabdlg.hxx|4 +--
 sfx2/source/dialog/tabdlg.cxx  |   44 +++--
 sw/source/ui/envelp/label1.cxx |4 +--
 3 files changed, 25 insertions(+), 27 deletions(-)

New commits:
commit d038d1f5ee0d24a5ad739d5e91015f90fd09b02e
Author: Caolán McNamara 
Date:   Thu May 3 15:39:05 2018 +0100

coverity#1435273 Resource leak in object

Change-Id: I781b2d6f6b550e5b381c041a27d282c4dca9d6dd
Reviewed-on: https://gerrit.libreoffice.org/53805
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index c3d6d6ec2cf6..2d9b449112d5 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -254,7 +254,7 @@ protected:
 virtual voidRefreshInputSet();
 virtual voidPageCreated(const OString , SfxTabPage 
);
 
-SfxItemSet* m_pExampleSet;
+std::unique_ptr m_xExampleSet;
 SfxItemSet* GetInputSetImpl();
 SfxTabPage* GetTabPage(const OString& rPageId) const;
 
@@ -294,7 +294,7 @@ public:
 
 short   execute();
 
-const SfxItemSet*   GetExampleSet() const { return m_pExampleSet; }
+const SfxItemSet*   GetExampleSet() const { return m_xExampleSet.get(); }
 
 SAL_DLLPRIVATE void Start_Impl();
 };
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index ec2c9befddda..8c4e04983358 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1470,7 +1470,6 @@ SfxTabDialogController::SfxTabDialogController
 , m_pSet(pItemSet ? new SfxItemSet(*pItemSet) : nullptr)
 , m_pOutSet(nullptr)
 , m_pRanges(nullptr)
-, m_pExampleSet(nullptr)
 {
 Init_Impl(bEditFmt);
 }
@@ -1492,7 +1491,7 @@ void SfxTabDialogController::Init_Impl(bool /*bFmtFlag*/)
 
 if (m_pSet)
 {
-m_pExampleSet = new SfxItemSet(*m_pSet);
+m_xExampleSet.reset(new SfxItemSet(*m_pSet));
 m_pOutSet.reset(new SfxItemSet(*m_pSet->GetPool(), 
m_pSet->GetRanges()));
 }
 }
@@ -1557,8 +1556,8 @@ IMPL_LINK_NOARG(SfxTabDialogController, ResetHdl, 
weld::Button&, void)
 // Also reset relevant items of ExampleSet and OutSet to initial state
 if (pDataObject->fnGetRanges)
 {
-if (!m_pExampleSet)
-m_pExampleSet = new SfxItemSet(*m_pSet);
+if (!m_xExampleSet)
+m_xExampleSet.reset(new SfxItemSet(*m_pSet));
 
 const SfxItemPool* pPool = m_pSet->GetPool();
 const sal_uInt16* pTmpRanges = (pDataObject->fnGetRanges)();
@@ -1584,12 +1583,12 @@ IMPL_LINK_NOARG(SfxTabDialogController, ResetHdl, 
weld::Button&, void)
 const SfxPoolItem* pItem;
 if (SfxItemState::SET == m_pSet->GetItemState(nWh, false, 
))
 {
-m_pExampleSet->Put(*pItem);
+m_xExampleSet->Put(*pItem);
 m_pOutSet->Put(*pItem);
 }
 else
 {
-m_pExampleSet->ClearItem(nWh);
+m_xExampleSet->ClearItem(nWh);
 m_pOutSet->ClearItem(nWh);
 }
 nTmp++;
@@ -1624,8 +1623,8 @@ IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const 
OString&, rPage, void)
 pTabPage->Reset(m_pSet);
 pDataObject->bRefresh = false;
 
-if (m_pExampleSet)
-pTabPage->ActivatePage(*m_pExampleSet);
+if (m_xExampleSet)
+pTabPage->ActivatePage(*m_xExampleSet);
 
 if (pTabPage->IsReadOnly() || m_pImpl->bHideResetBtn)
 m_xResetBtn->hide();
@@ -1660,8 +1659,8 @@ IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, 
const OString&, rPage, bool
 
 DeactivateRC nRet = DeactivateRC::LeavePage;
 
-if (!m_pExampleSet && pPage->HasExchangeSupport() && m_pSet)
-m_pExampleSet = new SfxItemSet(*m_pSet->GetPool(), 
m_pSet->GetRanges());
+if (!m_xExampleSet && pPage->HasExchangeSupport() && m_pSet)
+m_xExampleSet.reset(new SfxItemSet(*m_pSet->GetPool(), 
m_pSet->GetRanges()));
 
 if (m_pSet)
 {
@@ -1672,9 +1671,9 @@ IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, 
const OString&, rPage, bool
 else
 nRet = pPage->DeactivatePage(nullptr);
 if ( ( DeactivateRC::LeavePage & nRet ) == DeactivateRC::LeavePage &&
- aTmp.Count() && m_pExampleSet)
+ aTmp.Count() && m_xExampleSet)
 {
-m_pExampleSet->Put( aTmp );
+m_xExampleSet->Put( aTmp );
 m_pOutSet->Put( aTmp );
 }
 }
@@ -1682,13 +1681,12 @@ IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, 
const OString&, rPage, bool
 {
 if ( pPage->HasExchangeSupport() ) //!!!
 {
-if ( !m_pExampleSet )
+if (!m_xExampleSet)
 {
 SfxItemPool* pPool = pPage->GetItemSet().GetPool();
-

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2018-04-23 Thread Caolán McNamara
 include/sfx2/tabdlg.hxx|1 +
 sfx2/source/dialog/tabdlg.cxx  |   16 
 sw/source/ui/envelp/labprt.hxx |2 +-
 sw/source/ui/envelp/swuilabimp.hxx |2 +-
 4 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit db9f6c44cac246250e89ca4e9aa127dee912d7f5
Author: Caolán McNamara 
Date:   Mon Apr 23 10:50:29 2018 +0100

set SfxTabPage parent dialog explicitly

Change-Id: If7813f9f5e35694312b055cc92868638bc3773d5
Reviewed-on: https://gerrit.libreoffice.org/53326
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index e288e07cd8f7..9b0aa249c668 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -266,6 +266,7 @@ protected:
 return static_cast(GetOldItem(rSet, sal_uInt16(nSlot), 
bDeep));
 }
 SfxTabDialog*   GetTabDialog() const;
+voidSetTabDialog(SfxTabDialog* pDialog);
 
 voidAddItemConnection( sfx::ItemConnectionBase* 
pConnection );
 
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index ff5c508efdf9..f31e12784316 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -52,6 +52,7 @@ struct TabPageImpl
 {
 boolmbStandard;
 sfx::ItemConnectionArraymaItemConn;
+VclPtrmxDialog;
 css::uno::Reference< css::frame::XFrame > mxFrame;
 
 TabPageImpl() : mbStandard( false ) {}
@@ -307,13 +308,20 @@ void SfxTabPage::AddItemConnection( 
sfx::ItemConnectionBase* pConnection )
 pImpl->maItemConn.AddConnection( pConnection );
 }
 
+void SfxTabPage::SetTabDialog(SfxTabDialog* pDialog)
+{
+pImpl->mxDialog = pDialog;
+}
+
 SfxTabDialog* SfxTabPage::GetTabDialog() const
 {
-return dynamic_cast(GetParentDialog());
+return pImpl->mxDialog;
 }
 
 OString SfxTabPage::GetConfigId() const
 {
+if (m_xContainer)
+return m_xContainer->get_help_id();
 OString sId(GetHelpId());
 if (sId.isEmpty() && isLayoutEnabled(this))
 sId = GetWindow(GetWindowType::FirstChild)->GetHelpId();
@@ -1127,12 +1135,12 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, 
pTabCtrl, void )
 if ( !pTabPage )
 {
 if ( m_pSet )
-pTabPage = (pDataObject->fnCreatePage)( 
static_cast(pTabCtrl), m_pSet );
+pTabPage = 
(pDataObject->fnCreatePage)(static_cast(pTabCtrl), m_pSet);
 else
-pTabPage = (pDataObject->fnCreatePage)
-( pTabCtrl, CreateInputItemSet( nId ) );
+pTabPage = (pDataObject->fnCreatePage)(pTabCtrl, 
CreateInputItemSet(nId));
 DBG_ASSERT( nullptr == pDataObject->pTabPage, "create TabPage more 
than once" );
 pDataObject->pTabPage = pTabPage;
+pTabPage->SetTabDialog(this);
 
 OUString sConfigId = OStringToOUString(pTabPage->GetConfigId(), 
RTL_TEXTENCODING_UTF8);
 if (sConfigId.isEmpty())
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index e36ab980e1f4..500f2c40332c 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -45,7 +45,7 @@ class SwLabPrtPage : public SfxTabPage
 
 DECL_LINK( CountHdl, Button *, void );
 
-SwLabDlg* GetParentSwLabDlg() {return 
static_cast(GetParentDialog());}
+SwLabDlg* GetParentSwLabDlg() {return 
static_cast(GetTabDialog());}
 
 using TabPage::ActivatePage;
 using TabPage::DeactivatePage;
diff --git a/sw/source/ui/envelp/swuilabimp.hxx 
b/sw/source/ui/envelp/swuilabimp.hxx
index 09e4dcc96b12..b63c30df324f 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -72,7 +72,7 @@ public:
 virtual bool FillItemSet(SfxItemSet* rSet) override;
 virtual void Reset(const SfxItemSet* rSet) override;
 
-SwLabDlg* GetParentSwLabDlg() {return 
static_cast(GetParentDialog());}
+SwLabDlg* GetParentSwLabDlg() {return 
static_cast(GetTabDialog());}
 
 voidSetToBusinessCard();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2017-10-31 Thread Noel Grandin
 include/sfx2/app.hxx  |4 ++--
 include/sfx2/docfilt.hxx  |3 +--
 include/sfx2/evntconf.hxx |2 +-
 include/sfx2/mgetempl.hxx |2 +-
 sfx2/source/config/evntconf.cxx   |4 ++--
 sfx2/source/dialog/mgetempl.cxx   |6 +-
 sfx2/source/doc/docfilt.cxx   |   12 
 sfx2/source/view/viewfrm.cxx  |7 ---
 sw/source/filter/html/htmlbas.cxx |2 +-
 9 files changed, 17 insertions(+), 25 deletions(-)

New commits:
commit 3ad6957dc12c0667a69ca6b8361ccde490f9c1da
Author: Noel Grandin 
Date:   Mon Oct 30 13:30:44 2017 +0200

loplugin:constantparam in sfx2

Change-Id: Id52809401fb848d7169a665903e67ba28f4af598
Reviewed-on: https://gerrit.libreoffice.org/44084
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index ec1747a53cba..d3384e7f5a38 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -163,8 +163,8 @@ public:
 static OUString ChooseScript();
 static void MacroOrganizer( sal_Int16 nTabId );
 static ErrCode  CallBasic( const OUString&, BasicManager*, 
SbxArray *pArgs, SbxValue *pRet );
-static ErrCode  CallAppBasic( const OUString& i_macroName, 
SbxArray* i_args = nullptr )
-{ return CallBasic( i_macroName, 
SfxApplication::GetBasicManager(), i_args, nullptr ); }
+static ErrCode  CallAppBasic( const OUString& i_macroName )
+{ return CallBasic( i_macroName, 
SfxApplication::GetBasicManager(), nullptr, nullptr ); }
 static BasicManager*GetBasicManager();
 css::script::XLibraryContainer * GetDialogContainer();
 css::script::XLibraryContainer * GetBasicContainer();
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index 95fde5036d06..d5e0507d577a 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -114,8 +114,7 @@ public:
 /// @throws css::lang::WrappedTargetException
 /// @throws css::uno::RuntimeException
 static OUString GetTypeFromStorage(
-const css::uno::Reference& xStorage,
-bool bTemplate = false );
+const css::uno::Reference& xStorage );
 };
 
 #endif
diff --git a/include/sfx2/evntconf.hxx b/include/sfx2/evntconf.hxx
index 8a4d004c075d..bf59d805a074 100644
--- a/include/sfx2/evntconf.hxx
+++ b/include/sfx2/evntconf.hxx
@@ -98,7 +98,7 @@ class SFX2_DLLPUBLIC SfxEventConfiguration
 {
 public:
 static void ConfigureEvent( const OUString& aName, 
const SvxMacro&, SfxObjectShell const * pObjSh);
-static SvxMacro*ConvertToMacro( const css::uno::Any& 
rElement, SfxObjectShell* pDoc, bool bBlowUp );
+static SvxMacro*ConvertToMacro( const css::uno::Any& 
rElement, SfxObjectShell* pDoc );
 };
 
 #endif
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index fb018865cc35..42aeef6c1135 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -87,7 +87,7 @@ friend class SfxStyleDialog;
 virtual voidReset(const SfxItemSet *) override;
 
 static boolExecute_Impl( sal_uInt16 nId, const OUString& rStr, const 
OUString& rRefStr,
-  sal_uInt16 nFamily, sal_uInt16 nMask = 0 );
+  sal_uInt16 nFamily );
 using TabPage::ActivatePage;
 virtual voidActivatePage(const SfxItemSet &) override;
 using TabPage::DeactivatePage;
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 58c6f2251feb..9de6fb043487 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -242,9 +242,9 @@ void SfxEventConfiguration::ConfigureEvent( const OUString& 
aName, const SvxMacr
 }
 
 
-SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& 
rElement, SfxObjectShell* pDoc, bool bBlowUp )
+SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& 
rElement, SfxObjectShell* pDoc )
 {
-return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, bBlowUp );
+return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, true/*bBlowUp*/ );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index e93adca35721..b6e78d3a5ff9 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -371,22 +371,18 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, 
EditLinkStyleHdl_Impl, Button*, void )
 
 // Internal: Perform functions through the Dispatcher
 bool SfxManageStyleSheetPage::Execute_Impl(
-sal_uInt16 nId, const OUString , const OUString& rRefStr, sal_uInt16 
nFamily,
-sal_uInt16 nMask)
+sal_uInt16 nId, const OUString , const OUString& rRefStr, sal_uInt16 
nFamily)
 {
 
 SfxDispatcher  

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2017-10-16 Thread Tomaž Vajngerl
 include/sfx2/classificationhelper.hxx |2 ++
 sfx2/source/view/classificationcontroller.cxx |   15 +++
 sfx2/source/view/classificationhelper.cxx |   10 ++
 sw/source/core/edit/edfcol.cxx|   14 +++---
 4 files changed, 18 insertions(+), 23 deletions(-)

New commits:
commit 0716aca251bbb64fab6c8697ee0a2215461f1019
Author: Tomaž Vajngerl 
Date:   Mon Oct 9 11:21:08 2017 +0200

tscp: move getting the current policy type to class. helper

Change-Id: I54afcca1c1fc1a27458c75ab9fd3405d6f7e9239
Reviewed-on: https://gerrit.libreoffice.org/43360
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/sfx2/classificationhelper.hxx 
b/include/sfx2/classificationhelper.hxx
index 7c39415c3315..e83eadfd05e9 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -96,6 +96,8 @@ public:
 static const OUString& PROP_DOCWATERMARK();
 /// Get the property prefix for the IntellectualProperty policy type.
 static const OUString& PROP_PREFIX_INTELLECTUALPROPERTY();
+
+static SfxClassificationPolicyType getPolicyType();
 };
 
 #endif
diff --git a/sfx2/source/view/classificationcontroller.cxx 
b/sfx2/source/view/classificationcontroller.cxx
index 328466f908cc..1efdb2fd523f 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -29,8 +29,6 @@
 #include 
 #include 
 
-#include 
-
 using namespace com::sun::star;
 
 namespace sfx2
@@ -104,16 +102,9 @@ public:
 namespace
 {
 
-SfxClassificationPolicyType getPolicyType()
-{
-sal_Int32 nPolicyTypeNumber = 
officecfg::Office::Common::Classification::Policy::get();
-auto eType = static_cast(nPolicyTypeNumber);
-return eType;
-}
-
 OUString getCategoryType()
 {
-return SfxClassificationHelper::policyTypeToString(getPolicyType());
+return 
SfxClassificationHelper::policyTypeToString(SfxClassificationHelper::getPolicyType());
 }
 
 } // end anonymous namespace
@@ -211,7 +202,7 @@ void 
ClassificationCategoriesController::statusChanged(const frame::FeatureState
 }
 
 // Restore state based on the doc. model.
-const OUString& rCategoryName = aHelper.GetBACName(getPolicyType());
+const OUString& rCategoryName = 
aHelper.GetBACName(SfxClassificationHelper::getPolicyType());
 if (!rCategoryName.isEmpty())
 {
 m_pClassification->getCategory()->SelectEntry(rCategoryName);
@@ -232,7 +223,7 @@ ClassificationControl::ClassificationControl(vcl::Window* 
pParent)
 m_pCategory = VclPtr::Create(this, 
WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_DROPDOWN|WB_SIMPLEMODE);
 
 OUString aText;
-switch (getPolicyType())
+switch (SfxClassificationHelper::getPolicyType())
 {
 case SfxClassificationPolicyType::IntellectualProperty:
 aText = SfxResId(STR_CLASSIFIED_INTELLECTUAL_PROPERTY);
diff --git a/sfx2/source/view/classificationhelper.cxx 
b/sfx2/source/view/classificationhelper.cxx
index aa61839c06e6..3378ed0df239 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -37,6 +37,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 
 namespace
@@ -847,4 +849,12 @@ const OUString& 
SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY()
 return sProp;
 }
 
+SfxClassificationPolicyType SfxClassificationHelper::getPolicyType()
+{
+sal_Int32 nPolicyTypeNumber = 
officecfg::Office::Common::Classification::Policy::get();
+auto eType = static_cast(nPolicyTypeNumber);
+return eType;
+
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 6b90dbde76ca..37b774264aec 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -465,14 +465,6 @@ static void 
lcl_removeAllProperties(uno::Reference co
 }
 }
 
-// from classification helper
-SfxClassificationPolicyType getPolicyType()
-{
-sal_Int32 nPolicyTypeNumber = 
officecfg::Office::Common::Classification::Policy::get();
-auto eType = static_cast(nPolicyTypeNumber);
-return eType;
-}
-
 bool addOrInsertDocumentProperty(uno::Reference 
const & rxPropertyContainer, OUString const & rsKey, OUString const & rsValue)
 {
 uno::Reference xPropertySet(rxPropertyContainer, 
uno::UNO_QUERY);
@@ -528,11 +520,11 @@ void 
SwEditShell::ApplyAdvancedClassification(std::vector aUsedPageStyles = lcl_getUsedPageStyles(this);
 for (const OUString& rPageStyleName : aUsedPageStyles)
@@ -637,7 +629,7 @@ std::vector 
SwEditShell::CollectAdvancedClassificatio
 uno::Reference xDocumentProperties = 
SfxObjectShell::Current()->getDocProperties();
 uno::Reference xPropertyContainer = 
xDocumentProperties->getUserDefinedProperties();
 
-OUString sPolicy = 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2017-09-18 Thread Caolán McNamara
 include/sfx2/objsh.hxx   |1 +
 sfx2/source/doc/objmisc.cxx  |5 +
 sfx2/source/doc/sfxbasemodel.cxx |4 ++--
 sw/source/filter/xml/xmlimp.cxx  |4 ++--
 4 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit bdd797267b1e9e664b64e1c1525d1dde520a7063
Author: Caolán McNamara 
Date:   Mon Sep 18 15:39:31 2017 +0100

make fuzzer work

Change-Id: I798558260f5f975f92b702ecf6f4504738ffbbfb
Reviewed-on: https://gerrit.libreoffice.org/42422
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index bc33bb1dd33d..b514989055bc 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -460,6 +460,7 @@ public:
 virtual voidSetFormatSpecificCompatibilityOptions( const 
OUString& /*rFilterTypeName*/ ) { /* Do not do anything here; Derived classes 
must overload to do actual work */ };
 
 voidTemplateDisconnectionAfterLoad();
+voidSetLoading(SfxLoadedFlags nFlags);
 boolIsLoading() const;
 boolIsLoadingFinished() const;
 voidSetAutoLoad( const INetURLObject&, sal_uInt32 
nTime, bool bReload );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 6b7f5a89cc09..d0cce800325e 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1002,6 +1002,11 @@ void SfxObjectShell::SetAutoLoad(
 }
 }
 
+void SfxObjectShell::SetLoading(SfxLoadedFlags nFlags)
+{
+pImpl->nLoadedFlags = nFlags;
+}
+
 bool SfxObjectShell::IsLoadingFinished() const
 {
 return ( pImpl->nLoadedFlags == SfxLoadedFlags::ALL );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 88d7e866d335..2e48c03e90f4 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2248,7 +2248,7 @@ Reference< script::XStorageBasedLibraryContainer > 
SAL_CALL SfxBaseModel::getBas
 
 Reference< script::XStorageBasedLibraryContainer > xBasicLibraries;
 if ( m_pData->m_pObjectShell.is() )
-xBasicLibraries.set( m_pData->m_pObjectShell->GetBasicContainer(), 
UNO_QUERY_THROW );
+xBasicLibraries.set(m_pData->m_pObjectShell->GetBasicContainer(), 
UNO_QUERY);
 return xBasicLibraries;
 }
 
@@ -2258,7 +2258,7 @@ Reference< script::XStorageBasedLibraryContainer > 
SAL_CALL SfxBaseModel::getDia
 
 Reference< script::XStorageBasedLibraryContainer > xDialogLibraries;
 if ( m_pData->m_pObjectShell.is() )
-xDialogLibraries.set( m_pData->m_pObjectShell->GetDialogContainer(), 
UNO_QUERY_THROW );
+xDialogLibraries.set(m_pData->m_pObjectShell->GetDialogContainer(), 
UNO_QUERY);
 return xDialogLibraries;
 }
 
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 4ea3cebeef1e..fba57d39370a 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1588,9 +1588,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL 
TestImportFODT(SvStream )
 //by the xml filter and during the init, while its considered 
uninitialized,
 //setting a property will inform the document its modified, which attempts
 //to update the properties, which throws cause the properties are 
uninitialized
-//xDocSh->SetLoading(SfxLoadedFlags::NONE);
+xDocSh->SetLoading(SfxLoadedFlags::NONE);
 bool ret = xFilter->filter(aArgs);
-//xDocSh->SetLoading(SfxLoadedFlags::ALL);
+xDocSh->SetLoading(SfxLoadedFlags::ALL);
 
 return ret;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2017-03-07 Thread Caolán McNamara
 include/sfx2/app.hxx  |1 -
 sfx2/source/appl/app.cxx  |   15 ---
 sw/source/ui/index/cnttab.cxx |5 +
 3 files changed, 1 insertion(+), 20 deletions(-)

New commits:
commit a247f6f8febbc24a3298b7c5404cade8a432fecf
Author: Caolán McNamara 
Date:   Tue Mar 7 10:48:56 2017 +

only one use of GetLastSaveDirectory

which is to get its value and do a const_cast dance to save and
restore its value which is a strange thing to do just for one
obscure dialog when no other use of the save/load dialogs does this

Change-Id: I7700d7ed738d578869284d415197de06167001b5

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 6bed28c..5735044 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -160,7 +160,6 @@ public:
 // members
 SfxFilterMatcher&   GetFilterMatcher();
 SfxProgress*GetProgress() const;
-const OUString&   GetLastSaveDirectory() const;
 sal_uInt16  GetFreeIndex();
 voidReleaseIndex(sal_uInt16 i);
 
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index a573fcc..0b14446 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -260,21 +260,6 @@ const OUString& SfxApplication::GetLastDir_Impl() const
 return pImpl->aLastDir;
 }
 
-const OUString& SfxApplication::GetLastSaveDirectory() const
-
-/*  [Description]
-
-As , only external
-
-[Cross-reference]
-
-*/
-
-{
-return GetLastDir_Impl();
-}
-
-
 void SfxApplication::SetLastDir_Impl
 (
 const OUString&   rNewDir /* Complete directory path as a string */
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 100e759..9eb671a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -106,9 +106,6 @@ static OUString lcl_CreateAutoMarkFileDlg( const OUString& 
rURL,
 xFltMgr->appendFilter( rFileString, "*.sdi" );
 xFltMgr->setCurrentFilter( rFileString ) ;
 
-OUString& rLastSaveDir = (OUString&)SfxGetpApp()->GetLastSaveDirectory();
-OUString sSaveDir = rLastSaveDir;
-
 if( !rURL.isEmpty() )
 xFP->setDisplayDirectory( rURL );
 else
@@ -121,7 +118,7 @@ static OUString lcl_CreateAutoMarkFileDlg( const OUString& 
rURL,
 {
 sRet = xFP->getSelectedFiles().getConstArray()[0];
 }
-rLastSaveDir = sSaveDir;
+
 return sRet;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2016-10-06 Thread Michael Stahl
 include/sfx2/docinsert.hxx |2 +-
 sfx2/source/doc/docinsert.cxx  |   16 ++--
 sw/source/ui/dialog/uiregionsw.cxx |4 ++--
 sw/source/uibase/app/docsh2.cxx|4 +++-
 4 files changed, 16 insertions(+), 10 deletions(-)

New commits:
commit e0d373bf5328bfe84079f094dd605bb8f4337330
Author: Michael Stahl 
Date:   Thu Oct 6 15:50:13 2016 +0200

tdf#101813 sw,sfx2: enable inserting master document as section

Traditionally only ordinary com.sun.star.text.TextDocument could be
inserted as a section but then commit
3da8f3680556e0163f660a0a159930337c8c32ff unintentionally enabled
inserting everything, including master documents
(com.sun.star.text.GlobalDocument).

I'm really not sure if this should be allowed or not but apparently
somebody finds it useful so here we add some crude hacks to enable it
(to be reverted in case it causes trouble).

(regression? from 805fd1ca343d6295b8114a24cc29bdac332f266d)

Change-Id: I439b2516fcbe54977ff04e487a920acd38c27152

diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx
index 5d6ea0a..abd448d 100644
--- a/include/sfx2/docinsert.hxx
+++ b/include/sfx2/docinsert.hxx
@@ -57,7 +57,7 @@ public:
 ~DocumentInserter();
 
 voidStartExecuteModal( const 
Link& _rDialogClosedLink );
-SfxMedium*  CreateMedium();
+SfxMedium*  CreateMedium(char const* pFallbackHack = 0);
 SfxMediumList*  CreateMediumList();
 };
 
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index 4ef731a..d1f0382 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -79,7 +79,7 @@ void DocumentInserter::StartExecuteModal( const 
LinkStartExecuteModal( LINK( this, DocumentInserter, 
DialogClosedHdl ) );
 }
 
-SfxMedium* DocumentInserter::CreateMedium()
+SfxMedium* DocumentInserter::CreateMedium(char const*const pFallbackHack)
 {
 std::unique_ptr pMedium;
 if (!m_nError && m_pItemSet && !m_pURLList.empty())
@@ -90,14 +90,20 @@ SfxMedium* DocumentInserter::CreateMedium()
 sURL, SFX_STREAM_READONLY,
 SfxGetpApp()->GetFilterMatcher().GetFilter4FilterName( 
m_sFilter ), m_pItemSet ));
 pMedium->UseInteractionHandler( true );
-SfxFilterMatcher* pMatcher = nullptr;
+std::unique_ptr pMatcher;
 if ( !m_sDocFactory.isEmpty() )
-pMatcher = new SfxFilterMatcher( m_sDocFactory );
+pMatcher.reset(new SfxFilterMatcher(m_sDocFactory));
 else
-pMatcher = new SfxFilterMatcher();
+pMatcher.reset(new SfxFilterMatcher());
 
 std::shared_ptr pFilter;
 sal_uInt32 nError = pMatcher->DetectFilter( *pMedium, pFilter );
+// tdf#101813 hack: check again if it's a global document
+if (ERRCODE_NONE != nError && pFallbackHack)
+{
+pMatcher.reset(new 
SfxFilterMatcher(OUString::createFromAscii(pFallbackHack)));
+nError = pMatcher->DetectFilter( *pMedium, pFilter );
+}
 if ( nError == ERRCODE_NONE && pFilter )
 pMedium->SetFilter( pFilter );
 else
@@ -105,8 +111,6 @@ SfxMedium* DocumentInserter::CreateMedium()
 
 if ( pMedium && CheckPasswd_Impl( nullptr, SfxGetpApp()->GetPool(), 
pMedium.get() ) == ERRCODE_ABORT )
 pMedium.reset();
-
-DELETEZ( pMatcher );
 }
 
 return pMedium.release();
diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 51f1c74..496654a 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1316,7 +1316,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, 
sfx2::FileDialogHelper *, _pFileDlg, v
 OUString sFileName, sFilterName, sPassword;
 if ( _pFileDlg->GetError() == ERRCODE_NONE )
 {
-std::unique_ptr pMedium(m_pDocInserter->CreateMedium());
+std::unique_ptr 
pMedium(m_pDocInserter->CreateMedium("sglobal"));
 if ( pMedium )
 {
 sFileName = pMedium->GetURLObject().GetMainURL( 
INetURLObject::NO_DECODE );
@@ -1783,7 +1783,7 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, 
sfx2::FileDialogHelper *, _pFil
 {
 if ( _pFileDlg->GetError() == ERRCODE_NONE )
 {
-std::unique_ptr pMedium(m_pDocInserter->CreateMedium());
+std::unique_ptr 
pMedium(m_pDocInserter->CreateMedium("sglobal"));
 if ( pMedium )
 {
 m_sFileName = pMedium->GetURLObject().GetMainURL( 
INetURLObject::NO_DECODE );
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 92c6b1b..8b5a6d9 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1574,7 +1574,9 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
 std::shared_ptr pSfxFlt;
 if 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2016-05-23 Thread Xisco Fauli
 include/sfx2/new.hxx |2 +-
 sfx2/source/doc/new.cxx  |6 +++---
 sw/source/uibase/uiview/view.cxx |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a1cfd9ff7dc0371720c4e2670e318a8282bd9735
Author: Xisco Fauli 
Date:   Sun May 22 17:59:30 2016 +0200

tdf#89329: use unique_ptr for pImpl in new

Fix "error: declaration of ‘pImpl’ shadows a
member of 'this' [-Werror=shadow]" too

Change-Id: Ib0fc66375ed7d9ae700d5a81a2adb5975fcae592
Reviewed-on: https://gerrit.libreoffice.org/25319
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
index 56a7c2f..c7f5b625 100644
--- a/include/sfx2/new.hxx
+++ b/include/sfx2/new.hxx
@@ -59,7 +59,7 @@ class SFX2_DLLPUBLIC SfxNewFileDialog : public SfxModalDialog
 friend class SfxNewFileDialog_Impl;
 
 private:
-SfxNewFileDialog_Impl* pImpl;
+std::unique_ptr< SfxNewFileDialog_Impl > pImpl;
 
 public:
 
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 06e93ce..9b90f80 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -423,9 +423,9 @@ SfxNewFileDialog_Impl::~SfxNewFileDialog_Impl()
 
 SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags)
 : SfxModalDialog(pParent, "LoadTemplateDialog",
-"sfx/ui/loadtemplatedialog.ui")
+"sfx/ui/loadtemplatedialog.ui"),
+  pImpl( new SfxNewFileDialog_Impl(this, nFlags) )
 {
-pImpl = new SfxNewFileDialog_Impl(this, nFlags);
 }
 
 SfxNewFileDialog::~SfxNewFileDialog()
@@ -435,7 +435,7 @@ SfxNewFileDialog::~SfxNewFileDialog()
 
 void SfxNewFileDialog::dispose()
 {
-delete pImpl;
+pImpl.reset();
 SfxModalDialog::dispose();
 }
 
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index f02a691..354f007 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1763,8 +1763,8 @@ void SwView::NotifyDBChanged()
 
 SfxObjectShellLock SwView::CreateTmpSelectionDoc()
 {
-SwXTextView *const pImpl = GetViewImpl()->GetUNOObject_Impl();
-return pImpl->BuildTmpSelectionDoc();
+SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
+return pTempImpl->BuildTmpSelectionDoc();
 }
 
 void SwView::AddTransferable(SwTransferable& rTransferable)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2016-05-17 Thread Miklos Vajna
 include/sfx2/classificationhelper.hxx |2 
 sfx2/source/view/classificationhelper.cxx |  116 --
 sw/source/core/edit/edfcol.cxx|   14 ++-
 3 files changed, 75 insertions(+), 57 deletions(-)

New commits:
commit f935bf47d1928f3b4df9cde600ce365cd63e485d
Author: Miklos Vajna 
Date:   Tue May 17 12:01:57 2016 +0200

sfx2 classification: do not hardcode policy type in SfxClassificationParser

TSCP_BAILSv1 says:

"{type} designates the type of a policy. In BAILS 1.0, the recognized
string values are: ExportControl, NationalSecurity and
IntellectualProperty"

Previously {type} was always assumed to be IntellectualProperty. Change
the parser to not hardcode the policy type anymore; also change the
getter for the string constants to not contain this prefix.

SfxClassificationHelper::Impl still doesn't support multiple policy
types, though.

Change-Id: If52b40577f1c5751dacb83617fb28862d9d5bdb3
Reviewed-on: https://gerrit.libreoffice.org/25055
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/sfx2/classificationhelper.hxx 
b/include/sfx2/classificationhelper.hxx
index 5cf0cdd..0ece553 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -75,6 +75,8 @@ public:
 static const OUString& PROP_DOCFOOTER();
 /// Brief text formatted as a watermark on each document's page.
 static const OUString& PROP_DOCWATERMARK();
+/// Get the property prefix for the IntellectualProperty policy type.
+static const OUString& PROP_PREFIX_INTELLECTUALPROPERTY();
 };
 
 #endif
diff --git a/sfx2/source/view/classificationhelper.cxx 
b/sfx2/source/view/classificationhelper.cxx
index 5c581d5..0bc615f 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -42,13 +42,13 @@ namespace
 
 const OUString& PROP_BACNAME()
 {
-static OUString 
sProp("urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Name");
+static OUString sProp("BusinessAuthorizationCategory:Name");
 return sProp;
 }
 
 const OUString& PROP_STARTVALIDITY()
 {
-static OUString 
sProp("urn:bails:IntellectualProperty:Authorization:StartValidity");
+static OUString sProp("Authorization:StartValidity");
 return sProp;
 }
 
@@ -60,13 +60,13 @@ const OUString& PROP_NONE()
 
 const OUString& PROP_IMPACTSCALE()
 {
-static OUString sProp("urn:bails:IntellectualProperty:Impact:Scale");
+static OUString sProp("Impact:Scale");
 return sProp;
 }
 
 const OUString& PROP_IMPACTLEVEL()
 {
-static OUString 
sProp("urn:bails:IntellectualProperty:Impact:Level:Confidentiality");
+static OUString sProp("Impact:Level:Confidentiality");
 return sProp;
 }
 
@@ -178,39 +178,39 @@ throw (xml::sax::SAXException, uno::RuntimeException, 
std::exception)
 m_aCategories.push_back(SfxClassificationCategory());
 SfxClassificationCategory& rCategory = m_aCategories.back();
 rCategory.m_aName = aName;
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:PolicyAuthority:Name"] = 
m_aPolicyAuthorityName;
-rCategory.m_aLabels["urn:bails:IntellectualProperty:Policy:Name"] 
= m_aPolicyName;
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorization:Identifier"]
 = m_aProgramID;
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier"]
 = aIdentifier;
+rCategory.m_aLabels["PolicyAuthority:Name"] = 
m_aPolicyAuthorityName;
+rCategory.m_aLabels["Policy:Name"] = m_aPolicyName;
+rCategory.m_aLabels["BusinessAuthorization:Identifier"] = 
m_aProgramID;
+rCategory.m_aLabels["BusinessAuthorizationCategory:Identifier"] = 
aIdentifier;
 
 // Also initialize defaults.
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:PolicyAuthority:Identifier"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:PolicyAuthority:Country"] = 
PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:Policy:Identifier"] = 
PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorization:Name"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorization:Locator"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier:OID"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Locator"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:BusinessAuthorization:Locator"]
 = PROP_NONE();
-
rCategory.m_aLabels["urn:bails:IntellectualProperty:MarkingPrecedence"] = 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2016-04-06 Thread Stephan Bergmann
 include/sfx2/lnkbase.hxx|4 ++--
 sfx2/source/appl/lnkbase2.cxx   |   10 +-
 sw/source/core/docnode/swbaslnk.cxx |2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 165b087b19c644ad872dcaf84b1ca6b3dfedda68
Author: Stephan Bergmann 
Date:   Wed Apr 6 14:20:04 2016 +0200

Avoid reserved identifier

Change-Id: Ica4dc147a49525f0ec65241c2a9f1d3eb75b7285

diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index 2a8bb22..9a98ddc 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -99,12 +99,12 @@ protected:
 SvBaseLink( SfxLinkUpdateMode nLinkType, 
SotClipboardFormatId nContentType = SotClipboardFormatId::STRING );
 virtual ~SvBaseLink();
 
-void_GetRealObject( bool bConnect = true );
+voidGetRealObject_( bool bConnect = true );
 
 SvLinkSource*   GetRealObject()
 {
 if( !xObj.Is() )
-_GetRealObject();
+GetRealObject_();
 return xObj;
 }
 
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index ea424ae..6f86946 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -282,7 +282,7 @@ void SvBaseLink::SetLinkSourceName( const OUString & rLnkNm 
)
 aLinkName = rLnkNm;
 
 // New Connection
-_GetRealObject();
+GetRealObject_();
 ReleaseRef(); // should be superfluous
 }
 
@@ -296,7 +296,7 @@ void SvBaseLink::SetUpdateMode( SfxLinkUpdateMode nMode )
 Disconnect();
 
 pImplData->ClientType.nUpdateMode = nMode;
-_GetRealObject();
+GetRealObject_();
 ReleaseRef();
 }
 }
@@ -318,7 +318,7 @@ bool SvBaseLink::Update()
 AddNextRef();
 Disconnect();
 
-_GetRealObject();
+GetRealObject_();
 ReleaseRef();
 if( xObj.Is() )
 {
@@ -362,7 +362,7 @@ SfxLinkUpdateMode SvBaseLink::GetUpdateMode() const
 }
 
 
-void SvBaseLink::_GetRealObject( bool bConnect)
+void SvBaseLink::GetRealObject_( bool bConnect)
 {
 if( !pImpl->m_pLinkMgr )
 return;
@@ -455,7 +455,7 @@ void SvBaseLink::Edit( vcl::Window* pParent, const 
Link& rEndE
 pImpl->m_aEndEditLink = rEndEditHdl;
 pImpl->m_bIsConnect = xObj.Is();
 if( !pImpl->m_bIsConnect )
-_GetRealObject( xObj.Is() );
+GetRealObject_( xObj.Is() );
 
 bool bAsync = false;
 Link aLink = LINK( this, SvBaseLink, EndEditHdl );
diff --git a/sw/source/core/docnode/swbaslnk.cxx 
b/sw/source/core/docnode/swbaslnk.cxx
index 8620fce..fbe68e4 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -376,7 +376,7 @@ bool SwBaseLink::SwapIn( bool bWaitForData, bool 
bNativFormat )
 if( !GetObj() && ( bNativFormat || ( !IsSynchron() && bWaitForData ) ))
 {
 AddNextRef();
-_GetRealObject();
+GetRealObject_();
 ReleaseRef();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2015-01-27 Thread Michaël Lefèvre
 include/sfx2/shell.hxx   |1 +
 sfx2/source/control/shell.cxx|   14 ++
 sw/source/uibase/shells/annotsh.cxx  |   11 +--
 sw/source/uibase/shells/drawsh.cxx   |   13 +
 sw/source/uibase/shells/drwtxtex.cxx |   10 +-
 sw/source/uibase/shells/frmsh.cxx|   12 +---
 sw/source/uibase/shells/textsh1.cxx  |   12 +---
 7 files changed, 20 insertions(+), 53 deletions(-)

New commits:
commit d57cd80479fac60a2486c74257a8840e36935e20
Author: Michaël Lefèvre lefevr...@yahoo.fr
Date:   Mon Jan 26 14:46:36 2015 +0100

tdf#60739 code factorisation

Limit duplciation for SfxRequest SID_OPEN_XML_FILTERSETTINGS in sw shells

Change-Id: I316e7df50df5c6d24feb953415ebf61ca822066d
Reviewed-on: https://gerrit.libreoffice.org/14184
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index b833ce1..6af0a02 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -164,6 +164,7 @@ protected:
 SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings rBindings, sal_uInt16 
nId );
 SAL_DLLPRIVATE SfxShellObject* GetShellObj_Impl() const;
 SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
+void HandleOpenXmlFilterSettings(SfxRequest );
 
 public:
 TYPEINFO_OVERRIDE();
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index e6b40a6..445780d 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -43,6 +43,7 @@
 #include statcach.hxx
 #include sfx2/msgpool.hxx
 #include sidebar/ContextChangeBroadcaster.hxx
+#include com/sun/star/ui/dialogs/XSLTFilterDialog.hpp
 
 #include boost/ptr_container/ptr_map.hpp
 #include boost/ptr_container/ptr_vector.hpp
@@ -294,6 +295,19 @@ void SfxShell::Invalidate_Impl( SfxBindings rBindings, 
sal_uInt16 nId )
 }
 }
 
+void SfxShell::HandleOpenXmlFilterSettings(SfxRequest  rReq)
+{
+try
+{
+uno::Reference  ui::dialogs::XExecutableDialog  xDialog = 
ui::dialogs::XSLTFilterDialog::create( 
::comphelper::getProcessComponentContext() );
+xDialog-execute();
+}
+catch (const uno::Exception)
+{
+}
+rReq.Ignore ();
+}
+
 void SfxShell::DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI )
 {
 #ifdef DBG_UTIL
diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index b41a607..dea94dd 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -116,7 +116,6 @@
 #include misc.hrc
 #include app.hrc
 
-#include comphelper/processfactory.hxx
 #include comphelper/string.hxx
 #include cppuhelper/bootstrap.hxx
 
@@ -462,15 +461,7 @@ void SwAnnotationShell::Exec( SfxRequest rReq )
 break;
 case SID_OPEN_XML_FILTERSETTINGS:
 {
-try
-{
-uno::Reference  ui::dialogs::XExecutableDialog  xDialog = 
ui::dialogs::XSLTFilterDialog::create( 
::comphelper::getProcessComponentContext() );
-xDialog-execute();
-}
-catch (const uno::Exception)
-{
-}
-rReq.Ignore ();
+HandleOpenXmlFilterSettings(rReq);
 }
 break;
 case FN_WORDCOUNT_DIALOG:
diff --git a/sw/source/uibase/shells/drawsh.cxx 
b/sw/source/uibase/shells/drawsh.cxx
index 1b98e7b..056d7ce 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -42,9 +42,6 @@
 #include IDocumentStatistics.hxx
 #include tools/diagnose_ex.h
 
-#include comphelper/processfactory.hxx
-#include com/sun/star/ui/dialogs/XSLTFilterDialog.hpp
-
 #include svx/svdoashp.hxx
 #include svx/xtable.hxx
 #include sfx2/sidebar/EnumContext.hxx
@@ -325,15 +322,7 @@ void SwDrawShell::Execute(SfxRequest rReq)
 break;
 case SID_OPEN_XML_FILTERSETTINGS:
 {
-try
-{
-uno::Reference  ui::dialogs::XExecutableDialog  xDialog = 
ui::dialogs::XSLTFilterDialog::create( 
::comphelper::getProcessComponentContext() );
-xDialog-execute();
-}
-catch (const uno::Exception)
-{
-}
-rReq.Ignore ();
+HandleOpenXmlFilterSettings(rReq);
 }
 break;
 case FN_WORDCOUNT_DIALOG:
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index eb1b039..f310062 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -400,15 +400,7 @@ void SwDrawTextShell::Execute( SfxRequest rReq )
 break;
 case SID_OPEN_XML_FILTERSETTINGS:
 {
-try
-{
-uno::Reference  ui::dialogs::XExecutableDialog  xDialog = 
ui::dialogs::XSLTFilterDialog::create( 
::comphelper::getProcessComponentContext() );
-xDialog-execute();
-}
-

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source

2013-09-03 Thread Caolán McNamara
 include/sfx2/tbxctrl.hxx |4 
 sfx2/source/toolbox/tbxitem.cxx  |   17 +
 sw/source/ui/inc/navipi.hxx  |2 +-
 sw/source/ui/inc/workctrl.hxx|2 +-
 sw/source/ui/ribbar/workctrl.cxx |8 
 sw/source/ui/utlui/navipi.cxx|9 -
 6 files changed, 31 insertions(+), 11 deletions(-)

New commits:
commit ff7414a97f5ded66a8e8c8611ad801b1e6c11c9e
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Sep 3 16:46:22 2013 +0100

Resolves: fdo#68726 make navigator child dialog float on top

i.e. set its parent to the thing it wants to be on top of

As an aside I'm not entirely sure that this little dialog has the 
decorations
set on it that it would like, I suspect it wants to be more like the
tearable-off font color floatingwindow. But lets not muddy the waters in 
this
commit.

Change-Id: I9e0c35fbb66e50c04c7b28904d3937cf9ae417f4

diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index af1b1a6..3d403766 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -146,6 +146,10 @@ public:
 const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XFrame  rFrame,
 Window* pParentWindow,
 WinBits nBits );
+SfxPopupWindow( sal_uInt16 nId,
+const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XFrame  rFrame,
+Window* pParentWindow,
+const ResId rId );
 ~SfxPopupWindow();
 
 virtual SfxPopupWindow* Clone() const;
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index ea1d317..928b771 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1208,6 +1208,23 @@ SfxPopupWindow::SfxPopupWindow(
 ((SystemWindow *)pWindow)-GetTaskPaneList()-AddWindow( this );
 }
 
+SfxPopupWindow::SfxPopupWindow(
+sal_uInt16 nId,
+const Reference XFrame  rFrame,
+Window* pParentWindow,
+const ResId rId ) :
+FloatingWindow( pParentWindow, rId )
+, m_bFloating(sal_False)
+, m_bCascading( sal_False )
+, m_nId( nId )
+, m_xFrame( rFrame )
+, m_pStatusListener( 0 )
+{
+Window* pWindow = GetTopMostParentSystemWindow( this );
+if ( pWindow )
+((SystemWindow *)pWindow)-GetTaskPaneList()-AddWindow( this );
+}
+
 //
 
 SfxPopupWindow::~SfxPopupWindow()
diff --git a/sw/source/ui/inc/navipi.hxx b/sw/source/ui/inc/navipi.hxx
index 1082a6a..4e339cf 100644
--- a/sw/source/ui/inc/navipi.hxx
+++ b/sw/source/ui/inc/navipi.hxx
@@ -168,7 +168,7 @@ public:
 sal_BoolIsGlobalMode() const {returnbGlobalMode;}
 
 SwView* GetCreateView() const;
-voidCreateNavigationTool(const Rectangle rRect, bool 
bSetFocus);
+voidCreateNavigationTool(const Rectangle rRect, bool 
bSetFocus, Window *pParent);
 };
 
 class SwNavigationChild : public SfxChildWindowContext
diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx
index be38a29..dcba591 100644
--- a/sw/source/ui/inc/workctrl.hxx
+++ b/sw/source/ui/inc/workctrl.hxx
@@ -162,7 +162,7 @@ protected:
 virtual voidDataChanged( const DataChangedEvent rDCEvt );
 
 public:
-SwScrollNaviPopup( sal_uInt16 nId, const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XFrame  rFrame );
+SwScrollNaviPopup( sal_uInt16 nId, const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XFrame  rFrame, 
Window *pParent );
 ~SwScrollNaviPopup();
 
 static String   GetQuickHelpText(sal_Bool bNext);
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 91d8f59..0c92c28 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -452,8 +452,8 @@ static const char* aNavigationHelpIds[ NAVI_ENTRIES ] =
 HID_NID_NEXT
 };
 
-SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference XFrame 
 rFrame )
-: SfxPopupWindow(nId, rFrame, SW_RES(RID_SCROLL_NAVIGATION_WIN) ),
+SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference XFrame 
 rFrame, Window *pParent)
+: SfxPopupWindow(nId, rFrame, pParent, SW_RES(RID_SCROLL_NAVIGATION_WIN)),
 aToolBox(this, 0),
 aSeparator(this, SW_RES(FL_SEP)),
 aInfoField(this, SW_RES(FI_INFO)),
@@ -540,7 +540,7 @@ void SwScrollNaviPopup::ApplyImageList()
 
 SfxPopupWindow* SwScrollNaviPopup::Clone() const
 {
-return new SwScrollNaviPopup( GetId(), GetFrame() );
+return new SwScrollNaviPopup( GetId(), GetFrame(), GetParent() );
 }
 
 IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)
@@ -602,7 +602,7 @@