Kaydet (Commit) 440e2031 authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Andras Timar

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
(cherry picked from commit b1d8df61)
Signed-off-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst efec628c
...@@ -38,7 +38,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* p ...@@ -38,7 +38,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* p
{ {
AddTabPage("name", RID_SVXPAGE_CHAR_NAME); AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); 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); m_nAreaPageId = AddTabPage("area", RID_SVXPAGE_AREA);
} }
...@@ -57,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ...@@ -57,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
rAreaPage.Construct(); rAreaPage.Construct();
rAreaPage.ActivatePage( mrOutAttrs ); rAreaPage.ActivatePage( mrOutAttrs );
} }
else if (nId == m_nBorderPageId)
{
SvxBorderTabPage& rBorderPage = ((SvxBorderTabPage&)rPage);
rBorderPage.SetTableMode();
}
else else
SfxTabDialog::PageCreated( nId, rPage ); SfxTabDialog::PageCreated( nId, rPage );
} }
......
...@@ -52,6 +52,7 @@ public: ...@@ -52,6 +52,7 @@ public:
void HideShadowControls(); void HideShadowControls();
virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
void SetTableMode();
protected: protected:
virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
......
...@@ -36,6 +36,7 @@ private: ...@@ -36,6 +36,7 @@ private:
XBitmapListRef mpBitmapList; XBitmapListRef mpBitmapList;
sal_uInt16 m_nAreaPageId; sal_uInt16 m_nAreaPageId;
sal_uInt16 m_nBorderPageId;
protected: protected:
virtual void Apply(); virtual void Apply();
......
...@@ -1219,6 +1219,9 @@ void SvxBorderTabPage::PageCreated(const SfxAllItemSet& aSet) ...@@ -1219,6 +1219,9 @@ void SvxBorderTabPage::PageCreated(const SfxAllItemSet& aSet)
HideShadowControls(); HideShadowControls();
} }
void SvxBorderTabPage::SetTableMode()
{
nSWMode = SW_BORDER_MODE_TABLE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -738,7 +738,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) ...@@ -738,7 +738,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq )
SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) ); SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) );
MergeAttrFromSelectedCells(aNewAttr, false); MergeAttrFromSelectedCells(aNewAttr, true);
FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem ); FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem );
aNewAttr.Put( aBoxItem ); aNewAttr.Put( aBoxItem );
aNewAttr.Put( aBoxInfoItem ); aNewAttr.Put( aBoxInfoItem );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment