summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-04-20 12:23:23 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-04-21 10:07:01 +0900
commit68d06f69b56611bc6c95c1c2e8af400c7985a8fc (patch)
tree203bf6e9909ad3027eb29a08be183c6895fd41e8 /sw
parenta630f4f2e18bed78c1c1e4ef793b4636ce5ebcfc (diff)
StyleManager & StylePreviewRenderer + common implementation
StyleManager is a new class responsible to handle document styles. The current implementation has only the responsibility to provide a implementation of StylePreviewReneder, but the idea is to move all style related functionallity to this class (and relieve the SfxObjectShell a bit). CommonStyleMAnager is the common impl. StylePreviewRenderer is responsible to render a preview of a style. As styles can be handled differently by each component it is possible to provide component specific StylePreviewRendered, but currently only the common one is implemented and used by sw. Change-Id: Id271485f571a777a3e94f855d3c614a2efc14628
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docsh.hxx5
-rw-r--r--sw/source/uibase/app/docsh.cxx5
-rw-r--r--sw/source/uibase/app/docshini.cxx5
3 files changed, 15 insertions, 0 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 704d0667f681..50bfdf3e7e40 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -32,6 +32,8 @@
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
+#include <sfx2/StyleManager.hxx>
+
class SwDoc;
class SfxDocumentInfoDialog;
class SfxStyleSheetBasePool;
@@ -67,6 +69,8 @@ class SW_DLLPUBLIC SwDocShell
FontList* m_pFontList; ///< Current Fontlist.
bool m_IsInUpdateFontList; ///< prevent nested calls of UpdateFontList
+ std::unique_ptr<sfx2::StyleManager> m_pStyleManager;
+
/** For "historical reasons" nothing can be done without the WrtShell.
Back-pointer on View (again "for historical reasons").
Back-pointer is valid until in Activate a new one is set
@@ -212,6 +216,7 @@ public:
/// For Style PI.
virtual SfxStyleSheetBasePool* GetStyleSheetPool() SAL_OVERRIDE;
+ virtual sfx2::StyleManager* GetStyleManager() SAL_OVERRIDE;
/// Set View for actions via Shell.
void SetView(SwView* pVw);
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index c3641364b557..495412f51b25 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1064,6 +1064,11 @@ SfxStyleSheetBasePool* SwDocShell::GetStyleSheetPool()
return m_xBasePool.get();
}
+sfx2::StyleManager* SwDocShell::GetStyleManager()
+{
+ return m_pStyleManager.get();
+}
+
void SwDocShell::SetView(SwView* pVw)
{
SetViewShell_Impl(pVw);
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 8a752cae5c1b..7537d0e0d48c 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -86,6 +86,8 @@
#include <globals.hrc>
#include <unochart.hxx>
+#include <svx/CommonStyleManager.hxx>
+
// text grid
#include <tgrditem.hxx>
#include <boost/scoped_ptr.hpp>
@@ -326,6 +328,7 @@ SwDocShell::SwDocShell( SfxObjectCreateMode const eMode )
, m_pDoc(nullptr)
, m_pFontList(nullptr)
, m_IsInUpdateFontList(false)
+ , m_pStyleManager(new svx::CommonStyleManager(*this))
, m_pView(nullptr)
, m_pWrtShell(nullptr)
, m_pOLEChildList(nullptr)
@@ -342,6 +345,7 @@ SwDocShell::SwDocShell( const SfxModelFlags i_nSfxCreationFlags )
, m_pDoc(nullptr)
, m_pFontList(nullptr)
, m_IsInUpdateFontList(false)
+ , m_pStyleManager(new svx::CommonStyleManager(*this))
, m_pView(nullptr)
, m_pWrtShell(nullptr)
, m_pOLEChildList(nullptr)
@@ -358,6 +362,7 @@ SwDocShell::SwDocShell( SwDoc *const pD, SfxObjectCreateMode const eMode )
, m_pDoc(pD)
, m_pFontList(nullptr)
, m_IsInUpdateFontList(false)
+ , m_pStyleManager(new svx::CommonStyleManager(*this))
, m_pView(nullptr)
, m_pWrtShell(nullptr)
, m_pOLEChildList(nullptr)