summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unosett.cxx34
-rw-r--r--sw/source/core/unocore/unotbl.cxx36
2 files changed, 57 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index e34c0d259635..b3a55713c4e4 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1048,7 +1048,20 @@ void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*
OSL_FAIL("not implemented");
}
-const char aInvalidStyle[] = "__XXX___invalid";
+static const char aInvalidStyle[] = "__XXX___invalid";
+
+
+class SwXNumberingRules::Impl : public SwClient
+{
+private:
+ SwXNumberingRules& m_rParent;
+public:
+ Impl(SwXNumberingRules& rParent) : m_rParent(rParent) {}
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
+};
+
bool SwXNumberingRules::isInvalidStyle(const OUString &rName)
{
@@ -1094,6 +1107,7 @@ Sequence< OUString > SwXNumberingRules::getSupportedServiceNames() throw( Runtim
}
SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc) :
+ m_pImpl(new SwXNumberingRules::Impl(*this)),
pDoc(doc),
pDocShell(nullptr),
pNumRule(new SwNumRule(rRule)),
@@ -1113,7 +1127,7 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc) :
}
}
if(pDoc)
- pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
+ pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(&*m_pImpl);
for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
{
m_sNewCharStyleNames[i] = aInvalidStyle;
@@ -1122,23 +1136,25 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc) :
}
SwXNumberingRules::SwXNumberingRules(SwDocShell& rDocSh) :
+ m_pImpl(new SwXNumberingRules::Impl(*this)),
pDoc(nullptr),
pDocShell(&rDocSh),
pNumRule(nullptr),
m_pPropertySet(GetNumberingRulesSet()),
bOwnNumRuleCreated(false)
{
- pDocShell->GetDoc()->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
+ pDocShell->GetDoc()->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(&*m_pImpl);
}
SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
+ m_pImpl(new SwXNumberingRules::Impl(*this)),
pDoc(&rDoc),
pDocShell(nullptr),
pNumRule(nullptr),
m_pPropertySet(GetNumberingRulesSet()),
bOwnNumRuleCreated(false)
{
- rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
+ rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(&*m_pImpl);
m_sCreatedNumRuleName = rDoc.GetUniqueNumRuleName();
#if OSL_DEBUG_LEVEL > 1
const sal_uInt16 nIndex =
@@ -2249,15 +2265,15 @@ void SwXNumberingRules::setName(const OUString& /*rName*/) throw( RuntimeExcepti
throw aExcept;
}
-void SwXNumberingRules::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
+void SwXNumberingRules::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
{
- if(bOwnNumRuleCreated)
- delete pNumRule;
- pNumRule = nullptr;
- pDoc = nullptr;
+ if(m_rParent.bOwnNumRuleCreated)
+ delete m_rParent.pNumRule;
+ m_rParent.pNumRule = nullptr;
+ m_rParent.pDoc = nullptr;
}
}
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 3d8c53dadba4..d8cf5c6ac459 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3756,6 +3756,15 @@ void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
}
}
+class SwXTableRows::Impl : public SwClient
+{
+public:
+ Impl(SwFrameFormat& rFrameFormat) : SwClient(&rFrameFormat) {}
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
+};
+
// SwXTableRows
OUString SwXTableRows::getImplementationName() throw( uno::RuntimeException, std::exception )
@@ -3769,12 +3778,17 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames() throw( uno::R
SwXTableRows::SwXTableRows(SwFrameFormat& rFrameFormat) :
- SwClient(&rFrameFormat)
+ m_pImpl(new SwXTableRows::Impl(rFrameFormat))
{ }
SwXTableRows::~SwXTableRows()
{ }
+SwFrameFormat* SwXTableRows::GetFrameFormat()
+{
+ return static_cast<SwFrameFormat*>(m_pImpl->GetRegisteredIn());
+}
+
sal_Int32 SwXTableRows::getCount() throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
@@ -3904,11 +3918,20 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount)
}
}
-void SwXTableRows::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
+void SwXTableRows::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{ ClientModify(this, pOld, pNew); }
// SwXTableColumns
+class SwXTableColumns::Impl : public SwClient
+{
+public:
+ Impl(SwFrameFormat& rFrameFormat) : SwClient(&rFrameFormat) {}
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
+};
+
OUString SwXTableColumns::getImplementationName() throw( uno::RuntimeException, std::exception )
{ return OUString("SwXTableColumns"); }
@@ -3920,12 +3943,17 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames() throw( uno
SwXTableColumns::SwXTableColumns(SwFrameFormat& rFrameFormat) :
- SwClient(&rFrameFormat)
+ m_pImpl(new SwXTableColumns::Impl(rFrameFormat))
{ }
SwXTableColumns::~SwXTableColumns()
{ }
+SwFrameFormat* SwXTableColumns::GetFrameFormat() const
+{
+ return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(m_pImpl->GetRegisteredIn()));
+}
+
sal_Int32 SwXTableColumns::getCount() throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
@@ -4044,7 +4072,7 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount)
}
}
-void SwXTableColumns::Modify(const SfxPoolItem* pOld, const SfxPoolItem *pNew)
+void SwXTableColumns::Impl::Modify(const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{ ClientModify(this, pOld, pNew); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */