desktop/source/lib/init.cxx | 1 icon-themes/breeze/links.txt | 2 + icon-themes/colibre/links.txt | 2 + icon-themes/elementary/links.txt | 3 + icon-themes/karasa_jaga/links.txt | 3 + icon-themes/sifr/links.txt | 4 +- icon-themes/tango/links.txt | 4 +- include/svx/svxids.hrc | 4 +- officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 11 ++++++ officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 8 ++++ svx/sdi/svx.sdi | 17 ++++++++++ svx/source/tbxctrls/tbcontrl.cxx | 5 ++ svx/source/tbxctrls/tbxcolorupdate.cxx | 1 sw/sdi/_basesh.sdi | 8 ++++ sw/source/uibase/shells/basesh.cxx | 12 ++++--- sw/uiconfig/swriter/toolbar/tableobjectbar.xml | 2 - 16 files changed, 78 insertions(+), 9 deletions(-)
New commits: commit 47e9db9c8490167e265b17ae44bb790a160703b5 Author: Jim Raykowski <[email protected]> AuthorDate: Sun Dec 23 00:15:40 2018 -0900 Commit: Heiko Tietze <[email protected]> CommitDate: Sun Jan 6 20:15:22 2019 +0100 tdf#82504 writer table cell background color SvxColorItem uno function Current background color function only sets table cell background when multiple table cells are selected. Paragraph background is otherwise set. This gives expected results for use in sidebar Paragraph panel when multiple table cells are not selected but unexpected results when multiple table cells are selected. For background setting from the table tool bar unexpected paragraph background color is set when multiple cells are not selected. This fix creates a table cell background color uno command specific for setting table cell background color. Change-Id: Ic56723b635252415d932c5499f996c3e46eee13b Reviewed-on: https://gerrit.libreoffice.org/65591 Tested-by: Jenkins Reviewed-by: Heiko Tietze <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0ec67bc6618f..d407b2a80736 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1902,6 +1902,7 @@ static void doc_iniUnoCommands () OUString(".uno:AlignRight"), OUString(".uno:BackColor"), OUString(".uno:BackgroundColor"), + OUString(".uno:TableCellBackgroundColor"), OUString(".uno:Bold"), OUString(".uno:CenterPara"), OUString(".uno:CharBackColor"), diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt index 974c73b1df37..24d7e141acbb 100644 --- a/icon-themes/breeze/links.txt +++ b/icon-themes/breeze/links.txt @@ -579,6 +579,8 @@ cmd/sc_fontcolor.png cmd/sc_color.png cmd/sc_characterbackgroundpattern.png cmd/sc_backcolor.png cmd/lc_characterbackgroundpattern.png cmd/lc_backcolor.png cmd/lc_backgroundpatterncontroller.png cmd/lc_backgroundcolor.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png # Paragraph Alignment cmd/lc_leftpara.png cmd/lc_alignleft.png diff --git a/icon-themes/colibre/links.txt b/icon-themes/colibre/links.txt index 1e94f8109ce6..d02b55001969 100644 --- a/icon-themes/colibre/links.txt +++ b/icon-themes/colibre/links.txt @@ -567,6 +567,8 @@ cmd/sc_fontcolor.png cmd/sc_color.png cmd/sc_characterbackgroundpattern.png cmd/sc_backcolor.png cmd/lc_characterbackgroundpattern.png cmd/lc_backcolor.png cmd/lc_backgroundpatterncontroller.png cmd/lc_backgroundcolor.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png # Paragraph Alignment cmd/lc_leftpara.png cmd/lc_alignleft.png diff --git a/icon-themes/elementary/links.txt b/icon-themes/elementary/links.txt index 21c7cce468e0..189a3f3a0922 100644 --- a/icon-themes/elementary/links.txt +++ b/icon-themes/elementary/links.txt @@ -877,18 +877,21 @@ cmd/32/characterbackgroundpattern.png cmd/32/backcolor.png cmd/32/fontcolor.png cmd/32/color.png cmd/32/formatarea.png cmd/32/backgroundcolor.png cmd/32/settabbgcolor.png cmd/32/backgroundcolor.png +cmd/32/tablecellbackgroundcolor.png cmd/32/backgroundcolor.png cmd/lc_backgroundpatterncontroller.png cmd/lc_backgroundcolor.png cmd/lc_characterbackgroundpattern.png cmd/lc_backcolor.png cmd/lc_fontcolor.png cmd/lc_color.png cmd/lc_formatarea.png cmd/lc_backgroundcolor.png cmd/lc_settabbgcolor.png cmd/lc_backgroundcolor.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png cmd/sc_backgroundpatterncontroller.png cmd/sc_backgroundcolor.png cmd/sc_characterbackgroundpattern.png cmd/sc_backcolor.png cmd/sc_fontcolor.png cmd/sc_color.png cmd/sc_formatarea.png cmd/sc_backgroundcolor.png cmd/sc_settabbgcolor.png cmd/sc_backgroundcolor.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png # Paragraph Alignment cmd/32/leftpara.png cmd/32/alignleft.png diff --git a/icon-themes/karasa_jaga/links.txt b/icon-themes/karasa_jaga/links.txt index 3d1c124e59e6..beaa91c5e1af 100644 --- a/icon-themes/karasa_jaga/links.txt +++ b/icon-themes/karasa_jaga/links.txt @@ -292,6 +292,7 @@ cmd/32/starshapes.png cmd/32/starshapes.star5.png cmd/32/stylewatercanmode cmd/32/styleapply.png cmd/32/symbolcatalogue.png cmd/32/insertsymbol.png cmd/32/symbolshapes.png cmd/32/symbolshapes.smiley.png +cmd/32/tablecellbackgroundcolor.png cmd/32/backgroundcolor.png cmd/32/tableevents.png cmd/32/animationeffects.png cmd/32/tableselectall.png cmd/32/selecttable.png cmd/32/tablesort.png cmd/32/datasort.png @@ -619,6 +620,7 @@ cmd/lc_starshapes.png cmd/lc_starshapes.star5.png cmd/lc_stylewatercanmode cmd/lc_styleapply.png cmd/lc_symbolcatalogue.png cmd/lc_insertsymbol.png cmd/lc_symbolshapes.png cmd/lc_symbolshapes.smiley.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png cmd/lc_tableevents.png cmd/lc_animationeffects.png cmd/lc_tableselectall.png cmd/lc_selecttable.png cmd/lc_tablesort.png cmd/lc_datasort.png @@ -911,6 +913,7 @@ cmd/sc_starshapes.png cmd/sc_starshapes.star5.png cmd/sc_stylewatercanmode cmd/sc_styleapply.png cmd/sc_symbolcatalogue.png cmd/sc_insertsymbol.png cmd/sc_symbolshapes.png cmd/sc_symbolshapes.smiley.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png cmd/sc_tableevents.png cmd/sc_animationeffects.png cmd/sc_tableselectall.png cmd/sc_selecttable.png cmd/sc_tablesort.png cmd/sc_datasort.png diff --git a/icon-themes/sifr/links.txt b/icon-themes/sifr/links.txt index 7551f7d63de4..474664f54e07 100644 --- a/icon-themes/sifr/links.txt +++ b/icon-themes/sifr/links.txt @@ -77,6 +77,8 @@ cmd/sc_closepreview.png cmd/sc_exitsearch.png # Colors (fontcolor is used in writer's formatting toolbar) cmd/lc_fontcolor.png cmd/lc_color.png cmd/sc_fontcolor.png cmd/sc_color.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png # Vertical Text Alignment (cellvert* is used in writer and align* is used in calc) cmd/lc_cellverttop.png cmd/lc_aligntop.png @@ -225,4 +227,4 @@ cmd/sc_viewsidebarstyles.png cmd/sc_designerdialog.png # writer text and table context menus cmd/sc_charactermenu.png cmd/sc_fontdialog.png cmd/sc_paragraphmenu.png cmd/sc_paragraphdialog.png -cmd/sc_numberingmenu.png cmd/sc_outlinebullet.png \ No newline at end of file +cmd/sc_numberingmenu.png cmd/sc_outlinebullet.png diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt index c28a3accbdb8..25844ed7e3b5 100644 --- a/icon-themes/tango/links.txt +++ b/icon-themes/tango/links.txt @@ -533,6 +533,8 @@ cmd/sc_sheetcommentmenu.png cmd/sc_insertannotation.png # text background colour Impress/Draw cmd/sc_charbackcolor.png cmd/sc_backcolor.png cmd/lc_charbackcolor.png cmd/lc_backcolor.png +cmd/sc_tablecellbackgroundcolor.png cmd/sc_backgroundcolor.png +cmd/lc_tablecellbackgroundcolor.png cmd/lc_backgroundcolor.png # Toggle graphics visibility in Writer cmd/sc_showgraphics.png cmd/sc_insertgraphic.png @@ -631,4 +633,4 @@ cmd/sc_viewsidebarstyles.png cmd/sc_designerdialog.png # writer text and table context menus cmd/sc_charactermenu.png cmd/sc_fontdialog.png cmd/sc_paragraphmenu.png cmd/sc_paragraphdialog.png -cmd/sc_numberingmenu.png cmd/sc_outlinebullet.png \ No newline at end of file +cmd/sc_numberingmenu.png cmd/sc_outlinebullet.png diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index da6e743e272e..a1b063c71e7f 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -975,9 +975,11 @@ class SfxStringItem; #define SID_TABLE_OPTIMAL_COLUMN_WIDTH ( SID_SVX_START + 1187 ) #define SID_TABLE_OPTIMAL_ROW_HEIGHT ( SID_SVX_START + 1188 ) +#define SID_TABLE_CELL_BACKGROUND_COLOR TypedWhichId<SvxColorItem>( SID_SVX_START + 1189 ) + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_TABLE_OPTIMAL_ROW_HEIGHT + 1 ) +#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1189 + 1 ) // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 3a9f1527cab4..d135a4571c62 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -1299,6 +1299,17 @@ <value>com.sun.star.comp.svx.ColorToolBoxControl</value> </prop> </node> + <node oor:name="TableCellBackgroundColorToolBox" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:TableCellBackgroundColor</value> + </prop> + <prop oor:name="Module"> + <value/> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.comp.svx.ColorToolBoxControl</value> + </prop> + </node> <node oor:name="ColorToolBox" oor:op="replace"> <prop oor:name="Command"> <value>.uno:Color</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 75b5eb0f62b6..b0b8e04cf3a7 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -3394,6 +3394,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:TableCellBackgroundColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Table Cell Background Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> </node> </node> </oor:component-data> diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index d3aa1537be8f..1c956b191dee 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -425,6 +425,23 @@ SvxColorItem BackgroundColor SID_BACKGROUND_COLOR GroupId = SfxGroupId::Format; ] +SvxColorItem TableCellBackgroundColor SID_TABLE_CELL_BACKGROUND_COLOR + +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Format; +] SvxBrushItem BackgroundPattern SID_ATTR_BRUSH diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 24e04d157ca3..f852d9411311 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1294,6 +1294,7 @@ SvxColorWindow::SvxColorWindow(const OUString& rCommand, case SID_ATTR_CHAR_COLOR_BACKGROUND: case SID_BACKGROUND_COLOR: case SID_ATTR_CHAR_BACK_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: { mpButtonAutoColor->SetText( SvxResId( RID_SVXSTR_NOFILL ) ); break; @@ -1409,6 +1410,7 @@ ColorWindow::ColorWindow(std::shared_ptr<PaletteManager> const & rPaletteManager case SID_ATTR_CHAR_COLOR_BACKGROUND: case SID_BACKGROUND_COLOR: case SID_ATTR_CHAR_BACK_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: { mxButtonAutoColor->set_label( SvxResId( RID_SVXSTR_NOFILL ) ); break; @@ -1545,6 +1547,7 @@ namespace case SID_ATTR_CHAR_COLOR_BACKGROUND: case SID_BACKGROUND_COLOR: case SID_ATTR_CHAR_BACK_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: aColor = COL_TRANSPARENT; sColorName = SvxResId(RID_SVXSTR_NOFILL); break; @@ -3032,6 +3035,8 @@ sal_uInt16 MapCommandToSlotId(const OUString& rCommand) return SID_ATTR_CHAR_BACK_COLOR; else if (rCommand == ".uno:BackgroundColor") return SID_BACKGROUND_COLOR; + else if (rCommand == ".uno:TableCellBackgroundColor") + return SID_TABLE_CELL_BACKGROUND_COLOR; else if (rCommand == ".uno:Extrusion3DColor") return SID_EXTRUSION_3D_COLOR; else if (rCommand == ".uno:XLineColor") diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 45558e51b533..378f48721c7a 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -55,6 +55,7 @@ namespace svx case SID_ATTR_CHAR_COLOR_BACKGROUND: case SID_ATTR_CHAR_BACK_COLOR: case SID_BACKGROUND_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: Update(NamedColor(COL_DEFAULT_HIGHLIGHT, SvxResId(RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT))); break; case SID_ATTR_LINE_COLOR: diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi index bb66c461644b..472198cdc922 100644 --- a/sw/sdi/_basesh.sdi +++ b/sw/sdi/_basesh.sdi @@ -206,6 +206,14 @@ interface BaseTextSelection DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + SID_TABLE_CELL_BACKGROUND_COLOR + [ + ExecMethod = ExecBckCol ; + StateMethod = GetBckColState ; + AutoUpdate ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_BACKGROUND_COLOR // status() [ ExecMethod = ExecBckCol ; diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index e6ad091274d2..618548977001 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2202,7 +2202,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) SelectionType nSelType(rSh.GetSelectionType()); SvxBrushItem aBrushItem(RES_BACKGROUND); - if( SelectionType::TableCell & nSelType ) + if( nWhich == SID_TABLE_CELL_BACKGROUND_COLOR ) { rSh.GetBoxBackground( aBrushItem ); } @@ -2230,6 +2230,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) switch(nWhich) { case SID_BACKGROUND_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: { SvxColorItem aColorItem(aBrushItem.GetColor(),SID_BACKGROUND_COLOR); rSet.Put(aColorItem); @@ -2255,14 +2256,14 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) const SfxItemSet* pArgs = rReq.GetArgs(); sal_uInt16 nSlot(rReq.GetSlot()); - if (!pArgs && nSlot != SID_BACKGROUND_COLOR) + if (!pArgs && ( nSlot != SID_BACKGROUND_COLOR || nSlot != SID_TABLE_CELL_BACKGROUND_COLOR ) ) { return; } SvxBrushItem aBrushItem(RES_BACKGROUND); - if( SelectionType::TableCell & nSelType ) + if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR ) { rSh.GetBoxBackground( aBrushItem ); } @@ -2288,12 +2289,13 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) switch(nSlot) { case SID_BACKGROUND_COLOR: + case SID_TABLE_CELL_BACKGROUND_COLOR: { aBrushItem.SetGraphicPos(GPOS_NONE); if(pArgs) { - const SvxColorItem& rNewColorItem = pArgs->Get(SID_BACKGROUND_COLOR); + const SvxColorItem& rNewColorItem = pArgs->Get(nSlot == SID_BACKGROUND_COLOR ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR ); const Color& rNewColor = rNewColorItem.GetValue(); aBrushItem.SetColor(rNewColor); GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem); @@ -2322,7 +2324,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) } } - if( SelectionType::TableCell & nSelType ) + if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR ) { rSh.SetBoxBackground( aBrushItem ); } diff --git a/sw/uiconfig/swriter/toolbar/tableobjectbar.xml b/sw/uiconfig/swriter/toolbar/tableobjectbar.xml index 75efbade4479..55297a1140df 100644 --- a/sw/uiconfig/swriter/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/tableobjectbar.xml @@ -42,7 +42,7 @@ <toolbar:toolbaritem xlink:href=".uno:CellVertCenter"/> <toolbar:toolbaritem xlink:href=".uno:CellVertBottom"/> <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:BackgroundColor"/> + <toolbar:toolbaritem xlink:href=".uno:TableCellBackgroundColor"/> <toolbar:toolbaritem xlink:href=".uno:AutoFormat"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SetBorderStyle"/> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
