[Libreoffice-commits] core.git: 2 commits - cui/source sc/inc sc/qa sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 11 16:10:02 UTC 2019


 cui/source/tabpages/align.cxx                 |   14 ++++++-
 sc/inc/attrib.hxx                             |   24 +++++++++++++
 sc/inc/globstr.hrc                            |    4 ++
 sc/inc/scitems.hxx                            |    8 ++--
 sc/qa/extras/anchor.cxx                       |    2 -
 sc/source/core/data/attrib.cxx                |   46 ++++++++++++++++++++++++--
 sc/source/core/data/column2.cxx               |    2 -
 sc/source/core/data/docpool.cxx               |    4 +-
 sc/source/core/data/patattr.cxx               |    2 -
 sc/source/core/tool/autoform.cxx              |    6 +--
 sc/source/filter/excel/xistyle.cxx            |    2 -
 sc/source/filter/html/htmlpars.cxx            |    3 +
 sc/source/filter/oox/stylesbuffer.cxx         |    2 -
 sc/source/filter/qpro/qprostyle.cxx           |    4 +-
 sc/source/ui/Accessibility/AccessibleText.cxx |    2 -
 sc/source/ui/app/inputhdl.cxx                 |    1 
 sc/source/ui/view/formatsh.cxx                |    2 -
 sc/source/ui/view/output2.cxx                 |    2 -
 18 files changed, 106 insertions(+), 24 deletions(-)

New commits:
commit cfbac86a0423c552a042ae7b9702c0904d4e232a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 10 20:03:38 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 11 17:09:01 2019 +0100

    Related: tdf#129300 add ScHyphenateCell to provide a description
    
    Change-Id: If00a50a36cf2bb5c9b775a4ca1000af5c5be7bf4
    Reviewed-on: https://gerrit.libreoffice.org/84892
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 1994a7e8699c..ead7d7d4f014 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -298,7 +298,12 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
 
     if (m_xBtnHyphen->get_state_changed_from_saved())
     {
-        rSet->Put(SfxBoolItem(GetWhich(SID_ATTR_ALIGN_HYPHENATION), m_xBtnHyphen->get_active()));
+        const SfxBoolItem* pHyphItem = static_cast<const SfxBoolItem*>(GetOldItem(
+                                            *rSet, SID_ATTR_ALIGN_HYPHENATION));
+        assert(pHyphItem);
+        std::unique_ptr<SfxBoolItem> pNewHyphItem(static_cast<SfxBoolItem*>(pHyphItem->Clone()));
+        pNewHyphItem->SetValue(m_xBtnHyphen->get_active());
+        rSet->Put(*pNewHyphItem);
         bChanged = true;
     }
 
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index 100766e3afa9..59be64fb243d 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -333,6 +333,18 @@ public:
                                  const IntlWrapper& rIntl) const override;
 };
 
+class SC_DLLPUBLIC ScHyphenateCell final : public SfxBoolItem
+{
+public:
+    ScHyphenateCell(bool bHyphenate= false);
+    virtual ScHyphenateCell* Clone(SfxItemPool *pPool = nullptr) const override;
+    virtual bool GetPresentation(SfxItemPresentation ePres,
+                                 MapUnit eCoreMetric,
+                                 MapUnit ePresMetric,
+                                 OUString &rText,
+                                 const IntlWrapper& rIntl) const override;
+};
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 518d033814ee..4f13865ca778 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -521,6 +521,8 @@
 #define STR_VERTICALSTACKCELL_OFF               NC_("STR_VERTICALSTACKCELL_OFF", "Vertically stacked: Off")
 #define STR_LINEBREAKCELL_ON                    NC_("STR_LINEBREAKCELL_ON", "Wrap text automatically: On")
 #define STR_LINEBREAKCELL_OFF                   NC_("STR_LINEBREAKCELL_OFF", "Wrap text automatically: Off")
+#define STR_HYPHENATECELL_ON                    NC_("STR_HYPHENATECELL_ON", "Hyphenate: On")
+#define STR_HYPHENATECELL_OFF                   NC_("STR_HYPHENATECELL_OFF", "Hyphenate: Off")
 
 #endif
 
diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index ce40a2c4a267..674bf07fa3e9 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -111,7 +111,7 @@ class SvxSizeItem;
 #define ATTR_USERDEF            TypedWhichId<SvXMLAttrContainerItem>(122)    // not saved in binary files
 #define ATTR_FONT_WORDLINE      TypedWhichId<SvxWordLineModeItem>(123)
 #define ATTR_FONT_RELIEF        TypedWhichId<SvxCharReliefItem>(124)
-#define ATTR_HYPHENATE          TypedWhichId<SfxBoolItem>(125)
+#define ATTR_HYPHENATE          TypedWhichId<ScHyphenateCell>(125)
 #define ATTR_SCRIPTSPACE        TypedWhichId<SvxScriptSpaceItem>(126)
 #define ATTR_HANGPUNCTUATION    TypedWhichId<SvxHangingPunctuationItem>(127)
 #define ATTR_FORBIDDEN_RULES    TypedWhichId<SvxForbiddenRuleItem>(128)
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 75337c00f75d..4ed61887a67a 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -808,4 +808,24 @@ bool ScLineBreakCell::GetPresentation(SfxItemPresentation,
     return true;
 }
 
+ScHyphenateCell::ScHyphenateCell(bool bHyphenate)
+    : SfxBoolItem(ATTR_HYPHENATE, bHyphenate)
+{
+}
+
+ScHyphenateCell* ScHyphenateCell::Clone(SfxItemPool*) const
+{
+    return new ScHyphenateCell(GetValue());
+}
+
+bool ScHyphenateCell::GetPresentation(SfxItemPresentation,
+                                      MapUnit, MapUnit,
+                                      OUString& rText,
+                                      const IntlWrapper&) const
+{
+    const char* pId = GetValue() ? STR_HYPHENATECELL_ON : STR_HYPHENATECELL_OFF;
+    rText = ScResId(pId);
+    return true;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 2df0bfcb9878..148438da76a9 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -240,7 +240,7 @@ ScDocumentPool::ScDocumentPool()
     mvPoolDefaults[ ATTR_USERDEF         - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF );
     mvPoolDefaults[ ATTR_FONT_WORDLINE   - ATTR_STARTINDEX ] = new SvxWordLineModeItem(false, ATTR_FONT_WORDLINE );
     mvPoolDefaults[ ATTR_FONT_RELIEF     - ATTR_STARTINDEX ] = new SvxCharReliefItem( FontRelief::NONE, ATTR_FONT_RELIEF );
-    mvPoolDefaults[ ATTR_HYPHENATE       - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE );
+    mvPoolDefaults[ ATTR_HYPHENATE       - ATTR_STARTINDEX ] = new ScHyphenateCell();
     mvPoolDefaults[ ATTR_SCRIPTSPACE     - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( false, ATTR_SCRIPTSPACE);
     mvPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( false, ATTR_HANGPUNCTUATION);
     mvPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES);
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 996afb8e5f38..d7fc012873ae 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -663,7 +663,7 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r
 
         if ( pCondSet->GetItemState( ATTR_HYPHENATE, true, &pItem ) != SfxItemState::SET )
             pItem = &rSrcSet.Get( ATTR_HYPHENATE );
-        bHyphenate = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+        bHyphenate = static_cast<const ScHyphenateCell*>(pItem)->GetValue();
 
         if ( pCondSet->GetItemState( ATTR_WRITINGDIR, true, &pItem ) != SfxItemState::SET )
             pItem = &rSrcSet.Get( ATTR_WRITINGDIR );
commit 331cafb1484597544bd94fa3f0e0a45b3328a4d8
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 10 16:38:48 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 11 17:08:16 2019 +0100

    Related: tdf#129300 add ScLineBreakCell to provide a description
    
    Change-Id: Ief739616163c68e0e30d6287fdac90c1bcc9d13f
    Reviewed-on: https://gerrit.libreoffice.org/84879
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 9238ff52f11f..1994a7e8699c 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -287,7 +287,12 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
 
     if (m_xBtnWrap->get_state_changed_from_saved())
     {
-        rSet->Put(SfxBoolItem(GetWhich(SID_ATTR_ALIGN_LINEBREAK), m_xBtnWrap->get_active()));
+        const SfxBoolItem* pWrapItem = static_cast<const SfxBoolItem*>(GetOldItem(
+                                            *rSet, SID_ATTR_ALIGN_LINEBREAK));
+        assert(pWrapItem);
+        std::unique_ptr<SfxBoolItem> pNewWrapItem(static_cast<SfxBoolItem*>(pWrapItem->Clone()));
+        pNewWrapItem->SetValue(m_xBtnWrap->get_active());
+        rSet->Put(*pNewWrapItem);
         bChanged = true;
     }
 
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index 9b6a6b956320..100766e3afa9 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -321,6 +321,18 @@ public:
                                  const IntlWrapper& rIntl) const override;
 };
 
+class SC_DLLPUBLIC ScLineBreakCell final : public SfxBoolItem
+{
+public:
+    ScLineBreakCell(bool bLineBreak = false);
+    virtual ScLineBreakCell* Clone(SfxItemPool *pPool = nullptr) const override;
+    virtual bool GetPresentation(SfxItemPresentation ePres,
+                                 MapUnit eCoreMetric,
+                                 MapUnit ePresMetric,
+                                 OUString &rText,
+                                 const IntlWrapper& rIntl) const override;
+};
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index ceedfbebcd35..518d033814ee 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -519,6 +519,8 @@
 #define STR_SHRINKTOFITCELL_OFF                 NC_("STR_SHRINKTOFITCELL_OFF", "Shrink to fit cell: Off")
 #define STR_VERTICALSTACKCELL_ON                NC_("STR_VERTICALSTACKCELL_ON", "Vertically stacked: On")
 #define STR_VERTICALSTACKCELL_OFF               NC_("STR_VERTICALSTACKCELL_OFF", "Vertically stacked: Off")
+#define STR_LINEBREAKCELL_ON                    NC_("STR_LINEBREAKCELL_ON", "Wrap text automatically: On")
+#define STR_LINEBREAKCELL_OFF                   NC_("STR_LINEBREAKCELL_OFF", "Wrap text automatically: Off")
 
 #endif
 
diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index 9093d54039c5..ce40a2c4a267 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -50,7 +50,9 @@ class SvxVerJustifyItem;
 class SvxBrushItem;
 class SvxBoxItem;
 class ScCondFormatItem;
+class ScLineBreakCell;
 class ScRotateValueItem;
+class ScShrinkToFitCell;
 class SvxLineItem;
 class SvxRotateModeItem;
 class SfxStringItem;
@@ -118,12 +120,12 @@ class SvxSizeItem;
 #define ATTR_INDENT             TypedWhichId<SfxUInt16Item>(131)
 #define ATTR_VER_JUSTIFY        TypedWhichId<SvxVerJustifyItem>(132)
 #define ATTR_VER_JUSTIFY_METHOD TypedWhichId<SvxJustifyMethodItem>(133)
-#define ATTR_STACKED            TypedWhichId<SfxBoolItem>(134)
+#define ATTR_STACKED            TypedWhichId<ScShrinkToFitCell>(134)
 #define ATTR_ROTATE_VALUE       TypedWhichId<ScRotateValueItem>(135)
 #define ATTR_ROTATE_MODE        TypedWhichId<SvxRotateModeItem>(136)
 #define ATTR_VERTICAL_ASIAN     TypedWhichId<SfxBoolItem>(137)
 #define ATTR_WRITINGDIR         TypedWhichId<SvxFrameDirectionItem>(138)
-#define ATTR_LINEBREAK          TypedWhichId<SfxBoolItem>(139)
+#define ATTR_LINEBREAK          TypedWhichId<ScLineBreakCell>(139)
 #define ATTR_SHRINKTOFIT        TypedWhichId<SfxBoolItem>(140)
 #define ATTR_BORDER_TLBR        TypedWhichId<SvxLineItem>(141)
 #define ATTR_BORDER_BLTR        TypedWhichId<SvxLineItem>(142)
diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx
index 5d759afa9293..70f8761ce243 100644
--- a/sc/qa/extras/anchor.cxx
+++ b/sc/qa/extras/anchor.cxx
@@ -177,7 +177,7 @@ void ScAnchorTest::testTdf76183()
     const tools::Rectangle& rNewRect = pObj->GetLogicRect();
 
     // Set word wrap to true
-    rDoc.ApplyAttr(0, 0, 0, SfxBoolItem(ATTR_LINEBREAK, true));
+    rDoc.ApplyAttr(0, 0, 0, ScLineBreakCell(true));
     // Add multi-line text to cell to initiate optimal height change
     uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, uno::UNO_QUERY_THROW);
     uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), uno::UNO_QUERY_THROW);
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 24d1a0901a26..75337c00f75d 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -779,13 +779,33 @@ ScVerticalStackCell* ScVerticalStackCell::Clone(SfxItemPool*) const
 }
 
 bool ScVerticalStackCell::GetPresentation(SfxItemPresentation,
-                                        MapUnit, MapUnit,
-                                        OUString& rText,
-                                        const IntlWrapper&) const
+                                          MapUnit, MapUnit,
+                                          OUString& rText,
+                                          const IntlWrapper&) const
 {
     const char* pId = GetValue() ? STR_VERTICALSTACKCELL_ON : STR_VERTICALSTACKCELL_OFF;
     rText = ScResId(pId);
     return true;
 }
 
+ScLineBreakCell::ScLineBreakCell(bool bStack)
+    : SfxBoolItem(ATTR_LINEBREAK, bStack)
+{
+}
+
+ScLineBreakCell* ScLineBreakCell::Clone(SfxItemPool*) const
+{
+    return new ScLineBreakCell(GetValue());
+}
+
+bool ScLineBreakCell::GetPresentation(SfxItemPresentation,
+                                      MapUnit, MapUnit,
+                                      OUString& rText,
+                                      const IntlWrapper&) const
+{
+    const char* pId = GetValue() ? STR_LINEBREAKCELL_ON : STR_LINEBREAKCELL_OFF;
+    rText = ScResId(pId);
+    return true;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 00d978fddc8f..6120e719271f 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -145,7 +145,7 @@ long ScColumn::GetNeededSize(
         bBreak = true;
     else if ( pCondSet &&
                 pCondSet->GetItemState(ATTR_LINEBREAK, true, &pCondItem) == SfxItemState::SET)
-        bBreak = static_cast<const SfxBoolItem*>(pCondItem)->GetValue();
+        bBreak = static_cast<const ScLineBreakCell*>(pCondItem)->GetValue();
     else
         bBreak = pPattern->GetItem(ATTR_LINEBREAK).GetValue();
 
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index e379f75b1d16..2df0bfcb9878 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -257,7 +257,7 @@ ScDocumentPool::ScDocumentPool()
     //  so that value is returned when asking for a default cell's attributes.
     //  The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
     mvPoolDefaults[ ATTR_WRITINGDIR      - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( SvxFrameDirection::Environment, ATTR_WRITINGDIR );
-    mvPoolDefaults[ ATTR_LINEBREAK       - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
+    mvPoolDefaults[ ATTR_LINEBREAK       - ATTR_STARTINDEX ] = new ScLineBreakCell();
     mvPoolDefaults[ ATTR_SHRINKTOFIT     - ATTR_STARTINDEX ] = new ScShrinkToFitCell();
     mvPoolDefaults[ ATTR_BORDER_TLBR     - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
     mvPoolDefaults[ ATTR_BORDER_BLTR     - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR );
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index d5f290ecff84..ff6c8e4926f4 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -193,9 +193,9 @@ ScAutoFormatDataField::ScAutoFormatDataField()
     m_aAdjust = std::make_unique<SvxAdjustItem>(SvxAdjust::Left, 0);
     m_aHorJustify = std::make_unique<SvxHorJustifyItem>(SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY);
     m_aVerJustify = std::make_unique<SvxVerJustifyItem>(SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY);
-    m_aStacked = std::make_unique<SfxBoolItem>();
+    m_aStacked = std::make_unique<ScVerticalStackCell>();
     m_aMargin = std::make_unique<SvxMarginItem>(ATTR_MARGIN);
-    m_aLinebreak = std::make_unique<SfxBoolItem>(ATTR_LINEBREAK);
+    m_aLinebreak = std::make_unique<ScLineBreakCell>();
     m_aRotateAngle = std::make_unique<ScRotateValueItem>(0);
     m_aRotateMode = std::make_unique<SvxRotateModeItem>(SVX_ROTATE_MODE_STANDARD, ATTR_ROTATE_MODE);
 }
@@ -371,7 +371,7 @@ void ScAutoFormatData::PutItem( sal_uInt16 nIndex, const SfxPoolItem& rItem )
         case ATTR_VER_JUSTIFY:      rField.SetVerJustify( static_cast<const SvxVerJustifyItem&>(rItem) );  break;
         case ATTR_STACKED:          rField.SetStacked( static_cast<const ScVerticalStackCell&>(rItem) );   break;
         case ATTR_MARGIN:           rField.SetMargin( static_cast<const SvxMarginItem&>(rItem) );          break;
-        case ATTR_LINEBREAK:        rField.SetLinebreak( static_cast<const SfxBoolItem&>(rItem) );         break;
+        case ATTR_LINEBREAK:        rField.SetLinebreak( static_cast<const ScLineBreakCell&>(rItem) );         break;
         case ATTR_ROTATE_VALUE:     rField.SetRotateAngle( static_cast<const ScRotateValueItem&>(rItem) ); break;
         case ATTR_ROTATE_MODE:      rField.SetRotateMode( static_cast<const SvxRotateModeItem&>(rItem) );  break;
     }
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 00320dd2c3a6..89c5406629f3 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -814,7 +814,7 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
 
     // text wrap (#i74508# always if vertical alignment is justified or distributed)
     bool bLineBreak = mbLineBreak || (mnVerAlign == EXC_XF_VER_JUSTIFY) || (mnVerAlign == EXC_XF_VER_DISTRIB);
-    ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_LINEBREAK, bLineBreak ), bSkipPoolDefs );
+    ScfTools::PutItem( rItemSet, ScLineBreakCell( bLineBreak ), bSkipPoolDefs );
 
     // vertical alignment
     ScfTools::PutItem( rItemSet, SvxVerJustifyItem( GetScVerAlign(), ATTR_VER_JUSTIFY ), bSkipPoolDefs );
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index e8d08194f215..a45f497c5e56 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -51,6 +51,7 @@
 
 #include <rtl/tencinfo.h>
 
+#include <attrib.hxx>
 #include <htmlpars.hxx>
 #include <global.hxx>
 #include <document.hxx>
@@ -831,7 +832,7 @@ void ScHTMLLayoutParser::CloseEntry( const HtmlImportInfo* pInfo )
         rSel.nEndPara = rSel.nStartPara;
     }
     if ( rSel.HasRange() )
-        mxActEntry->aItemSet.Put( SfxBoolItem( ATTR_LINEBREAK, true ) );
+        mxActEntry->aItemSet.Put( ScLineBreakCell(true) );
     maList.push_back(mxActEntry);
     NewActEntry(mxActEntry.get()); // New free flying mxActEntry
 }
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 378ae7c2dcf1..f373f0a1a175 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1301,7 +1301,7 @@ void Alignment::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
     // indent
     ScfTools::PutItem( rItemSet, SfxUInt16Item( ATTR_INDENT, maApiData.mnIndent ), bSkipPoolDefs );
     // line wrap
-    ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_LINEBREAK, maApiData.mbWrapText ), bSkipPoolDefs );
+    ScfTools::PutItem( rItemSet, ScLineBreakCell( maApiData.mbWrapText ), bSkipPoolDefs );
     ScfTools::PutItem( rItemSet, ScShrinkToFitCell( maApiData.mbShrink ), bSkipPoolDefs );
 }
 
diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx
index af6628162e9a..00938af0b757 100644
--- a/sc/source/filter/qpro/qprostyle.cxx
+++ b/sc/source/filter/qpro/qprostyle.cxx
@@ -30,6 +30,7 @@
 #include <editeng/fontitem.hxx>
 #include <editeng/justifyitem.hxx>
 
+#include <attrib.hxx>
 #include <global.hxx>
 #include <docpool.hxx>
 #include <patattr.hxx>
@@ -107,8 +108,7 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow,
     // Wrap cell contents
     if( nTmp & 0x80 )
     {
-        SfxBoolItem aWrapItem( ATTR_LINEBREAK );
-        aWrapItem.SetValue( true );
+        ScLineBreakCell aWrapItem(true);
         rItemSet.Put( aWrapItem );
     }
 
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 540e9ac39a5d..e0a7b72a0cc1 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -545,7 +545,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
         else
         {
             // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
-            const SfxBoolItem* pLineBreakItem = rDoc.GetAttr( aCellPos, ATTR_LINEBREAK );
+            const ScLineBreakCell* pLineBreakItem = rDoc.GetAttr( aCellPos, ATTR_LINEBREAK );
             bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() );
             if ( !bLineBreak )
             {
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9e9008f5c111..4c8f4fa9153d 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -59,6 +59,7 @@
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <comphelper/lok.hxx>
 
+#include <attrib.hxx>
 #include <inputwin.hxx>
 #include <tabvwsh.hxx>
 #include <docsh.hxx>
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 28fe4e829ee2..379761bfcaf0 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1710,7 +1710,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                 {
                     const ScPatternAttr* pAttrs = pTabViewShell->GetSelectionPattern();
                     bool bOld = pAttrs->GetItem(ATTR_LINEBREAK).GetValue();
-                    SfxBoolItem aBreakItem( ATTR_LINEBREAK, !bOld );
+                    ScLineBreakCell aBreakItem(!bOld);
                     pTabViewShell->ApplyAttr( aBreakItem );
 
                     SfxAllItemSet aNewSet( GetPool() );
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8f5b72329277..8a057dcfd5f1 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1646,7 +1646,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
                         // Disable line break when the cell content is numeric.
                         aAltPatterns.push_back(std::make_unique<ScPatternAttr>(*pPattern));
                         ScPatternAttr* pAltPattern = aAltPatterns.back().get();
-                        SfxBoolItem aLineBreak(ATTR_LINEBREAK, false);
+                        ScLineBreakCell aLineBreak(false);
                         pAltPattern->GetItemSet().Put(aLineBreak);
                         pPattern = pAltPattern;
                     }


More information about the Libreoffice-commits mailing list