[Libreoffice-commits] core.git: cui/source include/svx sw/source

Justin Luth justin_luth at sil.org
Wed Nov 2 09:25:28 UTC 2016


 cui/source/inc/border.hxx         |    1 +
 cui/source/tabpages/border.cxx    |   19 +++++++++++++------
 include/svx/svxids.hrc            |    2 +-
 sw/source/uibase/shells/frmsh.cxx |    4 ++++
 4 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit f013d4a1f4073cda735befd6e446bee35f3db65c
Author: Justin Luth <justin_luth at sil.org>
Date:   Sat Oct 29 17:26:57 2016 +0300

    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 at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index c32dba5..9675b10 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 05c8914..d74ae35 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 b3fa887..f2a301c 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 6406fca..d1eb5f0 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);


More information about the Libreoffice-commits mailing list