include/vcl/themecolors.hxx | 6 ++ svtools/source/config/colorcfg.cxx | 12 +++- sw/qa/extras/ooxmlexport/data/tdf170438_dropdown.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport25.cxx | 12 ++++ sw/source/filter/ww8/docxattributeoutput.cxx | 6 +- vcl/osx/salframe.cxx | 4 - vcl/osx/salnativewidgets.cxx | 12 ++-- vcl/qt5/QtCustomStyle.cxx | 3 - vcl/qt5/QtMenu.cxx | 6 -- vcl/unx/gtk3/custom-theme.cxx | 3 - vcl/unx/gtk3/salnativewidgets-gtk.cxx | 2 vcl/win/gdi/salnativewidgets-luna.cxx | 50 +++++++++---------- vcl/win/window/salframe.cxx | 4 - 13 files changed, 70 insertions(+), 50 deletions(-)
New commits: commit f0f3624aa39bf9e51dc01cf2799c6e624c92a9ea Author: Sahil Gautam <[email protected]> AuthorDate: Tue Jan 7 10:05:08 2025 +0530 Commit: Sahil Gautam <[email protected]> CommitDate: Mon Jan 26 09:31:15 2026 +0100 tdf#164393 ThemeColors refactor part 1 - Use a single `ThemeColors::VclPluginCanUseThemeColors()` check instead of `ThemeColors::IsThemeLoaded()` and then checking if the current scheme is Automatic or not Change-Id: I96294c3b4b75b5f2cee02c72a8b0dd1a85bedec4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179853 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit c398498fe155790a8e6510353427ffa5224343ac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198074 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Sahil Gautam <[email protected]> diff --git a/include/vcl/themecolors.hxx b/include/vcl/themecolors.hxx index 80f56db5e0e4..67551dbdac8d 100644 --- a/include/vcl/themecolors.hxx +++ b/include/vcl/themecolors.hxx @@ -28,6 +28,12 @@ public: return rThemeName == svtools::AUTOMATIC_COLOR_SCHEME; } + static bool VclPluginCanUseThemeColors() + { + return IsThemeLoaded() + && !ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName()); + }; + void SetWindowColor(const Color& rColor) { m_aWindowColor = rColor; } void SetWindowTextColor(const Color& rColor) { m_aWindowTextColor = rColor; } void SetBaseColor(const Color& rColor) { m_aBaseColor = rColor; } diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index b24e8974b972..b01dece4582d 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1566,7 +1566,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP StyleSettings aStyleSettings = rSettings.GetStyleSettings(); bool bUseDarkMode(GetUseDarkMode()); - if (!ThemeColors::IsThemeLoaded()) + if (!ThemeColors::VclPluginCanUseThemeColors()) { OUString sThemeName(!bUseDarkMode ? u"sukapura_svg" : u"sukapura_dark_svg"); aStyleSettings.SetPreferredIconTheme(sThemeName, bUseDarkMode); @@ -1740,7 +1740,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP aStyleSettings.SetHideDisabledMenuItems( true ); aStyleSettings.SetPreferredContextMenuShortcuts( false ); - if (ThemeColors::IsThemeLoaded()) + if (ThemeColors::VclPluginCanUseThemeColors()) lcl_LoadColorsFromTheme(aStyleSettings); rSettings.SetStyleSettings( aStyleSettings ); diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 7b9b9c15fea2..b5b7ba7789b6 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -440,7 +440,7 @@ static void drawBox(CGContextRef context, const NSRect& rc, NSColor* pColor) static void drawEditableBackground(CGContextRef context, const NSRect& rc) { CGContextSaveGState(context); - if (ThemeColors::IsThemeLoaded()) + if (ThemeColors::VclPluginCanUseThemeColors()) CGContextSetFillColorWithColor(context, colorFromRGB(ThemeColors::GetThemeColors().GetBaseColor()).CGColor); else CGContextSetFillColorWithColor(context, [NSColor controlBackgroundColor].CGColor); @@ -460,14 +460,14 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, AquaSalFrame* mpFrame) { bool bOK = false; - bool bThemeLoaded(ThemeColors::IsThemeLoaded()); + bool bCanUseThemeColors(ThemeColors::VclPluginCanUseThemeColors()); AquaSalInstance* pInst = GetSalData()->mpInstance; HIRect rc = ImplGetHIRectFromRectangle(rControlRegion); switch (nType) { case ControlType::Toolbar: { - if (bThemeLoaded) + if (bCanUseThemeColors) drawBox(context, rc, colorFromRGB(ThemeColors::GetThemeColors().GetWindowColor())); else drawBox(context, rc, NSColor.windowBackgroundColor); @@ -476,7 +476,7 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, break; case ControlType::WindowBackground: { - if (bThemeLoaded) + if (bCanUseThemeColors) drawBox(context, rc, colorFromRGB(ThemeColors::GetThemeColors().GetWindowColor())); else drawBox(context, rc, NSColor.windowBackgroundColor); @@ -487,7 +487,7 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, { rc.size.width += 2; rc.size.height += 2; - if (bThemeLoaded) + if (bCanUseThemeColors) drawBox(context, rc, colorFromRGB(ThemeColors::GetThemeColors().GetBaseColor())); else drawBox(context, rc, NSColor.controlBackgroundColor); @@ -755,7 +755,7 @@ bool AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType, ? static_cast<const ScrollbarValue *>(&aValue) : nullptr; if (nPart == ControlPart::DrawBackgroundVert || nPart == ControlPart::DrawBackgroundHorz) { - if (bThemeLoaded) + if (bCanUseThemeColors) drawBox(context, rc, colorFromRGB(ThemeColors::GetThemeColors().GetBaseColor())); else drawBox(context, rc, NSColor.controlBackgroundColor); diff --git a/vcl/qt5/QtCustomStyle.cxx b/vcl/qt5/QtCustomStyle.cxx index d3fdcd4c856a..ea2d4771019d 100644 --- a/vcl/qt5/QtCustomStyle.cxx +++ b/vcl/qt5/QtCustomStyle.cxx @@ -129,8 +129,7 @@ bool QtCustomStyle::IsSystemThemeChanged() void QtCustomStyle::LoadCustomStyle(bool bDarkMode) { - if (!ThemeColors::IsThemeLoaded() - || ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName())) + if (!ThemeColors::VclPluginCanUseThemeColors()) return; // don't set custom palette in case the system theme has been changed. diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx index b306e35eb54a..e90248a032e3 100644 --- a/vcl/qt5/QtMenu.cxx +++ b/vcl/qt5/QtMenu.cxx @@ -484,12 +484,10 @@ void QtMenu::SetFrame(const SalFrame* pFrame) void QtMenu::DoFullMenuUpdate(Menu* pMenuBar) { - if (mpQMenuBar && ThemeColors::IsThemeLoaded() - && !ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName())) + if (mpQMenuBar && ThemeColors::VclPluginCanUseThemeColors()) mpQMenuBar->setPalette(QtCustomStyle::GetMenuBarPalette()); - if (mpQMenu && ThemeColors::IsThemeLoaded() - && !ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName())) + if (mpQMenu && ThemeColors::VclPluginCanUseThemeColors()) mpQMenu->setPalette(QtCustomStyle::GetMenuPalette()); // clear action groups since menu is rebuilt diff --git a/vcl/unx/gtk3/custom-theme.cxx b/vcl/unx/gtk3/custom-theme.cxx index a5e7cb3a1f9a..f7892bd68568 100644 --- a/vcl/unx/gtk3/custom-theme.cxx +++ b/vcl/unx/gtk3/custom-theme.cxx @@ -95,8 +95,7 @@ void ApplyCustomTheme(GdkDisplay* pGdkDisplay, GtkCssProvider** pCustomThemeProv void ApplyCustomTheme(GdkScreen* pScreen, GtkCssProvider** pCustomThemeProvider) #endif { - if (!ThemeColors::IsThemeLoaded() - || ThemeColors::IsAutomaticTheme(ThemeColors::GetThemeColors().GetThemeName())) + if (!ThemeColors::VclPluginCanUseThemeColors()) return; if ((*pCustomThemeProvider) == nullptr) diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx index 9f5fac8a30af..c3bbda65728f 100644 --- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx @@ -2678,7 +2678,7 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) aStyleSet.SetMinThumbSize(min_slider_length); // preferred icon style - if (!ThemeColors::IsThemeLoaded()) + if (!ThemeColors::VclPluginCanUseThemeColors()) { gchar* pIconThemeName = nullptr; gboolean bDarkIconTheme = false; diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 6fd613acfaf0..3fe486289081 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -670,7 +670,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == ControlPart::Entire ) nType = ControlType::Editbox; - bool bThemeLoaded = ThemeColors::IsThemeLoaded(); + bool bCanUseThemeColors = ThemeColors::VclPluginCanUseThemeColors(); int iPart(0), iState(0); if( nType == ControlType::Scrollbar ) { @@ -687,7 +687,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = ABS_UPNORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -705,7 +705,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = ABS_DOWNNORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -723,7 +723,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = ABS_LEFTNORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -741,7 +741,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = ABS_RIGHTNORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -764,7 +764,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, GetThemePartSize(hTheme, hDC, iPart, iState, nullptr, TS_TRUE, &sz); GetThemePartSize(hTheme, hDC, iPart, iState, nullptr, TS_DRAW, &sz); - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -798,7 +798,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = SCRBS_NORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); hr = DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr); @@ -929,7 +929,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = PBS_NORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); @@ -995,7 +995,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = EPSN_NORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); @@ -1029,7 +1029,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, { // tabpane in tabcontrols gets drawn in "darkmode" as if it was a // a "light" theme, so bodge this by drawing a frame directly - if (bThemeLoaded || bUseDarkMode) + if (bCanUseThemeColors || bUseDarkMode) { Color aColor(Application::GetSettings().GetStyleSettings().GetDisableColor()); ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), @@ -1045,7 +1045,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nType == ControlType::TabBody ) { // tabbody in main window gets drawn in white in "darkmode", so bodge this here - if (bThemeLoaded || bUseDarkMode) + if (bCanUseThemeColors || bUseDarkMode) { Color aColor(Application::GetSettings().GetStyleSettings().GetWindowColor()); ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), @@ -1105,7 +1105,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, // tabitem in tabcontrols gets drawn in "darkmode" as if it was a // a "light" theme, so bodge this by drawing with a button instead - if (bThemeLoaded || bUseDarkMode) + if (bCanUseThemeColors || bUseDarkMode) { Color aColor; if (iState == TILES_SELECTED) @@ -1155,7 +1155,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = bChecked ? TS_CHECKED : TS_NORMAL; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, iPart, iState, rc); if (bUseDarkMode && (bChecked || (nState & (ControlState::PRESSED) || (nState & ControlState::ROLLOVER)))) @@ -1200,7 +1200,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } // toolbar in main window gets drawn in white in "darkmode", so bodge this here - if (bThemeLoaded || bUseDarkMode) + if (bCanUseThemeColors || bUseDarkMode) { Color aColor(Application::GetSettings().GetStyleSettings().GetWindowColor()); ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), @@ -1232,10 +1232,10 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well // menubar in main window gets drawn in white in "darkmode", so bodge this here - if (bThemeLoaded || bUseDarkMode) + if (bCanUseThemeColors || bUseDarkMode) { Color aColor - = bThemeLoaded + = bCanUseThemeColors ? ThemeColors::GetThemeColors().GetMenuBarColor() : Application::GetSettings().GetStyleSettings().GetWindowColor(); ScopedHBRUSH hbrush(CreateSolidBrush(RGB(aColor.GetRed(), @@ -1266,12 +1266,12 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = MBI_NORMAL; - if (bThemeLoaded + if (bCanUseThemeColors || (GetSalData()->mbThemeMenuSupport && Application::GetSettings().GetStyleSettings().GetHighContrastMode() && (nState & (ControlState::SELECTED | nState & ControlState::ROLLOVER)))) { - Color aColor = bThemeLoaded + Color aColor = bCanUseThemeColors ? ThemeColors::GetThemeColors().GetMenuBarHighlightColor() : Application::GetSettings().GetStyleSettings().GetHighlightColor(); @@ -1417,7 +1417,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, aGutterRC.right = aGutterRC.left+3; } - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, MENU_POPUPBACKGROUND, iState, rc); return @@ -1432,7 +1432,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, else iState = (nState & ControlState::SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED; - if (bThemeLoaded) + if (bCanUseThemeColors) return drawThemedControl(hDC, nType, MENU_POPUPITEM, iState, rc); return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption ); @@ -1905,17 +1905,17 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings ) Color aMenuBarTextColor = aStyleSettings.GetMenuTextColor(); // in aero menuitem highlight text is drawn in the same color as normal // high contrast highlight color is not related to persona and not apply blur or transparency - bool bThemeLoaded = ThemeColors::IsThemeLoaded(); - if( bThemeLoaded || !aStyleSettings.GetHighContrastMode() ) + bool bCanUseThemeColors = ThemeColors::VclPluginCanUseThemeColors(); + if( bCanUseThemeColors || !aStyleSettings.GetHighContrastMode() ) { const ThemeColors& rThemeColors = ThemeColors::GetThemeColors(); - aStyleSettings.SetMenuHighlightTextColor(bThemeLoaded + aStyleSettings.SetMenuHighlightTextColor(bCanUseThemeColors ? rThemeColors.GetMenuHighlightTextColor() : aStyleSettings.GetMenuTextColor()); aStyleSettings.SetMenuBarRolloverTextColor( - bThemeLoaded ? rThemeColors.GetMenuBarHighlightTextColor() : aMenuBarTextColor); + bCanUseThemeColors ? rThemeColors.GetMenuBarHighlightTextColor() : aMenuBarTextColor); aStyleSettings.SetMenuBarHighlightTextColor( - bThemeLoaded ? rThemeColors.GetMenuBarHighlightTextColor() : aMenuBarTextColor); + bCanUseThemeColors ? rThemeColors.GetMenuBarHighlightTextColor() : aMenuBarTextColor); } pSVData->maNWFData.mnMenuFormatBorderX = 2; diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 4012551c514e..d7a137f7a65a 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2774,7 +2774,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) } const bool bUseDarkMode(UseDarkMode()); - if (!ThemeColors::IsThemeLoaded()) + if (!ThemeColors::VclPluginCanUseThemeColors()) { OUString sThemeName(!bUseDarkMode ? u"colibre" : u"colibre_dark"); aStyleSettings.SetPreferredIconTheme(sThemeName, bUseDarkMode); @@ -3016,7 +3016,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) // otherwise, menu shows up as white in dark mode aStyleSettings.SetMenuColor(aStyleSettings.GetWindowColor()); - if (ThemeColors::IsThemeLoaded()) + if (ThemeColors::VclPluginCanUseThemeColors()) lcl_LoadColorsFromTheme(aStyleSettings); rSettings.SetMouseSettings( aMouseSettings ); commit e63f7d3ddeaba6a7665ce1a3bdabef4202bc5e16 Author: Justin Luth <[email protected]> AuthorDate: Thu Jan 22 13:22:17 2026 -0500 Commit: Miklos Vajna <[email protected]> CommitDate: Mon Jan 26 09:30:24 2026 +0100 tdf#170438 docx export: never export listItem with empty displayText MS Word was reporting a document as corrupt after LO round-tripped it with an empty displayText. However, an empty w:value is not a 'corrupt' result. Note that this situation was possible also while importing DOCX. We don't always import SDTs as content controls (e.g. in tables). In that case, only the 'values' are considered, so an empty entry is created in the dropdown field, which then got exported as an empty displayText. make CppunitTest_sw_ooxmlexport25 \ CPPUNIT_TEST_NAME=testTdf170438_dropdown ooxmlexport13's tdf119809.docx is a VML shape that is called a combobox, and it exported with WritePostponedFormControl. It sounds like it can only have 'values' when added by a VBA macro, so likely these will almost never output a displayText. Change-Id: Ib306eda90b4179e10402c276e7c47a3bfdd83cfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197867 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins (cherry picked from commit 270fe90efbb275a670d063303e395ed88ea4731d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198025 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf170438_dropdown.odt b/sw/qa/extras/ooxmlexport/data/tdf170438_dropdown.odt new file mode 100644 index 000000000000..02bbe360bf25 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf170438_dropdown.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx index 48105aa5e2b0..5ad2011bbb5e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx @@ -109,6 +109,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf165478_bottomAligned, "tdf165478_bottomAligned.d CPPUNIT_ASSERT_EQUAL(nCellBottom, nTextBottom); } +CPPUNIT_TEST_FIXTURE(Test, testTdf170438_dropdown) +{ + createSwDoc("tdf170438_dropdown.odt"); + + saveAndReload(u"Office Open XML Text"_ustr); + + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); + // MS Word reports document as corrupt if displayText is empty + assertXPath(pXmlDoc, "//w:listItem[1]", "displayText", u" "); + assertXPath(pXmlDoc, "//w:listItem[1]", "value", u""); // value may be empty +} + CPPUNIT_TEST_FIXTURE(Test, testTdf170389_manyTabstops) { createSwDoc("tdf170389_manyTabstops.odt"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 5c8793911fbf..67a7884ea2b2 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2896,9 +2896,10 @@ void DocxAttributeOutput::WriteSdtDropDownStart( for (auto const& rItem : rListItems) { auto const item(OUStringToOString(rItem, RTL_TEXTENCODING_UTF8)); + OString sDisplayText = item.isEmpty() ? " "_ostr : item; // displayText must not be empty m_pSerializer->singleElementNS(XML_w, XML_listItem, FSNS(XML_w, XML_value), item, - FSNS(XML_w, XML_displayText), item); + FSNS(XML_w, XML_displayText), sDisplayText); } m_pSerializer->endElementNS(XML_w, XML_dropDownList); @@ -5909,8 +5910,9 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) for (const auto& rItem : aItems) { + OUString sDisplayText = rItem.isEmpty() ? " " : rItem; // displayText must not be empty m_pSerializer->singleElementNS(XML_w, XML_listItem, - FSNS(XML_w, XML_displayText), rItem, + FSNS(XML_w, XML_displayText), sDisplayText, FSNS(XML_w, XML_value), rItem); } commit 62914a17f1cbdb9d0ea4aa3efe44b39e0872f435 Author: Sahil Gautam <[email protected]> AuthorDate: Tue Jan 7 10:48:38 2025 +0530 Commit: Sahil Gautam <[email protected]> CommitDate: Mon Jan 26 09:29:33 2026 +0100 tdf#164393 Format the code to make clang-format happy Change-Id: I1a07935757752c64e86e779a6f3b3c925774c6d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179852 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 7970a121a83653474e696550f91c5e7b963674e8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198073 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Sahil Gautam <[email protected]> diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index c3cd4a936983..50a70df6fd8c 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -454,7 +454,8 @@ void ColorConfig::LoadThemeColorsFromRegistry() rThemeColors.SetMenuBarColor(GetColorValue(svtools::MENUBARCOLOR).nColor); rThemeColors.SetMenuBarTextColor(GetColorValue(svtools::MENUBARTEXTCOLOR).nColor); rThemeColors.SetMenuBarHighlightColor(GetColorValue(svtools::MENUBARHIGHLIGHTCOLOR).nColor); - rThemeColors.SetMenuBarHighlightTextColor(GetColorValue(svtools::MENUBARHIGHLIGHTTEXTCOLOR).nColor); + rThemeColors.SetMenuBarHighlightTextColor( + GetColorValue(svtools::MENUBARHIGHLIGHTTEXTCOLOR).nColor); rThemeColors.SetMenuColor(GetColorValue(svtools::MENUCOLOR).nColor); rThemeColors.SetMenuTextColor(GetColorValue(svtools::MENUTEXTCOLOR).nColor); rThemeColors.SetMenuHighlightColor(GetColorValue(svtools::MENUHIGHLIGHTCOLOR).nColor); @@ -467,9 +468,12 @@ void ColorConfig::LoadThemeColorsFromRegistry() // as more controls support it, we might want to have ColorConfigValue entries in ThemeColors // instead of just colors. for now that seems overkill for just one control. - rThemeColors.SetAppBackBitmapFileName(m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).sBitmapFileName); - rThemeColors.SetAppBackUseBitmap(m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).bUseBitmapBackground); - rThemeColors.SetAppBackBitmapStretched(m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).bIsBitmapStretched); + rThemeColors.SetAppBackBitmapFileName( + m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).sBitmapFileName); + rThemeColors.SetAppBackUseBitmap( + m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).bUseBitmapBackground); + rThemeColors.SetAppBackBitmapStretched( + m_pImpl->GetColorConfigValue(svtools::APPBACKGROUND).bIsBitmapStretched); ThemeColors::SetThemeLoaded(true); }
