From b1d8df61b47e84bf0de64342556049673dd9c543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Tue, 3 Jun 2014 14:11:39 +0200 Subject: [PATCH] bnc#882627: Allow to edit spacing to contents even with no borders visible. SfxItemSet::MergeValue changes some items from SFX_ITEM_DEFAULT state to SFX_ITEM_SET which I think is a bug but this patch avoids the problem too. The issue was: visible changes in some tables, after changing e.g. borders spacing, because the cells had wrong SfxItemSet after the process. Change-Id: I676b211e1a4a1d7341c385d63503aa740718ed5d --- cui/source/dialogs/sdrcelldlg.cxx | 7 ++++++- cui/source/inc/border.hxx | 1 + cui/source/inc/sdrcelldlg.hxx | 1 + cui/source/tabpages/border.cxx | 5 ++++- svx/source/table/tablecontroller.cxx | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index 79f924902e42..400e9a834021 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -38,7 +38,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* p { AddTabPage("name", RID_SVXPAGE_CHAR_NAME); AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); - AddTabPage("border", RID_SVXPAGE_BORDER ); + m_nBorderPageId = AddTabPage("border", RID_SVXPAGE_BORDER ); m_nAreaPageId = AddTabPage("area", RID_SVXPAGE_AREA); } @@ -57,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) rAreaPage.Construct(); rAreaPage.ActivatePage( mrOutAttrs ); } + else if (nId == m_nBorderPageId) + { + SvxBorderTabPage& rBorderPage = ((SvxBorderTabPage&)rPage); + rBorderPage.SetTableMode(); + } else SfxTabDialog::PageCreated( nId, rPage ); } diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index dc906dd8cbe5..e3e352b72af9 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -52,6 +52,7 @@ public: void HideShadowControls(); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; + void SetTableMode(); protected: virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx index 9aafbabbfe06..bcae0d840c38 100644 --- a/cui/source/inc/sdrcelldlg.hxx +++ b/cui/source/inc/sdrcelldlg.hxx @@ -36,6 +36,7 @@ private: XBitmapListRef mpBitmapList; sal_uInt16 m_nAreaPageId; + sal_uInt16 m_nBorderPageId; protected: virtual void Apply(); diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index a9cbdd3244e9..f83eeaa584b5 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -1219,6 +1219,9 @@ void SvxBorderTabPage::PageCreated(const SfxAllItemSet& aSet) HideShadowControls(); } - +void SvxBorderTabPage::SetTableMode() +{ + nSWMode = SW_BORDER_MODE_TABLE; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 69fb4e33a5d8..86c4f95649d4 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -738,7 +738,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) ); - MergeAttrFromSelectedCells(aNewAttr, false); + MergeAttrFromSelectedCells(aNewAttr, true); FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem ); aNewAttr.Put( aBoxItem ); aNewAttr.Put( aBoxInfoItem );