summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unotbl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore/unotbl.cxx')
-rw-r--r--sw/source/core/unocore/unotbl.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 591082af1caa..5bfd555f878a 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -111,6 +111,7 @@
#include <swtable.hxx>
#include <docsh.hxx>
#include <fesh.hxx>
+#include <poolfmt.hxx>
using namespace ::com::sun::star;
using ::editeng::SvxBorderLine;
@@ -1066,8 +1067,16 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
const bool bHasAttrSet = pNd->HasSwAttrSet();
const SfxItemSet& aSet = pNd->GetSwAttrSet();
// isPARATR: replace DEFAULT_VALUE properties only
+ // Require that the property is default in the paragraph style as well,
+ // unless the style is the default style.
// isCHRATR: change the base/auto SwAttr property, but don't remove the DIRECT hints
- if ( !bHasAttrSet || SfxItemState::DEFAULT == aSet.GetItemState(pEntry->nWID, /*bSrchInParent=*/false) )
+ bool bCustomParent = false;
+ if (const SwFormatColl* pFormatColl = pNd->GetFormatColl())
+ {
+ bCustomParent = pFormatColl->GetPoolFormatId() != RES_POOLCOLL_STANDARD;
+ }
+ bool bSearchInParent = bCustomParent && !pNd->GetNumRule();
+ if ( !bHasAttrSet || SfxItemState::DEFAULT == aSet.GetItemState(pEntry->nWID, bSearchInParent) )
SwUnoCursorHelper::SetPropertyValue(aPaM, rParaPropSet, rPropertyName, aValue, SetAttrMode::DONTREPLACE);
}
++aIdx;