summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx2
-rw-r--r--sw/source/uibase/inc/uitool.hxx3
-rw-r--r--sw/source/uibase/shells/basesh.cxx6
-rw-r--r--sw/source/uibase/shells/frmsh.cxx16
-rw-r--r--sw/source/uibase/shells/textsh1.cxx34
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.cxx5
-rw-r--r--sw/source/uibase/utlui/uitool.cxx7
7 files changed, 42 insertions, 31 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 648ea2334583..2c626849b3f8 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5146,7 +5146,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
m_pApplyTempl->nUndo =
std::min(m_pApplyTempl->nUndo, rSh.GetDoc()->GetIDocumentUndoRedo().GetUndoActionCount());
if (nId == RES_CHRATR_BACKGROUND)
- ApplyCharBackground(m_aWaterCanTextBackColor, rSh);
+ ApplyCharBackground(m_aWaterCanTextBackColor, model::ComplexColor(), rSh);
else
rSh.SetAttrItem( SvxColorItem( m_aWaterCanTextColor, nId ) );
rSh.UnSetVisibleCursor();
diff --git a/sw/source/uibase/inc/uitool.hxx b/sw/source/uibase/inc/uitool.hxx
index 85747a9f82e3..87eef4e84f16 100644
--- a/sw/source/uibase/inc/uitool.hxx
+++ b/sw/source/uibase/inc/uitool.hxx
@@ -29,6 +29,7 @@ class SvxTabStopItem;
class SwWrtShell;
namespace com::sun::star::awt { class XPopupMenu; }
namespace weld { class ComboBox; }
+namespace model { class ComplexColor; }
class SwDocShell;
class SwFrameFormat;
class SwTabCols;
@@ -66,7 +67,7 @@ SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrig
* @param[in] rBackgroundColor the color to apply on the shell
* @param[in,out] rShell the shell on which we apply the new attribute
**/
-void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell);
+void ApplyCharBackground(Color const& rBackgroundColor, model::ComplexColor const& rComplexColor, SwWrtShell& rShell);
// SfxItemSets <-> PageDesc
void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 6e0075a54259..118df74e23a1 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2606,7 +2606,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
case SID_BACKGROUND_COLOR:
case SID_TABLE_CELL_BACKGROUND_COLOR:
{
- SvxColorItem aColorItem(aBrushItem->GetColor(), nWhich);
+ SvxColorItem aColorItem(aBrushItem->GetColor(), aBrushItem->getComplexColor(), nWhich);
rSet.Put(aColorItem);
break;
}
@@ -2676,8 +2676,8 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
if (pArgs)
{
const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
- const Color& rNewColor = rNewColorItem.GetValue();
- aBrushItem->SetColor(rNewColor);
+ aBrushItem->SetColor(rNewColorItem.GetValue());
+ aBrushItem->setComplexColor(rNewColorItem.getComplexColor());
GetView().GetViewFrame().GetBindings().SetState(rNewColorItem);
}
else
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 2b10c0d9261d..bec169eed5ba 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1222,14 +1222,14 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
}
else
{
- if ( aBoxItem->GetTop() )
- const_cast<SvxBorderLine*>(aBoxItem->GetTop())->SetColor( rNewColor );
- if ( aBoxItem->GetBottom() )
- const_cast<SvxBorderLine*>(aBoxItem->GetBottom())->SetColor( rNewColor );
- if ( aBoxItem->GetLeft() )
- const_cast<SvxBorderLine*>(aBoxItem->GetLeft())->SetColor( rNewColor );
- if ( aBoxItem->GetRight() )
- const_cast<SvxBorderLine*>(aBoxItem->GetRight())->SetColor( rNewColor );
+ if (aBoxItem->GetTop())
+ aBoxItem->GetTop()->SetColor(rNewColor);
+ if (aBoxItem->GetBottom())
+ aBoxItem->GetBottom()->SetColor(rNewColor);
+ if (aBoxItem->GetLeft())
+ aBoxItem->GetLeft()->SetColor(rNewColor);
+ if (aBoxItem->GetRight())
+ aBoxItem->GetRight()->SetColor(rNewColor);
}
}
}
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index b6f68af7406b..fb5e2f88c9d9 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1719,18 +1719,23 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_ATTR_CHAR_COLOR_BACKGROUND: // deprecated
case SID_ATTR_CHAR_COLOR_EXT:
{
- Color aSet;
+ Color aColor;
+ model::ComplexColor aComplexColor;
if (pItem)
- aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
+ {
+ auto* pColorItem = static_cast<const SvxColorItem*>(pItem);
+ aColor = pColorItem->GetValue();
+ aComplexColor = pColorItem->getComplexColor();
+ }
else
- aSet = COL_TRANSPARENT;
+ aColor = COL_TRANSPARENT;
SwEditWin& rEdtWin = GetView().GetEditWin();
if (nSlot != SID_ATTR_CHAR_COLOR_EXT)
- rEdtWin.SetWaterCanTextBackColor(aSet);
+ rEdtWin.SetWaterCanTextBackColor(aColor);
else if (pItem)
- rEdtWin.SetWaterCanTextColor(aSet);
+ rEdtWin.SetWaterCanTextColor(aColor);
SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
SwApplyTemplate aTempl;
@@ -1740,18 +1745,19 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
SfxItemSetFixed<RES_CHRATR_BACKGROUND, RES_CHRATR_BACKGROUND> aCoreSet( rWrtSh.GetView().GetPool() );
- rWrtSh.GetCurAttr( aCoreSet );
+ rWrtSh.GetCurAttr(aCoreSet);
// Remove highlight if already set of the same color
const SvxBrushItem& rBrushItem = aCoreSet.Get(RES_CHRATR_BACKGROUND);
- if ( aSet == rBrushItem.GetColor() )
- aSet = COL_TRANSPARENT;
-
- ApplyCharBackground(aSet, rWrtSh);
+ if (aColor == rBrushItem.GetColor())
+ {
+ aComplexColor = model::ComplexColor();
+ aColor = COL_TRANSPARENT;
+ }
+ ApplyCharBackground(aColor, aComplexColor, rWrtSh);
}
else
- rWrtSh.SetAttrItem(
- SvxColorItem(aSet, RES_CHRATR_COLOR) );
+ rWrtSh.SetAttrItem(SvxColorItem(aColor, aComplexColor, RES_CHRATR_COLOR));
}
else
{
@@ -2374,12 +2380,12 @@ void SwTextShell::GetState( SfxItemSet &rSet )
const SvxBrushItem& aBrushItem = aSet.Get(RES_CHRATR_HIGHLIGHT);
if( aBrushItem.GetColor() != COL_TRANSPARENT )
{
- rSet.Put( SvxColorItem(aBrushItem.GetColor(), nWhich) );
+ rSet.Put(SvxColorItem(aBrushItem.GetColor(), aBrushItem.getComplexColor(), nWhich));
}
else
{
const SvxBrushItem& aBrushItem2 = aSet.Get(RES_CHRATR_BACKGROUND);
- rSet.Put( SvxColorItem(aBrushItem2.GetColor(), nWhich) );
+ rSet.Put(SvxColorItem(aBrushItem2.GetColor(), aBrushItem2.getComplexColor(), nWhich));
}
}
break;
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx
index 9565b177b84d..53cf43fb742e 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.cxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx
@@ -544,7 +544,10 @@ void PageStylesPanel::ModifyFillColor()
{
case SOLID:
{
- XFillColorItem aItem(OUString(), mxBgColorLB->GetSelectEntryColor());
+ auto aNamedColor = mxBgColorLB->GetSelectedEntry();
+ XFillColorItem aItem(OUString(), aNamedColor.m_aColor);
+ aItem.setComplexColor(aNamedColor.getComplexColor());
+ aItem.setComplexColor(mxBgColorLB->GetSelectedEntry().getComplexColor());
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem });
}
break;
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 1ead464c8963..079b5f9fdb1f 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -67,8 +67,9 @@
#include <charfmt.hxx>
#include <SwStyleNameMapper.hxx>
#include <strings.hrc>
-// 50 cm 28350
+#include <docmodel/color/ComplexColor.hxx>
+// 50 cm 28350
#define MAXHEIGHT 28350
#define MAXWIDTH 28350
@@ -193,7 +194,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, bool bIs
assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
}
-void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
+void ApplyCharBackground(Color const& rBackgroundColor, model::ComplexColor const& rComplexColor, SwWrtShell& rShell)
{
rShell.StartUndo(SwUndoId::INSATTR);
@@ -202,7 +203,7 @@ void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
rShell.GetCurAttr(aCoreSet);
// Set char background
- rShell.SetAttrItem(SvxBrushItem(rBackgroundColor, RES_CHRATR_BACKGROUND));
+ rShell.SetAttrItem(SvxBrushItem(rBackgroundColor, rComplexColor, RES_CHRATR_BACKGROUND));
// Highlight is an MS specific thing, so remove it at the first time when LO modifies
// this part of the imported document.