summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-06 11:44:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-06 16:53:54 +0100
commit8dfd8245381b8b9e89d2399b35c089964385b3cf (patch)
tree66f5a63f4626fd1c3c4b98cc46bbe7361cbb7b01 /sw
parente9b848270850f57965d274f7fd47fc2a84611465 (diff)
SwDocStyleSheet: add getter / setter for InteropGrabBag
Change-Id: I4163633f11c75cf9f12485212f563c8f53af38f7
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docstyle.hxx2
-rw-r--r--sw/source/ui/app/docstyle.cxx46
2 files changed, 48 insertions, 0 deletions
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 8620cd865a45..a08ff60a9c83 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -101,6 +101,8 @@ public:
virtual void SetHidden( sal_Bool bHidden );
virtual sal_Bool IsHidden( ) const;
+ void SetGrabBagItem(const com::sun::star::uno::Any& rVal);
+ void GetGrabBagItem(com::sun::star::uno::Any& rVal) const;
/** add optional parameter <bResetIndentAttrsAtParagraphStyle>, default value sal_False,
which indicates that the indent attributes at a paragraph style should
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 4759a0ed7bcc..8e3736db483e 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -54,6 +54,8 @@
#include <svx/svxids.hrc>
#include <SwRewriter.hxx>
+using namespace com::sun::star;
+
// The Format names in the list of all names have the
// following family as their first character:
@@ -425,6 +427,50 @@ void SwDocStyleSheet::Reset()
SetPhysical(sal_False);
}
+void SwDocStyleSheet::SetGrabBagItem(const uno::Any& rVal)
+{
+ bool bChg = false;
+ if (!bPhysical)
+ FillStyleSheet(FillPhysical);
+
+ SwFmt* pFmt = 0;
+ switch (nFamily)
+ {
+ case SFX_STYLE_FAMILY_PARA:
+ pFmt = rDoc.FindTxtFmtCollByName(aName);
+ if (pFmt)
+ {
+ pFmt->SetGrabBagItem(rVal);
+ bChg = true;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (bChg)
+ {
+ dynamic_cast<SwDocStyleSheetPool*>(pPool)->InvalidateIterator();
+ pPool->Broadcast(SfxStyleSheetHint(SFX_STYLESHEET_MODIFIED, *this));
+ SwEditShell* pSh = rDoc.GetEditShell();
+ if (pSh)
+ pSh->CallChgLnk();
+ }
+}
+
+void SwDocStyleSheet::GetGrabBagItem(uno::Any& rVal) const
+{
+ SwFmt* pFmt = 0;
+ switch (nFamily)
+ {
+ case SFX_STYLE_FAMILY_PARA:
+ pFmt = rDoc.FindTxtFmtCollByName(aName);
+ pFmt->GetGrabBagItem(rVal);
+ break;
+ default:
+ break;
+ }
+}
// virtual methods
void SwDocStyleSheet::SetHidden( sal_Bool bValue )
{