summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-03-20 16:41:27 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-03-20 16:41:27 +0100
commit8bc6891e71b996c4713c784c9d599e71c26bc135 (patch)
tree4e6a6dee3c6cbfe88e1a4511461aba88545fa258
parent213dbcb71ecc4b23bb2b787a3e0b3cf07f3e21ed (diff)
Deglobalize find & replace data in Impressfeature/jsdialogs
Change-Id: I16e914b4673e2aa80823d630306217b4cda50bad
-rw-r--r--sd/inc/sdmod.hxx5
-rw-r--r--sd/source/ui/app/sdmod.cxx9
-rw-r--r--sd/source/ui/docshell/docshel3.cxx4
-rw-r--r--sd/source/ui/docshell/docshell.cxx2
-rw-r--r--sd/source/ui/inc/ViewShell.hxx5
-rw-r--r--sd/source/ui/view/viewshel.cxx10
6 files changed, 18 insertions, 17 deletions
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 3196bafe07da..362691794a9e 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -33,7 +33,6 @@
#include <memory>
class SdOptions;
-class SvxSearchItem;
class EditFieldInfo;
class SdTransferable;
class SvNumberFormatter;
@@ -94,9 +93,6 @@ public:
bool GetWaterCan() const { return bWaterCan; }
void SetWaterCan( bool bWC ) { bWaterCan = bWC; }
- SvxSearchItem* GetSearchItem() { return pSearchItem.get(); }
- void SetSearchItem(std::unique_ptr<SvxSearchItem> pItem);
-
/** Return the virtual device that can be used for printer independent
layout.
@return
@@ -123,7 +119,6 @@ private:
SdOptions* pImpressOptions;
SdOptions* pDrawOptions;
- std::unique_ptr<SvxSearchItem> pSearchItem;
std::unique_ptr<SvNumberFormatter> pNumberFormatter;
tools::SvRef<SotStorage> xOptionStorage;
bool bWaterCan;
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index b55213c44ed2..8d80c8f1b058 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -37,7 +37,6 @@
#include <svtools/ehdl.hxx>
#include <svx/svxids.hrc>
-#include <svl/srchitem.hxx>
#include <svx/svxerr.hxx>
#include <svx/xmlsecctrl.hxx>
@@ -76,8 +75,6 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
mpColorConfig(new svtools::ColorConfig)
{
SetName( "StarDraw" ); // Do not translate!
- pSearchItem.reset( new SvxSearchItem(SID_SEARCH_ITEM) );
- pSearchItem->SetAppFlag(SvxSearchApp::DRAW);
StartListening( *SfxGetpApp() );
SvxErrorHandler::ensure();
mpErrorHdl.reset( new SfxErrorHandler(RID_SD_ERRHDL, ErrCodeArea::Sd, ErrCodeArea::Sd, GetResLocale()) );
@@ -98,7 +95,6 @@ OUString SdResId(const char* pId)
// Dtor
SdModule::~SdModule()
{
- pSearchItem.reset();
pNumberFormatter.reset();
if (mbEventListenerAdded)
@@ -110,11 +106,6 @@ SdModule::~SdModule()
mpVirtualRefDevice.disposeAndClear();
}
-void SdModule::SetSearchItem(std::unique_ptr<SvxSearchItem> pItem)
-{
- pSearchItem = std::move(pItem);
-}
-
/// get notifications
void SdModule::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 8aab98e8dd65..2143771a147d 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -157,7 +157,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
{
const SvxSearchItem & rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM);
- SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>(rSearchItem.Clone())));
+ GetViewShell()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>(rSearchItem.Clone())));
}
rReq.Done();
@@ -220,7 +220,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
{
const SvxSearchItem& rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM);
- SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>( rSearchItem.Clone() )));
+ GetViewShell()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>( rSearchItem.Clone() )));
xFuSearch->SearchAndReplace(&rSearchItem);
}
}
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 13e9dcd72771..8baae6075ee5 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -227,7 +227,7 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
case SID_SEARCH_ITEM:
{
- rSet.Put( *SD_MOD()->GetSearchItem() );
+ rSet.Put( *GetViewShell()->GetSearchItem() );
}
break;
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 57c2d1df78c6..070ff47333a3 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -417,6 +417,9 @@ public:
/// Allows starting or ending a graphic move or resize action.
void SetGraphicMm100Position(bool bStart, const Point& rPosition);
+ SvxSearchItem* GetSearchItem() { return mpSearchItem.get(); }
+ void SetSearchItem(std::unique_ptr<SvxSearchItem> pItem);
+
class Implementation;
protected:
@@ -546,6 +549,8 @@ private:
/** Create the rulers.
*/
void SetupRulers();
+
+ std::unique_ptr<SvxSearchItem> mpSearchItem;
};
SdrView* ViewShell::GetDrawView() const
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 6a5afbc3d366..9bbbc423e934 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -87,6 +87,7 @@
#include <editeng/editview.hxx>
#include <editeng/editeng.hxx>
#include <svl/poolitem.hxx>
+#include <svl/srchitem.hxx>
#include <strings.hxx>
#include <sdmod.hxx>
#include <AccessibleDocumentViewBase.hxx>
@@ -137,12 +138,16 @@ SfxViewFrame* ViewShell::GetViewFrame() const
ViewShell::ViewShell( vcl::Window* pParentWindow, ViewShellBase& rViewShellBase)
: SfxShell(&rViewShellBase)
, mpParentWindow(pParentWindow)
+, mpSearchItem(new SvxSearchItem(SID_SEARCH_ITEM))
{
+ mpSearchItem->SetAppFlag(SvxSearchApp::DRAW);
construct();
}
ViewShell::~ViewShell()
{
+ mpSearchItem.reset();
+
// Keep the content window from accessing in its destructor the
// WindowUpdater.
if (mpContentWindow)
@@ -1575,6 +1580,11 @@ sd::Window* ViewShell::GetContentWindow() const
return mpContentWindow.get();
}
+void ViewShell::SetSearchItem(std::unique_ptr<SvxSearchItem> pItem)
+{
+ mpSearchItem = std::move(pItem);
+}
+
} // end of namespace sd
//===== ViewShellObjectBarFactory =============================================