editeng/source/uno/unotext.cxx                              |   27 +-
 include/editeng/colritem.hxx                                |    4 
 include/xmloff/xmltoken.hxx                                 |    2 
 include/xmloff/xmltypes.hxx                                 |    1 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   10 
 sw/source/uibase/frmdlg/colex.cxx                           |   46 +--
 sw/source/uibase/frmdlg/colmgr.cxx                          |   46 +--
 sw/source/uibase/inc/colex.hxx                              |    8 
 sw/source/uibase/inc/colmgr.hxx                             |   26 +-
 sw/source/uibase/inc/toxmgr.hxx                             |   12 
 sw/source/uibase/index/toxmgr.cxx                           |  156 ++++++------
 xmloff/qa/unit/data/refer-to-theme.odp                      |binary
 xmloff/qa/unit/draw.cxx                                     |   17 +
 xmloff/source/core/xmltoken.cxx                             |    2 
 xmloff/source/style/prhdlfac.cxx                            |    3 
 xmloff/source/style/xmlbahdl.cxx                            |   30 ++
 xmloff/source/style/xmlbahdl.hxx                            |    9 
 xmloff/source/text/txtprmap.cxx                             |    4 
 xmloff/source/token/tokens.txt                              |    2 
 19 files changed, 253 insertions(+), 152 deletions(-)

New commits:
commit ad7efe4c336dc4c4883cfc3fa74bb4951b92767c
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon Dec 13 08:21:24 2021 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Dec 13 10:10:22 2021 +0100

    sw: prefix members of SwColExample, SwColMgr, SwPageGridExample and ...
    
    ... SwTOXMgr
    
    See tdf#94879 for motivation.
    
    Change-Id: I98968dd8119f005b96eb273c016e7ab3e006a4fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126721
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/frmdlg/colex.cxx 
b/sw/source/uibase/frmdlg/colex.cxx
index 822434d96970..d1fb2bd9c952 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -190,9 +190,9 @@ void SwColExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point& rOr
                             const bool bSecond, const bool bEnabled)
 {
     SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
-    if (!pColMgr)
+    if (!m_pColMgr)
         return;
-    sal_uInt16 nColumnCount = pColMgr->GetCount();
+    sal_uInt16 nColumnCount = m_pColMgr->GetCount();
     if (!nColumnCount)
         return;
 
@@ -229,20 +229,20 @@ void SwColExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point& rOr
     }
 
     // #97495# make sure that the automatic column width's are always equal
-    bool bAutoWidth = pColMgr->IsAutoWidth();
+    bool bAutoWidth = m_pColMgr->IsAutoWidth();
     sal_Int32 nAutoColWidth = 0;
     if (bAutoWidth)
     {
         sal_Int32 nColumnWidthSum = 0;
         for (sal_uInt16 i = 0; i < nColumnCount; ++i)
-            nColumnWidthSum += pColMgr->GetColWidth( i );
+            nColumnWidthSum += m_pColMgr->GetColWidth( i );
         nAutoColWidth = nColumnWidthSum / nColumnCount;
     }
 
     for (sal_uInt16 i = 0; i < nColumnCount; ++i)
     {
         if (!bAutoWidth)
-            nAutoColWidth = pColMgr->GetColWidth(i);
+            nAutoColWidth = m_pColMgr->GetColWidth(i);
 
         if (!m_bVertical)
             aRect.SetRight( aRect.Left() + nAutoColWidth );
@@ -255,23 +255,23 @@ void SwColExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point& rOr
         if (i < nColumnCount - 1)
         {
             if (!m_bVertical)
-                aRect.SetLeft( aRect.Right() + pColMgr->GetGutterWidth(i) );
+                aRect.SetLeft( aRect.Right() + m_pColMgr->GetGutterWidth(i) );
             else
-                aRect.SetTop( aRect.Bottom() + pColMgr->GetGutterWidth(i) );
+                aRect.SetTop( aRect.Bottom() + m_pColMgr->GetGutterWidth(i) );
         }
     }
-    if (!pColMgr->HasLine())
+    if (!m_pColMgr->HasLine())
         return;
 
     Point aUp(rOrg.X() + nL, rOrg.Y() + GetTop());
     Point aDown(rOrg.X() + nL,
                     rOrg.Y() + GetSize().Height() - GetBottom() - 
GetFtHeight() - GetFtDist());
 
-    if (pColMgr->GetLineHeightPercent() != 100)
+    if (m_pColMgr->GetLineHeightPercent() != 100)
     {
         tools::Long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - 
aUp.X();
-        nLength -= nLength * pColMgr->GetLineHeightPercent() / 100;
-        switch (pColMgr->GetAdjust())
+        nLength -= nLength * m_pColMgr->GetLineHeightPercent() / 100;
+        switch (m_pColMgr->GetAdjust())
         {
             case COLADJ_BOTTOM:
                 if (!m_bVertical)
@@ -304,8 +304,8 @@ void SwColExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point& rOr
 
     for (sal_uInt16 i = 0; i < nColumnCount -  1; ++i)
     {
-        int nGutter = pColMgr->GetGutterWidth(i);
-        int nDist = pColMgr->GetColWidth( i ) + nGutter;
+        int nGutter = m_pColMgr->GetGutterWidth(i);
+        int nDist = m_pColMgr->GetColWidth( i ) + nGutter;
         nDist -= (i == 0) ? nGutter / 2 : 0;
         if (!m_bVertical)
         {
@@ -500,11 +500,11 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point
 {
     SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
 
-    if (!pGridItem || !pGridItem->GetGridType())
+    if (!m_pGridItem || !m_pGridItem->GetGridType())
         return;
 
     //paint the grid now
-    Color aLineColor = pGridItem->GetColor();
+    Color aLineColor = m_pGridItem->GetColor();
     if (aLineColor == COL_AUTO)
     {
         aLineColor = rRenderContext.GetFillColor();
@@ -528,8 +528,8 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point
     aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - 
GetFtHeight() - GetFtDist() );
 
     //increase the values to get a 'viewable' preview
-    sal_Int32 nBaseHeight = pGridItem->GetBaseHeight() * 3;
-    sal_Int32 nRubyHeight = pGridItem->GetRubyHeight() * 3;
+    sal_Int32 nBaseHeight = m_pGridItem->GetBaseHeight() * 3;
+    sal_Int32 nRubyHeight = m_pGridItem->GetRubyHeight() * 3;
 
     //detect height of rectangles
     tools::Rectangle aRubyRect(aRect.TopLeft(),
@@ -545,8 +545,8 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point
 
     //detect count of rectangles
     sal_Int32 nLines = (m_bVertical ? aRect.GetWidth(): aRect.GetHeight()) / 
nLineHeight;
-    if (nLines > pGridItem->GetLines())
-        nLines = pGridItem->GetLines();
+    if (nLines > m_pGridItem->GetLines())
+        nLines = m_pGridItem->GetLines();
 
     // determine start position
     if (m_bVertical)
@@ -562,13 +562,13 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point
         aCharRect.Move(0, nYStart);
     }
 
-    if (pGridItem->IsRubyTextBelow())
+    if (m_pGridItem->IsRubyTextBelow())
         m_bVertical ? aRubyRect.Move(nBaseHeight, 0) : aRubyRect.Move(0, 
nBaseHeight);
     else
         m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, 
nRubyHeight);
 
     //vertical lines
-    bool bBothLines = pGridItem->GetGridType() == GRID_LINES_CHARS;
+    bool bBothLines = m_pGridItem->GetGridType() == GRID_LINES_CHARS;
     rRenderContext.SetFillColor(COL_TRANSPARENT);
     sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
     sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
@@ -597,10 +597,10 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& 
rRenderContext, const Point
 
 void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
 {
-    pGridItem.reset();
+    m_pGridItem.reset();
     //get the grid information
     if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID))
-        pGridItem.reset(rSet.Get(RES_TEXTGRID).Clone());
+        m_pGridItem.reset(rSet.Get(RES_TEXTGRID).Clone());
     SwPageExample::UpdateExample(rSet);
 }
 
diff --git a/sw/source/uibase/frmdlg/colmgr.cxx 
b/sw/source/uibase/frmdlg/colmgr.cxx
index 928b01c357e6..692a8395d662 100644
--- a/sw/source/uibase/frmdlg/colmgr.cxx
+++ b/sw/source/uibase/frmdlg/colmgr.cxx
@@ -69,20 +69,20 @@ void FitToActualSize(SwFormatCol& rCol, sal_uInt16 nWidth)
 // set column quantity and Gutterwidth
 void SwColMgr::SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth)
 {
-    aFormatCol.Init(nCount, nGutterWidth, nWidth);
-    aFormatCol.SetWishWidth(nWidth);
-    aFormatCol.SetGutterWidth(nGutterWidth, nWidth);
+    m_aFormatCol.Init(nCount, nGutterWidth, m_nWidth);
+    m_aFormatCol.SetWishWidth(m_nWidth);
+    m_aFormatCol.SetGutterWidth(nGutterWidth, m_nWidth);
 }
 
 sal_uInt16 SwColMgr::GetGutterWidth(sal_uInt16 nPos) const
 {
     sal_uInt16 nRet;
     if (nPos == USHRT_MAX)
-        nRet = GetCount() > 1 ? aFormatCol.GetGutterWidth() : DEF_GUTTER_WIDTH;
+        nRet = GetCount() > 1 ? m_aFormatCol.GetGutterWidth() : 
DEF_GUTTER_WIDTH;
     else
     {
         OSL_ENSURE(nPos < GetCount() - 1, "column overindexed");
-        const SwColumns& rCols = aFormatCol.GetColumns();
+        const SwColumns& rCols = m_aFormatCol.GetColumns();
         nRet = rCols[nPos].GetRight() + rCols[nPos + 1].GetLeft();
     }
     return nRet;
@@ -91,11 +91,11 @@ sal_uInt16 SwColMgr::GetGutterWidth(sal_uInt16 nPos) const
 void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, sal_uInt16 nPos)
 {
     if (nPos == USHRT_MAX)
-        aFormatCol.SetGutterWidth(nGutterWidth, nWidth);
+        m_aFormatCol.SetGutterWidth(nGutterWidth, m_nWidth);
     else
     {
         OSL_ENSURE(nPos < GetCount() - 1, "column overindexed");
-        SwColumns& rCols = aFormatCol.GetColumns();
+        SwColumns& rCols = m_aFormatCol.GetColumns();
         sal_uInt16 nGutterWidth2 = nGutterWidth / 2;
         rCols[nPos].SetRight(nGutterWidth2);
         rCols[nPos + 1].SetLeft(nGutterWidth2);
@@ -105,54 +105,54 @@ void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, 
sal_uInt16 nPos)
 // height separation line
 short SwColMgr::GetLineHeightPercent() const
 {
-    return static_cast<short>(aFormatCol.GetLineHeight());
+    return static_cast<short>(m_aFormatCol.GetLineHeight());
 }
 void SwColMgr::SetLineHeightPercent(short nPercent)
 {
     OSL_ENSURE(nPercent <= 100, "line height may be at most 100%");
-    aFormatCol.SetLineHeight(static_cast<sal_uInt8>(nPercent));
+    m_aFormatCol.SetLineHeight(static_cast<sal_uInt8>(nPercent));
 }
 
 // column width
 sal_uInt16 SwColMgr::GetColWidth(sal_uInt16 nIdx) const
 {
     OSL_ENSURE(nIdx < GetCount(), "Column array overindexed.");
-    return aFormatCol.CalcPrtColWidth(nIdx, nWidth);
+    return m_aFormatCol.CalcPrtColWidth(nIdx, m_nWidth);
 }
 
 void SwColMgr::SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWd)
 {
     OSL_ENSURE(nIdx < GetCount(), "Column array overindexed.");
-    aFormatCol.GetColumns()[nIdx].SetWishWidth(nWd);
+    m_aFormatCol.GetColumns()[nIdx].SetWishWidth(nWd);
 }
 
 // newly set size
 void SwColMgr::SetActualWidth(sal_uInt16 nW)
 {
-    nWidth = nW;
-    ::FitToActualSize(aFormatCol, nW);
+    m_nWidth = nW;
+    ::FitToActualSize(m_aFormatCol, nW);
 }
 
 // ctor
 SwColMgr::SwColMgr(const SfxItemSet& rSet)
-    : aFormatCol(rSet.Get(RES_COL))
+    : m_aFormatCol(rSet.Get(RES_COL))
 {
-    nWidth = o3tl::narrowing<sal_uInt16>(rSet.Get(RES_FRM_SIZE).GetWidth());
-    if (nWidth < MINLAY)
-        nWidth = USHRT_MAX;
+    m_nWidth = o3tl::narrowing<sal_uInt16>(rSet.Get(RES_FRM_SIZE).GetWidth());
+    if (m_nWidth < MINLAY)
+        m_nWidth = USHRT_MAX;
     const SvxLRSpaceItem& rLR = rSet.Get(RES_LR_SPACE);
-    nWidth = nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetLeft());
-    nWidth = nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetRight());
-    ::FitToActualSize(aFormatCol, nWidth);
+    m_nWidth = m_nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetLeft());
+    m_nWidth = m_nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetRight());
+    ::FitToActualSize(m_aFormatCol, m_nWidth);
 }
 
 SwColMgr::~SwColMgr() {}
 
 void SwColMgr::SetLineWidthAndColor(SvxBorderLineStyle eStyle, sal_uLong 
nLWidth, const Color& rCol)
 {
-    aFormatCol.SetLineStyle(eStyle);
-    aFormatCol.SetLineWidth(nLWidth);
-    aFormatCol.SetLineColor(rCol);
+    m_aFormatCol.SetLineStyle(eStyle);
+    m_aFormatCol.SetLineWidth(nLWidth);
+    m_aFormatCol.SetLineColor(rCol);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/colex.hxx b/sw/source/uibase/inc/colex.hxx
index 07c007465da2..2abe4429825e 100644
--- a/sw/source/uibase/inc/colex.hxx
+++ b/sw/source/uibase/inc/colex.hxx
@@ -44,7 +44,7 @@ public:
 
 class SW_DLLPUBLIC SwPageGridExample final : public SwPageExample
 {
-    std::unique_ptr<SwTextGridItem> pGridItem;
+    std::unique_ptr<SwTextGridItem> m_pGridItem;
 
     virtual void DrawPage(vcl::RenderContext& rRenderContext,
                           const Point& rPoint,
@@ -59,7 +59,7 @@ public:
 
 class SW_DLLPUBLIC SwColExample final : public SwPageExample
 {
-    SwColMgr*   pColMgr;
+    SwColMgr*   m_pColMgr;
 
     using SwPageExample::UpdateExample;
 
@@ -70,13 +70,13 @@ class SW_DLLPUBLIC SwColExample final : public SwPageExample
 
 public:
     SwColExample()
-        : pColMgr(nullptr)
+        : m_pColMgr(nullptr)
     {
     }
 
     void UpdateExample( const SfxItemSet& rSet, SwColMgr* pMgr  )
     {
-        pColMgr = pMgr;
+        m_pColMgr = pMgr;
         SwPageExample::UpdateExample(rSet);
     }
 };
diff --git a/sw/source/uibase/inc/colmgr.hxx b/sw/source/uibase/inc/colmgr.hxx
index 928e1dcfa89f..3a4f43ef6fad 100644
--- a/sw/source/uibase/inc/colmgr.hxx
+++ b/sw/source/uibase/inc/colmgr.hxx
@@ -60,56 +60,56 @@ public:
 
     inline void         NoCols();
 
-    const SwFormatCol&  GetColumns() const { return aFormatCol; }
+    const SwFormatCol&  GetColumns() const { return m_aFormatCol; }
 
     void                SetActualWidth(sal_uInt16 nW);
-    sal_uInt16          GetActualSize() const { return nWidth; }
+    sal_uInt16          GetActualSize() const { return m_nWidth; }
 
 private:
-    SwFormatCol             aFormatCol;
-    sal_uInt16              nWidth;
+    SwFormatCol             m_aFormatCol;
+    sal_uInt16              m_nWidth;
 };
 
 inline  sal_uInt16 SwColMgr::GetCount() const
 {
-    return aFormatCol.GetNumCols();
+    return m_aFormatCol.GetNumCols();
 }
 
 inline SvxBorderLineStyle SwColMgr::GetLineStyle() const
 {
-    return aFormatCol.GetLineStyle();
+    return m_aFormatCol.GetLineStyle();
 }
 inline sal_uLong        SwColMgr::GetLineWidth() const
 {
-    return aFormatCol.GetLineWidth();
+    return m_aFormatCol.GetLineWidth();
 }
 
 inline const Color& SwColMgr::GetLineColor() const
 {
-    return aFormatCol.GetLineColor();
+    return m_aFormatCol.GetLineColor();
 }
 
 inline  SwColLineAdj SwColMgr::GetAdjust() const
 {
-    return aFormatCol.GetLineAdj();
+    return m_aFormatCol.GetLineAdj();
 }
 
 inline  void SwColMgr::SetAdjust(SwColLineAdj eAdj)
 {
-    aFormatCol.SetLineAdj(eAdj);
+    m_aFormatCol.SetLineAdj(eAdj);
 }
 inline bool SwColMgr::IsAutoWidth() const
 {
-    return aFormatCol.IsOrtho();
+    return m_aFormatCol.IsOrtho();
 }
 inline void SwColMgr::SetAutoWidth(bool bOn, sal_uInt16 nGutterWidth)
 {
-    aFormatCol.SetOrtho(bOn, nGutterWidth, nWidth);
+    m_aFormatCol.SetOrtho(bOn, nGutterWidth, m_nWidth);
 }
 
 inline void SwColMgr::NoCols()
 {
-    aFormatCol.GetColumns().clear();
+    m_aFormatCol.GetColumns().clear();
 }
 inline bool SwColMgr::HasLine() const
 {
diff --git a/sw/source/uibase/inc/toxmgr.hxx b/sw/source/uibase/inc/toxmgr.hxx
index 057181f6026b..5544a4b860a8 100644
--- a/sw/source/uibase/inc/toxmgr.hxx
+++ b/sw/source/uibase/inc/toxmgr.hxx
@@ -225,9 +225,9 @@ public:
 
 class SW_DLLPUBLIC SwTOXMgr
 {
-    SwWrtShell*         pSh;
-    SwTOXMark*          pCurTOXMark;
-    SwTOXMarks          aCurMarks;
+    SwWrtShell*         m_pSh;
+    SwTOXMark*          m_pCurTOXMark;
+    SwTOXMarks          m_aCurMarks;
 
     SAL_DLLPRIVATE sal_uInt16                GetUserTypeID(const OUString& 
rStr);
 
@@ -256,15 +256,15 @@ public:
     bool    UpdateOrInsertTOX(const SwTOXDescription& rDesc, SwTOXBase** 
ppBase, const SfxItemSet* pSet);
 
     const SwTOXType*    GetTOXType(TOXTypes eTyp) const;
-    SwWrtShell * GetShell() { return pSh; }
+    SwWrtShell * GetShell() { return m_pSh; }
 };
 
 // inlines
 inline sal_uInt16 SwTOXMgr::GetTOXMarkCount() const
-    {   return aCurMarks.size();   }
+    {   return m_aCurMarks.size();   }
 
 inline SwTOXMark* SwTOXMgr::GetCurTOXMark()
-    {   return pCurTOXMark; }
+    {   return m_pCurTOXMark; }
 
 #endif
 
diff --git a/sw/source/uibase/index/toxmgr.cxx 
b/sw/source/uibase/index/toxmgr.cxx
index d583154dc095..8d40c2fc92d4 100644
--- a/sw/source/uibase/index/toxmgr.cxx
+++ b/sw/source/uibase/index/toxmgr.cxx
@@ -28,33 +28,33 @@
 
 // handle indexes with TOXMgr
 SwTOXMgr::SwTOXMgr(SwWrtShell* pShell):
-    pSh(pShell)
+    m_pSh(pShell)
 {
-    pSh->GetCurTOXMarks(aCurMarks);
+    m_pSh->GetCurTOXMarks(m_aCurMarks);
     SetCurTOXMark(0);
 }
 
 SwTOXMark* SwTOXMgr::GetTOXMark(sal_uInt16 nId)
 {
-    if(!aCurMarks.empty())
-        return aCurMarks[nId];
+    if(!m_aCurMarks.empty())
+        return m_aCurMarks[nId];
     return nullptr;
 }
 
 void SwTOXMgr::DeleteTOXMark()
 {
     SwTOXMark* pNext = nullptr;
-    if( pCurTOXMark )
+    if( m_pCurTOXMark )
     {
-        pNext = const_cast<SwTOXMark*>(&pSh->GotoTOXMark( *pCurTOXMark, 
TOX_NXT ));
-        if( pNext == pCurTOXMark )
+        pNext = const_cast<SwTOXMark*>(&m_pSh->GotoTOXMark( *m_pCurTOXMark, 
TOX_NXT ));
+        if( pNext == m_pCurTOXMark )
             pNext = nullptr;
 
-        pSh->DeleteTOXMark( pCurTOXMark );
-        pSh->SetModified();
+        m_pSh->DeleteTOXMark( m_pCurTOXMark );
+        m_pSh->SetModified();
     }
     // go to next one
-    pCurTOXMark = pNext;
+    m_pCurTOXMark = pNext;
 }
 
 void    SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
@@ -66,7 +66,7 @@ void    SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& 
rDesc)
         {
             OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
                        "invalid InsertTOCMark level");
-            pMark = new SwTOXMark(pSh->GetTOXType(TOX_CONTENT, 0));
+            pMark = new SwTOXMark(m_pSh->GetTOXType(TOX_CONTENT, 0));
             pMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) );
 
             if(rDesc.GetAltStr())
@@ -75,7 +75,7 @@ void    SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& 
rDesc)
         break;
         case  TOX_INDEX:
         {
-            pMark = new SwTOXMark(pSh->GetTOXType(TOX_INDEX, 0));
+            pMark = new SwTOXMark(m_pSh->GetTOXType(TOX_INDEX, 0));
 
             if( rDesc.GetPrimKey() && !rDesc.GetPrimKey()->isEmpty() )
             {
@@ -103,7 +103,7 @@ void    SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& 
rDesc)
                        "invalid InsertTOCMark level");
             sal_uInt16 nId = rDesc.GetTOUName() ?
                 GetUserTypeID(*rDesc.GetTOUName()) : 0;
-            pMark = new SwTOXMark(pSh->GetTOXType(TOX_USER, nId));
+            pMark = new SwTOXMark(m_pSh->GetTOXType(TOX_USER, nId));
             pMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) );
 
             if(rDesc.GetAltStr())
@@ -112,7 +112,7 @@ void    SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& 
rDesc)
         break;
         case  TOX_BIBLIOGRAPHY:
         {
-            pMark = new SwTOXMark(pSh->GetTOXType(TOX_BIBLIOGRAPHY, 0));
+            pMark = new SwTOXMark(m_pSh->GetTOXType(TOX_BIBLIOGRAPHY, 0));
 
             if( rDesc.GetPrimKey() && !rDesc.GetPrimKey()->isEmpty() )
             {
@@ -140,80 +140,80 @@ void    SwTOXMgr::InsertTOXMark(const 
SwTOXMarkDescription& rDesc)
     if (!pMark)
         return;
 
-    pSh->StartAllAction();
-    pSh->SwEditShell::Insert(*pMark);
-    pSh->EndAllAction();
+    m_pSh->StartAllAction();
+    m_pSh->SwEditShell::Insert(*pMark);
+    m_pSh->EndAllAction();
 }
 
 // Update of TOXMarks
 void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
 {
-    assert(pCurTOXMark && "no current TOXMark");
-    pSh->StartAllAction();
-    if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
+    assert(m_pCurTOXMark && "no current TOXMark");
+    m_pSh->StartAllAction();
+    if(m_pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
     {
         if(rDesc.GetPrimKey() && !rDesc.GetPrimKey()->isEmpty() )
         {
-            pCurTOXMark->SetPrimaryKey( *rDesc.GetPrimKey() );
+            m_pCurTOXMark->SetPrimaryKey( *rDesc.GetPrimKey() );
             if(rDesc.GetPhoneticReadingOfPrimKey())
-                pCurTOXMark->SetPrimaryKeyReading( 
*rDesc.GetPhoneticReadingOfPrimKey() );
+                m_pCurTOXMark->SetPrimaryKeyReading( 
*rDesc.GetPhoneticReadingOfPrimKey() );
             else
-                pCurTOXMark->SetPrimaryKeyReading(OUString());
+                m_pCurTOXMark->SetPrimaryKeyReading(OUString());
 
             if( rDesc.GetSecKey() && !rDesc.GetSecKey()->isEmpty() )
             {
-                pCurTOXMark->SetSecondaryKey( *rDesc.GetSecKey() );
+                m_pCurTOXMark->SetSecondaryKey( *rDesc.GetSecKey() );
                 if(rDesc.GetPhoneticReadingOfSecKey())
-                    pCurTOXMark->SetSecondaryKeyReading( 
*rDesc.GetPhoneticReadingOfSecKey() );
+                    m_pCurTOXMark->SetSecondaryKeyReading( 
*rDesc.GetPhoneticReadingOfSecKey() );
                 else
-                    pCurTOXMark->SetSecondaryKeyReading(OUString());
+                    m_pCurTOXMark->SetSecondaryKeyReading(OUString());
             }
             else
             {
-                pCurTOXMark->SetSecondaryKey(OUString());
-                pCurTOXMark->SetSecondaryKeyReading(OUString());
+                m_pCurTOXMark->SetSecondaryKey(OUString());
+                m_pCurTOXMark->SetSecondaryKeyReading(OUString());
             }
         }
         else
         {
-            pCurTOXMark->SetPrimaryKey(OUString());
-            pCurTOXMark->SetPrimaryKeyReading(OUString());
-            pCurTOXMark->SetSecondaryKey(OUString());
-            pCurTOXMark->SetSecondaryKeyReading(OUString());
+            m_pCurTOXMark->SetPrimaryKey(OUString());
+            m_pCurTOXMark->SetPrimaryKeyReading(OUString());
+            m_pCurTOXMark->SetSecondaryKey(OUString());
+            m_pCurTOXMark->SetSecondaryKeyReading(OUString());
         }
         if(rDesc.GetPhoneticReadingOfAltStr())
-            pCurTOXMark->SetTextReading( *rDesc.GetPhoneticReadingOfAltStr() );
+            m_pCurTOXMark->SetTextReading( *rDesc.GetPhoneticReadingOfAltStr() 
);
         else
-            pCurTOXMark->SetTextReading(OUString());
-        pCurTOXMark->SetMainEntry(rDesc.IsMainEntry());
+            m_pCurTOXMark->SetTextReading(OUString());
+        m_pCurTOXMark->SetMainEntry(rDesc.IsMainEntry());
     }
     else
-        pCurTOXMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) );
+        m_pCurTOXMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) );
 
     if(rDesc.GetAltStr())
     {
         // JP 26.08.96: Bug 30344 - either the text of a Doc or an alternative 
test,
         //                          not both!
-        bool bReplace = pCurTOXMark->IsAlternativeText();
+        bool bReplace = m_pCurTOXMark->IsAlternativeText();
         if( bReplace )
-            pCurTOXMark->SetAlternativeText( *rDesc.GetAltStr() );
+            m_pCurTOXMark->SetAlternativeText( *rDesc.GetAltStr() );
         else
         {
-            SwTOXMark aCpy( *pCurTOXMark );
-            aCurMarks.clear();
-            pSh->DeleteTOXMark(pCurTOXMark);
+            SwTOXMark aCpy( *m_pCurTOXMark );
+            m_aCurMarks.clear();
+            m_pSh->DeleteTOXMark(m_pCurTOXMark);
             aCpy.SetAlternativeText( *rDesc.GetAltStr() );
-            pSh->SwEditShell::Insert( aCpy );
-            pCurTOXMark = nullptr;
+            m_pSh->SwEditShell::Insert( aCpy );
+            m_pCurTOXMark = nullptr;
         }
     }
-    pSh->SetModified();
-    pSh->EndAllAction();
+    m_pSh->SetModified();
+    m_pSh->EndAllAction();
     // Bug 36207 pCurTOXMark points nowhere here!
-    if(!pCurTOXMark)
+    if(!m_pCurTOXMark)
     {
-        pSh->Left(CRSR_SKIP_CHARS, false, 1, false );
-        pSh->GetCurTOXMarks(aCurMarks);
+        m_pSh->Left(CRSR_SKIP_CHARS, false, 1, false );
+        m_pSh->GetCurTOXMarks(m_aCurMarks);
         SetCurTOXMark(0);
     }
 }
@@ -221,62 +221,62 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& 
rDesc)
 // determine UserTypeID
 sal_uInt16 SwTOXMgr::GetUserTypeID(const OUString& rStr)
 {
-    sal_uInt16 nSize = pSh->GetTOXTypeCount(TOX_USER);
+    sal_uInt16 nSize = m_pSh->GetTOXTypeCount(TOX_USER);
     for(sal_uInt16 i=0; i < nSize; ++i)
     {
-        const SwTOXType* pTmp = pSh->GetTOXType(TOX_USER, i);
+        const SwTOXType* pTmp = m_pSh->GetTOXType(TOX_USER, i);
         if(pTmp && pTmp->GetTypeName() == rStr)
             return i;
     }
-    SwTOXType aUserType(*pSh->GetDoc(), TOX_USER, rStr);
-    pSh->InsertTOXType(aUserType);
+    SwTOXType aUserType(*m_pSh->GetDoc(), TOX_USER, rStr);
+    m_pSh->InsertTOXType(aUserType);
     return nSize;
 }
 
 // traveling between TOXMarks
 void SwTOXMgr::NextTOXMark(bool bSame)
 {
-    OSL_ENSURE(pCurTOXMark, "no current TOXMark");
-    if( pCurTOXMark )
+    OSL_ENSURE(m_pCurTOXMark, "no current TOXMark");
+    if( m_pCurTOXMark )
     {
         SwTOXSearch eDir = bSame ? TOX_SAME_NXT : TOX_NXT;
-        pCurTOXMark = const_cast<SwTOXMark*>(&pSh->GotoTOXMark( *pCurTOXMark, 
eDir ));
+        m_pCurTOXMark = const_cast<SwTOXMark*>(&m_pSh->GotoTOXMark( 
*m_pCurTOXMark, eDir ));
     }
 }
 
 void SwTOXMgr::PrevTOXMark(bool bSame)
 {
-    OSL_ENSURE(pCurTOXMark, "no current TOXMark");
-    if( pCurTOXMark )
+    OSL_ENSURE(m_pCurTOXMark, "no current TOXMark");
+    if( m_pCurTOXMark )
     {
         SwTOXSearch eDir = bSame ? TOX_SAME_PRV : TOX_PRV;
-        pCurTOXMark = const_cast<SwTOXMark*>(&pSh->GotoTOXMark(*pCurTOXMark, 
eDir ));
+        m_pCurTOXMark = 
const_cast<SwTOXMark*>(&m_pSh->GotoTOXMark(*m_pCurTOXMark, eDir ));
     }
 }
 
 const SwTOXType* SwTOXMgr::GetTOXType(TOXTypes eTyp) const
 {
-    return pSh->GetTOXType(eTyp, 0);
+    return m_pSh->GetTOXType(eTyp, 0);
 }
 
 void SwTOXMgr::SetCurTOXMark(sal_uInt16 nId)
 {
-    pCurTOXMark = (nId < aCurMarks.size()) ? aCurMarks[nId] : nullptr;
+    m_pCurTOXMark = (nId < m_aCurMarks.size()) ? m_aCurMarks[nId] : nullptr;
 }
 
 bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
                                     SwTOXBase** ppBase,
                                     const SfxItemSet* pSet)
 {
-    SwWait aWait( *pSh->GetView().GetDocShell(), true );
+    SwWait aWait( *m_pSh->GetView().GetDocShell(), true );
     bool bRet = true;
-    const SwTOXBase *const pCurTOX = ppBase && *ppBase ? *ppBase : 
pSh->GetCurTOX();
+    const SwTOXBase *const pCurTOX = ppBase && *ppBase ? *ppBase : 
m_pSh->GetCurTOX();
 
     SwTOXBase * pNewTOX = pCurTOX ? new SwTOXBase(*pCurTOX) : nullptr;
 
     TOXTypes eCurTOXType = rDesc.GetTOXType();
-    if(pCurTOX && !ppBase && pSh->HasSelection())
-        pSh->EnterStdMode();
+    if(pCurTOX && !ppBase && m_pSh->HasSelection())
+        m_pSh->EnterStdMode();
 
     switch(eCurTOXType)
     {
@@ -284,21 +284,21 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
         {
             if(!pCurTOX || (ppBase && !(*ppBase)))
             {
-                const SwTOXType* pType = pSh->GetTOXType(eCurTOXType, 0);
+                const SwTOXType* pType = m_pSh->GetTOXType(eCurTOXType, 0);
                 SwForm aForm(eCurTOXType);
                 pNewTOX = new SwTOXBase(pType, aForm, SwTOXElement::Mark, 
pType->GetTypeName());
             }
             pNewTOX->SetOptions(rDesc.GetIndexOptions());
             pNewTOX->SetMainEntryCharStyle(rDesc.GetMainEntryCharStyle());
-            pSh->SetTOIAutoMarkURL(rDesc.GetAutoMarkURL());
-            pSh->ApplyAutoMark();
+            m_pSh->SetTOIAutoMarkURL(rDesc.GetAutoMarkURL());
+            m_pSh->ApplyAutoMark();
         }
         break;
         case TOX_CONTENT :
         {
             if(!pCurTOX || (ppBase && !(*ppBase)))
             {
-                const SwTOXType* pType = pSh->GetTOXType(eCurTOXType, 0);
+                const SwTOXType* pType = m_pSh->GetTOXType(eCurTOXType, 0);
                 SwForm aForm(eCurTOXType);
                 pNewTOX = new SwTOXBase(pType, aForm, 
rDesc.GetContentOptions(), pType->GetTypeName());
             }
@@ -311,15 +311,15 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
             if(!pCurTOX || (ppBase && !(*ppBase)))
             {
                 sal_uInt16 nPos  = 0;
-                sal_uInt16 nSize = pSh->GetTOXTypeCount(eCurTOXType);
+                sal_uInt16 nSize = m_pSh->GetTOXTypeCount(eCurTOXType);
                 for(sal_uInt16 i=0; rDesc.GetTOUName() && i < nSize; ++i)
-                {   const SwTOXType* pType = pSh->GetTOXType(TOX_USER, i);
+                {   const SwTOXType* pType = m_pSh->GetTOXType(TOX_USER, i);
                     if(pType->GetTypeName() == *rDesc.GetTOUName())
                     {   nPos = i;
                         break;
                     }
                 }
-                const SwTOXType* pType = pSh->GetTOXType(eCurTOXType, nPos);
+                const SwTOXType* pType = m_pSh->GetTOXType(eCurTOXType, nPos);
 
                 SwForm aForm(eCurTOXType);
                 pNewTOX = new SwTOXBase(pType, aForm, 
rDesc.GetContentOptions(), pType->GetTypeName());
@@ -343,12 +343,12 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
             if(TOX_AUTHORITIES == eCurTOXType)
             {
                 SwAuthorityFieldType* pFType = 
static_cast<SwAuthorityFieldType*>(
-                                                
pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
+                                                
m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
                 if (!pFType)
                 {
-                    SwAuthorityFieldType const type(pSh->GetDoc());
+                    SwAuthorityFieldType const type(m_pSh->GetDoc());
                     pFType = static_cast<SwAuthorityFieldType*>(
-                                pSh->InsertFieldType(type));
+                                m_pSh->InsertFieldType(type));
                 }
                 OUString const& rBrackets(rDesc.GetAuthBrackets());
                 if (rBrackets.isEmpty())
@@ -375,7 +375,7 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
             // TODO: consider properties of the current TOXType
             if(!pCurTOX || (ppBase && !(*ppBase)))
             {
-                const SwTOXType* pType = pSh->GetTOXType(eCurTOXType, 0);
+                const SwTOXType* pType = m_pSh->GetTOXType(eCurTOXType, 0);
                 SwForm aForm(eCurTOXType);
                 pNewTOX = new SwTOXBase(
                     pType, aForm,
@@ -415,13 +415,13 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
             (*ppBase) = pNewTOX;
         else
         {
-            pSh->InsertTableOf(*pNewTOX, pSet);
+            m_pSh->InsertTableOf(*pNewTOX, pSet);
             delete pNewTOX;
         }
     }
     else
     {
-        SwDoc * pDoc = pSh->GetDoc();
+        SwDoc * pDoc = m_pSh->GetDoc();
 
         if (pDoc->GetIDocumentUndoRedo().DoesUndo())
         {
@@ -432,7 +432,7 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
         pDoc->ChangeTOX(*pTOX, *pNewTOX);
 
         pTOX->DisableKeepExpression();
-        pSh->UpdateTableOf(*pTOX, pSet);
+        m_pSh->UpdateTableOf(*pTOX, pSet);
         bRet = false;
         pTOX->EnableKeepExpression();
 
commit 7d1e4d12baa85d47f5945872a3bc186dd6ce1889
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon Dec 13 08:41:10 2021 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Dec 13 10:10:10 2021 +0100

    ODP import/export: refer to theme from shape text color with effects
    
    Handle luminance modulation and offset (i.e. lighter and darker colors).
    
    Change-Id: I536bbca1ed994e991c7ceac153d6a47cb6ef35f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126722
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 50aa8a9d632d..16ffaaa8bbfa 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1133,14 +1133,31 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const 
SfxItemSet* pSet, const Sf
 
         if(bItemStateSet)
         {
-            if (pMap->nWID == EE_CHAR_COLOR && pMap->nMemberId == 
MID_COLOR_THEME_INDEX)
+            if (pMap->nWID == EE_CHAR_COLOR)
             {
-                // Theme can be DEFAULT_VALUE, even if the same pool item has 
a color which is a
-                // DIRECT_VALUE.
+                // Theme & effects can be DEFAULT_VALUE, even if the same pool 
item has a color
+                // which is a DIRECT_VALUE.
                 const SvxColorItem* pColor = 
pSet->GetItem<SvxColorItem>(EE_CHAR_COLOR);
-                if (pColor->GetThemeIndex() == -1)
+                switch (pMap->nMemberId)
                 {
-                    eItemState = SfxItemState::DEFAULT;
+                    case MID_COLOR_THEME_INDEX:
+                        if (pColor->GetThemeIndex() == -1)
+                        {
+                            eItemState = SfxItemState::DEFAULT;
+                        }
+                        break;
+                    case MID_COLOR_LUM_MOD:
+                        if (pColor->GetLumMod() == 10000)
+                        {
+                            eItemState = SfxItemState::DEFAULT;
+                        }
+                        break;
+                    case MID_COLOR_LUM_OFF:
+                        if (pColor->GetLumOff() == 0)
+                        {
+                            eItemState = SfxItemState::DEFAULT;
+                        }
+                        break;
                 }
             }
 
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index cd223d2777bc..99ebed218748 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -83,6 +83,10 @@ public:
         maTintShade = nTintOrShade;
     }
 
+    sal_Int16 GetLumMod() const { return mnLumMod; }
+
+    sal_Int16 GetLumOff() const { return mnLumOff; }
+
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 67885e78cc21..c17ffe8af69a 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3454,6 +3454,8 @@ namespace xmloff::token {
         XML_ACCENT6,
         XML_HLINK,
         XML_FOLHLINK,
+        XML_COLOR_LUM_MOD,
+        XML_COLOR_LUM_OFF,
 
         XML_TOKEN_END
     };
diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx
index 3711e5d5db52..13e7c3fcc6c0 100644
--- a/include/xmloff/xmltypes.hxx
+++ b/include/xmloff/xmltypes.hxx
@@ -153,6 +153,7 @@
 #define XML_TYPE_NEG_PERCENT16      0x00002023          // (100-x)
 #define XML_TYPE_DOUBLE_PERCENT     0x00002024          //  50% (source is a 
double from 0.0 to 1.0)
 #define XML_TYPE_HEX                0x00002025          // 00544F1B
+#define XML_TYPE_PERCENT100 0x00002026 // 100th percent
 
 // special basic types
 #define XML_TYPE_RECTANGLE_LEFT     0x00000100          // the Left member of 
an awt::Rectangle as a measure
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index e24d3a5e8c8e..ce941afd1b77 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2118,6 +2118,16 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
         </rng:choice>
       </rng:attribute>
     </rng:optional>
+    <rng:optional>
+      <rng:attribute name="loext:color-lum-mod">
+        <rng:ref name="zeroToHundredPercent"/>
+      </rng:attribute>
+    </rng:optional>
+    <rng:optional>
+      <rng:attribute name="loext:color-lum-off">
+        <rng:ref name="zeroToHundredPercent"/>
+      </rng:attribute>
+    </rng:optional>
   </rng:define>
 
   <rng:define name="style-text-properties-attlist" combine="interleave">
diff --git a/xmloff/qa/unit/data/refer-to-theme.odp 
b/xmloff/qa/unit/data/refer-to-theme.odp
index 83bad49b5f56..cba4bfda1538 100644
Binary files a/xmloff/qa/unit/data/refer-to-theme.odp and 
b/xmloff/qa/unit/data/refer-to-theme.odp differ
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index a61ef6de2717..f13a60082d7d 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -195,10 +195,27 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testReferToTheme)
     // i.e. only the direct color was written, but not the theme reference.
     assertXPath(pXmlDoc, 
"//style:style[@style:name='T1']/style:text-properties", "theme-color",
                 "accent1");
+    assertXPathNoAttribute(pXmlDoc, 
"//style:style[@style:name='T1']/style:text-properties",
+                           "color-lum-mod");
+    assertXPathNoAttribute(pXmlDoc, 
"//style:style[@style:name='T1']/style:text-properties",
+                           "color-lum-off");
+
     assertXPath(pXmlDoc, 
"//style:style[@style:name='T2']/style:text-properties", "theme-color",
                 "accent1");
+    // Without the accompanying fix in place, this test would have failed with:
+    // - XPath '//style:style[@style:name='T2']/style:text-properties' no 
attribute 'color-lum-mod' exist
+    // i.e. effects on a referenced theme color were lost.
+    assertXPath(pXmlDoc, 
"//style:style[@style:name='T2']/style:text-properties", "color-lum-mod",
+                "40%");
+    assertXPath(pXmlDoc, 
"//style:style[@style:name='T2']/style:text-properties", "color-lum-off",
+                "60%");
+
     assertXPath(pXmlDoc, 
"//style:style[@style:name='T3']/style:text-properties", "theme-color",
                 "accent1");
+    assertXPath(pXmlDoc, 
"//style:style[@style:name='T3']/style:text-properties", "color-lum-mod",
+                "75%");
+    assertXPathNoAttribute(pXmlDoc, 
"//style:style[@style:name='T3']/style:text-properties",
+                           "color-lum-off");
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index fd486a313aae..298dd431a0fe 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3457,6 +3457,8 @@ namespace xmloff::token {
         TOKEN("accent6",             XML_ACCENT6 ),
         TOKEN("hlink",               XML_HLINK ),
         TOKEN("folHlink",            XML_FOLHLINK ),
+        TOKEN("color-lum-mod",       XML_COLOR_LUM_MOD ),
+        TOKEN("color-lum-off",       XML_COLOR_LUM_OFF ),
 
 
 #if OSL_DEBUG_LEVEL > 0
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index d8a9cf32f904..ca96e0421552 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -200,6 +200,9 @@ std::unique_ptr<XMLPropertyHandler> 
XMLPropertyHandlerFactory::CreatePropertyHan
         case XML_TYPE_PERCENT16 :
             pPropHdl.reset(new XMLPercentPropHdl( 2 ));
             break;
+        case XML_TYPE_PERCENT100:
+            pPropHdl.reset(new XML100thPercentPropHdl);
+            break;
         case XML_TYPE_DOUBLE_PERCENT :
             pPropHdl.reset(new XMLDoublePercentPropHdl);
             break;
diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx
index b1fa0c891c86..bc24a16ceb03 100644
--- a/xmloff/source/style/xmlbahdl.cxx
+++ b/xmloff/source/style/xmlbahdl.cxx
@@ -361,6 +361,36 @@ bool XMLDoublePercentPropHdl::exportXML( OUString& 
rStrExpValue, const Any& rVal
     return bRet;
 }
 
+bool XML100thPercentPropHdl::importXML(const OUString& rStrImpValue, Any& 
rValue,
+                                       const SvXMLUnitConverter&) const
+{
+    bool bRet = false;
+
+    sal_Int32 nValue = 0;
+    bRet = sax::Converter::convertPercent(nValue, rStrImpValue);
+    rValue <<= static_cast<sal_Int16>(nValue * 100);
+
+    return bRet;
+}
+
+bool XML100thPercentPropHdl::exportXML(OUString& rStrExpValue, const Any& 
rValue,
+                                       const SvXMLUnitConverter&) const
+{
+    bool bRet = false;
+    sal_Int16 nValue = 0;
+
+    if (rValue >>= nValue)
+    {
+        nValue = std::round(static_cast<double>(nValue) / 100);
+        OUStringBuffer aOut;
+        sax::Converter::convertPercent(aOut, nValue);
+        rStrExpValue = aOut.makeStringAndClear();
+        bRet = true;
+    }
+
+    return bRet;
+}
+
 
 XMLNegPercentPropHdl::~XMLNegPercentPropHdl()
 {
diff --git a/xmloff/source/style/xmlbahdl.hxx b/xmloff/source/style/xmlbahdl.hxx
index e9120f5e9107..09e392d6cc6b 100644
--- a/xmloff/source/style/xmlbahdl.hxx
+++ b/xmloff/source/style/xmlbahdl.hxx
@@ -92,6 +92,15 @@ class XMLDoublePercentPropHdl : public XMLPropertyHandler
     virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& 
rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
 };
 
+/// Maps between XML percentage and our 100th percent ints.
+class XML100thPercentPropHdl : public XMLPropertyHandler
+{
+    virtual bool importXML(const OUString& rStrImpValue, css::uno::Any& rValue,
+                           const SvXMLUnitConverter& rUnitConverter) const 
override;
+    virtual bool exportXML(OUString& rStrExpValue, const css::uno::Any& rValue,
+                           const SvXMLUnitConverter& rUnitConverter) const 
override;
+};
+
 /**
     PropertyHandler for the XML-data-type: XML_TYPE_NEG_PERCENT
 */
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index f51db1aa2ab6..ce09a85c917a 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -139,6 +139,8 @@ XMLPropertyMapEntry const aXMLParaPropMap[] =
     MAP_EXT_I("CharTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
     MAP_EXT("CharTransparence", XML_NAMESPACE_LO_EXT, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
     MAP_EXT("CharColorTheme", XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, 
XML_TYPE_THEME_COLOR, 0),
+    MAP_EXT("CharColorLumMod", XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_MOD, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
+    MAP_EXT("CharColorLumOff", XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_OFF, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
     // RES_CHRATR_CONTOUR
     MT_E( "CharContoured",  STYLE,  TEXT_OUTLINE,       XML_TYPE_BOOL,  0 ),
     // RES_CHRATR_CROSSEDOUT
@@ -483,6 +485,8 @@ XMLPropertyMapEntry const aXMLTextPropMap[] =
     MAP_EXT_I("CharTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
     MAP_EXT("CharTransparence", XML_NAMESPACE_LO_EXT, XML_OPACITY, 
XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
     MAP_EXT("CharColorTheme", XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, 
XML_TYPE_THEME_COLOR | XML_TYPE_PROP_TEXT, 0),
+    MAP_EXT("CharColorLumMod", XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_MOD, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
+    MAP_EXT("CharColorLumOff", XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_OFF, 
XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0),
     // RES_CHRATR_CONTOUR
     MT_E( "CharContoured",  STYLE,  TEXT_OUTLINE,       XML_TYPE_BOOL,  0 ),
     // RES_CHRATR_CROSSEDOUT
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 12de9d78a22d..a23326c71f17 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -3201,4 +3201,6 @@ accent5
 accent6
 hlink
 folHlink
+color-lum-mod
+color-lum-off
 TOKEN_END_DUMMY

Reply via email to