From 0a38ea41341b9722f0590d1e54806122f2224b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 20 Nov 2014 15:53:14 +0000 Subject: [PATCH] experiment, but still other problems, possibly unrelated to this Change-Id: I3021845df83e8ec8f3ece2377172bae7413b35d3 --- svx/source/table/tablecontroller.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index d9f03b7..ecb4938 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -878,7 +878,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) ); - MergeAttrFromSelectedCells(aNewAttr, true); + MergeAttrFromSelectedCells(aNewAttr, false); FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem ); aNewAttr.Put( aBoxItem ); aNewAttr.Put( aBoxInfoItem ); @@ -888,8 +888,21 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) // Even Cancel Button is returning positive(101) value, if( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) { - SfxItemSet aNewSet( aNewAttr ); - aNewSet.Put( *(pDlg->GetOutputItemSet ()) ); + SfxItemSet aNewSet( *(pDlg->GetOutputItemSet ()) ); + + //Only properties that were unchanged by the dialog appear in this + //itemset. We bad constructed these two properties from other + //ones, so if they were not changed, then forcible set them back to + //their originals in the new result set so we can decompose that + //unchanged state back to their input properties + if (aNewSet.GetItemState(SDRATTR_TABLE_BORDER, false) != SfxItemState::SET) + { + aNewSet.Put(aBoxItem); + } + if (aNewSet.GetItemState(SDRATTR_TABLE_BORDER_INNER, false) != SfxItemState::SET) + { + aNewSet.Put(aBoxInfoItem); + } SvxBoxItem aNewBoxItem( static_cast< const SvxBoxItem& >( aNewSet.Get( SDRATTR_TABLE_BORDER ) ) ); -- 1.9.3