summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-10-29 17:26:57 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-02 09:25:01 +0000
commitf013d4a1f4073cda735befd6e446bee35f3db65c (patch)
treea728faa86c2e114c7abb6db9161e0c7d002ce1d6
parent9937b8daa7c6b8012d9ce4f936e239d87f34a0d1 (diff)
tdf#41542 PaddingWithoutBorders: allow UI changes if...
If the compatibility option is set, allow the border dialog for frames to be able to adjust the spacing values without enabling the border lines. That means it is only true for .doc and .docx right now. Change-Id: I4004a849f7369c993089d1c7b5d856cbea4f7780 Reviewed-on: https://gerrit.libreoffice.org/28602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--cui/source/inc/border.hxx1
-rw-r--r--cui/source/tabpages/border.cxx19
-rw-r--r--include/svx/svxids.hrc2
-rw-r--r--sw/source/uibase/shells/frmsh.cxx4
4 files changed, 19 insertions, 7 deletions
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index c32dba59e174..9675b1029a94 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -111,6 +111,7 @@ private:
bool mbTLBREnabled; ///< true = Top-left to bottom-right border enabled.
bool mbBLTREnabled; ///< true = Bottom-left to top-right border enabled.
bool mbUseMarginItem;
+ bool mbAllowPaddingWithoutBorders;
bool mbSync;
bool mbRemoveAdjacentCellBorders;
bool bIsCalcDoc;
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 05c8914abc5c..d74ae35b723a 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -102,6 +102,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
mbTLBREnabled( false ),
mbBLTREnabled( false ),
mbUseMarginItem( false ),
+ mbAllowPaddingWithoutBorders( false ),
mbSync(true),
mbRemoveAdjacentCellBorders( false ),
bIsCalcDoc( false )
@@ -180,6 +181,11 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
m_pLineWidthMF->SetValue(p->GetValue());
}
+ if (rCoreAttrs.HasItem(SID_ALLOW_PADDING_WITHOUT_BORDERS, &pItem))
+ {
+ mbAllowPaddingWithoutBorders = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+ }
+
// set metric
FieldUnit eFUnit = GetModuleFieldUnit( rCoreAttrs );
@@ -698,10 +704,11 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
if( !m_pLeftMF->GetText().isEmpty() || !m_pRightMF->GetText().isEmpty() ||
!m_pTopMF->GetText().isEmpty() || !m_pBottomMF->GetText().isEmpty() )
{
- if ( ((mbHorEnabled || mbVerEnabled || (nSWMode & SwBorderModes::TABLE)) &&
- (m_pLeftMF->IsModified()||m_pRightMF->IsModified()||
- m_pTopMF->IsModified()||m_pBottomMF->IsModified()) )||
- m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Top ) != svx::FrameBorderState::Hide
+ if ( mbAllowPaddingWithoutBorders
+ || ((mbHorEnabled || mbVerEnabled || (nSWMode & SwBorderModes::TABLE)) &&
+ (m_pLeftMF->IsModified()||m_pRightMF->IsModified()||
+ m_pTopMF->IsModified()||m_pBottomMF->IsModified()) )
+ || m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Top ) != svx::FrameBorderState::Hide
|| m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Bottom ) != svx::FrameBorderState::Hide
|| m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Left ) != svx::FrameBorderState::Hide
|| m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Right ) != svx::FrameBorderState::Hide )
@@ -1156,7 +1163,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void)
m_pRightMF->SetFirst(0);
m_pTopMF->SetFirst(0);
m_pBottomMF->SetFirst(0);
- if(!bSpaceModified)
+ if(!bSpaceModified && !mbAllowPaddingWithoutBorders)
{
m_pLeftMF->SetValue(0);
m_pRightMF->SetValue(0);
@@ -1168,7 +1175,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void)
SvxBoxInfoItemValidFlags nValid = SvxBoxInfoItemValidFlags::TOP|SvxBoxInfoItemValidFlags::BOTTOM|SvxBoxInfoItemValidFlags::LEFT|SvxBoxInfoItemValidFlags::RIGHT;
// for other objects (paragraph, page, frame, character) the edit is disabled, if there's no border set
- if(!(nSWMode & SwBorderModes::TABLE))
+ if(!(nSWMode & SwBorderModes::TABLE) && !mbAllowPaddingWithoutBorders)
{
if(bLineSet)
{
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index b3fa887dc087..f2a301c63797 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -964,7 +964,7 @@
#define FN_SVX_SET_NUMBER ( SID_SVX_START + 1136 )
#define FN_SVX_SET_BULLET ( SID_SVX_START + 1137 )
#define FN_SVX_SET_OUTLINE ( SID_SVX_START + 1138 )
-
+#define SID_ALLOW_PADDING_WITHOUT_BORDERS ( SID_SVX_START + 1139 )
#define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 )
#define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 )
// 1142 is used by editeng (SID_ATTR_CHAR_GRABBAG)
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 6406fcada123..d1eb5f0b56dc 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -405,6 +405,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179
SID_HTML_MODE, SID_HTML_MODE, // [10414
+ SID_ALLOW_PADDING_WITHOUT_BORDERS, SID_ALLOW_PADDING_WITHOUT_BORDERS, // [11139
FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032
FN_SURROUND, FN_HORI_ORIENT, // [21303
FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306
@@ -456,6 +457,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
aSet.Put( SfxBoolItem( FN_OLE_IS_MATH, xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) );
+ aSet.Put( SfxBoolItem( SID_ALLOW_PADDING_WITHOUT_BORDERS,
+ rSh.GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::ALLOW_PADDING_WITHOUT_BORDERS) ) );
+
OString sDefPage;
if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, false, &pItem) == SfxItemState::SET)
sDefPage = OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);