emfio/qa/cppunit/emf/EmfImportTest.cxx |   45 +++++++++++++++-------------
 emfio/source/reader/emfreader.cxx      |   25 +++++++++------
 emfio/source/reader/mtftools.cxx       |    4 +-
 sc/source/filter/oox/stylesbuffer.cxx  |   46 ++++++++++++++++++++++------
 sc/source/filter/rtf/eeimpars.cxx      |    6 +++
 vcl/win/window/salframe.cxx            |   53 +++++++++++++++++++++------------
 6 files changed, 119 insertions(+), 60 deletions(-)

New commits:
commit 46c9c904af3b39b4a19169c9c5a48963f576facc
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Feb 10 10:50:24 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 13 20:56:00 2023 +0100

    sc: avoid divide by zero in ScEEImport::GraphicSize
    
    See 
https://crashreport.libreoffice.org/stats/signature/ScEEImport::GraphicSize(short,long,ScEEParseEntry%20*)
    
    Change-Id: Ia5acccb1118aff2486d23eabd536053e67f346ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146915
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index b9678e2fdd5f..e9ab9175ab8f 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -528,7 +528,13 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, 
ScEEParseEntry* pE )
     }
     // Distribute line height difference between all affected lines
     SCROW nRowSpan = pE->nRowOverlap;
+
+    assert(nRowSpan != 0);
+    if ( nRowSpan == 0 )
+        return bHasGraphics;
+
     nHeight /= nRowSpan;
+
     if ( nHeight == 0 )
         nHeight = 1; // For definite comparison
     for ( SCROW nR = nRow; nR < nRow + nRowSpan; nR++ )
commit d91caaf046912e082b986576801f9a4041cdb7d3
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Mon Feb 6 22:59:44 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 13 20:56:00 2023 +0100

    Resolves: tdf#139934 always apply cellXfs xf explicits (tdf#123139 related)
    
    Change-Id: Id1e12ee8677a25a645bfd53b4968a17c9a1eabe5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146599
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 909a25d30b09ebd3a023105a9c3cc4d20add094a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146533
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index 1819257383e1..1dbe7e658269 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1972,38 +1972,64 @@ void Xf::importXf( const AttributeList& rAttribs, bool 
bCellXf )
     // as xfId attribute is always created during export to .xlsx
     // Not setting "0" value is causing wrong .xlsx import by LibreOffice,
     // for spreadsheets created by external applications (ex. SAP BI).
+    bool bApplyDefault;
     if ( maModel.mbCellXf )
     {
-        maModel.mnStyleXfId = rAttribs.getInteger( XML_xfId, 0 );
+        const sal_Int32 xfId = rAttribs.getInteger( XML_xfId, -1 );
+        // No xfId => no cellStyleXfs that could overwrite this on change, thus
+        // has to be applied.
+        bApplyDefault = (xfId < 0);
+        maModel.mnStyleXfId = std::max<sal_Int32>(0, xfId);
     }
     else
     {
         maModel.mnStyleXfId = rAttribs.getInteger( XML_xfId, -1 );
+        bApplyDefault = true;
     }
     maModel.mnFontId = rAttribs.getInteger( XML_fontId, -1 );
     maModel.mnNumFmtId = rAttribs.getInteger( XML_numFmtId, -1 );
     maModel.mnBorderId = rAttribs.getInteger( XML_borderId, -1 );
     maModel.mnFillId = rAttribs.getInteger( XML_fillId, -1 );
 
-
-    maModel.mbAlignUsed = maModel.mbCellXf || 
rAttribs.getBool(XML_applyAlignment, true);
-    maModel.mbProtUsed = maModel.mbCellXf || 
rAttribs.getBool(XML_applyProtection, true);
-    /*  Default value of the apply*** attributes is dependent on context:
-        true in cellStyleXfs element, false in cellXfs element... */
-    maModel.mbFontUsed   = rAttribs.getBool( XML_applyFont,         
!maModel.mbCellXf );
-    maModel.mbNumFmtUsed = rAttribs.getBool( XML_applyNumberFormat, 
!maModel.mbCellXf );
-    maModel.mbBorderUsed = rAttribs.getBool( XML_applyBorder,       
!maModel.mbCellXf );
-    maModel.mbAreaUsed   = rAttribs.getBool( XML_applyFill,         
!maModel.mbCellXf );
+    // Default value of the apply*** attributes is dependent on context:
+    // true in cellStyleXfs element, false in cellXfs element...
+    // But it's not as easy as it sounds, for docs see
+    // 
https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/59922f8b-0edc-4e93-a822-9f22254aec46
+    // and apparently in reality cellStyleXfs xf and cellXfs xf are not merged
+    // at all, see
+    // 
https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/bcf98682-e8d3-44b8-b8f8-0bf696878ba1
+    // "b. The standard states that both the cell style xf records and cell xf
+    // records must be read to understand the full set of formatting applied to
+    // a cell."
+    // "In Office, only the cell xf record defines the formatting applied to a 
cell."
+
+    // So for reading documents this is all crap and effectively xf records
+    // apply their explicit properties by default unless denied.
+    // bApplyDefault==false only for cellXf xf with xfId.
+
+    // For cellXf xf, mbAlignUsed and mbProtUsed will be set when actually
+    // importing the element.
+    maModel.mbAlignUsed  = rAttribs.getBool( XML_applyAlignment,    
bApplyDefault);
+    maModel.mbProtUsed   = rAttribs.getBool( XML_applyProtection,   
bApplyDefault);
+
+    maModel.mbFontUsed   = rAttribs.getBool( XML_applyFont,         
bApplyDefault || maModel.mnFontId > 0);
+    maModel.mbNumFmtUsed = rAttribs.getBool( XML_applyNumberFormat, 
bApplyDefault || maModel.mnNumFmtId > 0);
+    maModel.mbBorderUsed = rAttribs.getBool( XML_applyBorder,       
bApplyDefault || maModel.mnBorderId > 0);
+    maModel.mbAreaUsed   = rAttribs.getBool( XML_applyFill,         
bApplyDefault || maModel.mnFillId > 0);
 }
 
 void Xf::importAlignment( const AttributeList& rAttribs )
 {
     maAlignment.importAlignment( rAttribs );
+    if (maModel.mbCellXf)
+        maModel.mbAlignUsed = true;
 }
 
 void Xf::importProtection( const AttributeList& rAttribs )
 {
     maProtection.importProtection( rAttribs );
+    if (maModel.mbCellXf)
+        maModel.mbProtUsed = true;
 }
 
 void Xf::importXf( SequenceInputStream& rStrm, bool bCellXf )
commit 5272654620af1f18e66cfedfc84c1aedefb2c280
Author:     Bartosz Kosiorek <gan...@poczta.onet.pl>
AuthorDate: Fri Feb 3 22:55:54 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 13 20:56:00 2023 +0100

    tdf#142018 Properly create Pen width if style is COSMETIC
    
    Change-Id: I6453058c4af352a3b0e14cbccbc1a67c73cd1426
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146551
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>
    (cherry picked from commit bbdbe8ea2ef176ef6f08b30b3c18876c2c4f0c22)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146808
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx 
b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 75f2b9001a08..e858fd7afc4d 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -180,14 +180,19 @@ void Test::testPolyPolygon()
     assertXPath(pDocument, aXPathPrefix + 
"mask/polypolygoncolor[2]/polypolygon", "path",
                 "m2574 13194v-12065h15303v12065z");
 
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 116);
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 44);
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[1]/polygon",
-                       "2574,13194 2574,1129 17877,1129 17877,13194");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"color", "#ffffff");
-
+                       "2574,13194 2574,1129");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"color", "#000000");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"width", "0");
+    assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[2]/polygon",
+                       "2574,1129 2574,1129");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"color", "#000000");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"width", "0");
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[10]/polygon",
-                       "8674,13194 8674,1129");
+                       "8674,1129 8674,1129");
     assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", 
"color", "#000000");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[10]/line", 
"width", "0");
 
     assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion", 28);
     assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[6]", 
"width", "459");
@@ -1547,7 +1552,7 @@ void Test::TestRoundRect()
 void Test::TestCreatePen()
 {
     // Check import of EMF image with records: RESTOREDC, SAVEDC, MOVETOEX, 
LINETO, POLYLINE16, EXTTEXTOUTW with DxBuffer
-    // The CREATEPEN record is used with PS_COSMETIC line style, which 
sometimes will be displayed as solid hairline
+    // The CREATEPEN record is used with PS_COSMETIC line style, and in this 
case width must be set to 0
     Primitive2DSequence aSequence = 
parseEmf(u"/emfio/qa/cppunit/emf/data/TestCreatePen.emf");
     CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
     drawinglayer::Primitive2dXmlDump dumper;
@@ -1556,29 +1561,29 @@ void Test::TestCreatePen()
 
     assertXPath(pDocument, aXPathPrefix + "mask/polypolygon", "path", "m0 
0h31250v18192h-31250z");
 
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 748);
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke", 3);
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[1]/polygon",
-                       "27875,16523 27875,1453");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"color", "#ff0000");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"width", "6");
+                       "17898,5693 20172,5693");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"color", "#008000");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[1]/line", 
"width", "0");
 
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[2]/polygon",
-                       "27975,16453 27875,16453");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"color", "#ff0000");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"width", "6");
+                       "17898,6959 20172,6959");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"color", "#000080");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[2]/line", 
"width", "0");
 
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonstroke[3]/polygon",
-                       "27925,16078 27875,16078");
+                       "17898,7381 20172,7381");
     assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", 
"color", "#ff0000");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", 
"width", "6");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonstroke[3]/line", 
"width", "0");
 
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 10);
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[5]", "color", 
"#008000");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline", 755);
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[5]", "color", 
"#ff0000");
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonhairline[5]/polygon",
-                       "25850,2179 25844,1958");
-    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[10]", "color", 
"#000080");
+                       "27925,16078 27875,16078");
+    assertXPath(pDocument, aXPathPrefix + "mask/polygonhairline[10]", "color", 
"#ff0000");
     assertXPathContent(pDocument, aXPathPrefix + 
"mask/polygonhairline[10]/polygon",
-                       "2025,1642 2025,1501");
+                       "27925,14180 27875,14180");
 
     assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion", 69);
     assertXPath(pDocument, aXPathPrefix + "mask/textsimpleportion[1]", 
"width", "374");
diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index c24a053d3bc1..be4c8319238b 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1154,13 +1154,17 @@ namespace emfio
                         mpInputStream->ReadUInt32(nIndex);
                         if ((nIndex & ENHMETA_STOCK_OBJECT) == 0)
                         {
-                            sal_uInt32 nStyle(0);
+                            sal_uInt32 nPenStyle(0);
                             sal_Int32 nPenWidth(0), nIgnored;
-                            
mpInputStream->ReadUInt32(nStyle).ReadInt32(nPenWidth).ReadInt32(nIgnored);
+                            
mpInputStream->ReadUInt32(nPenStyle).ReadInt32(nPenWidth).ReadInt32(nIgnored);
                             SAL_INFO("emfio", "\t\tIndex: " << nIndex << " 
Style: 0x" << std::hex
-                                                            << nStyle << 
std::dec
+                                                            << nPenStyle << 
std::dec
                                                             << " PenWidth: " 
<< nPenWidth);
-                            CreateObjectIndexed(nIndex, 
std::make_unique<WinMtfLineStyle>(ReadColor(), nStyle, nPenWidth));
+                            if ((nPenStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
+                                nPenStyle = PS_COSMETIC;
+                            if ((nPenStyle & PS_GEOMETRIC) == 0)
+                                nPenWidth = 0;
+                            CreateObjectIndexed(nIndex, 
std::make_unique<WinMtfLineStyle>(ReadColor(), nPenStyle, nPenWidth));
                         }
                     }
                     break;
@@ -1170,12 +1174,15 @@ namespace emfio
                         mpInputStream->ReadUInt32(nIndex);
                         if ((nIndex & ENHMETA_STOCK_OBJECT) == 0)
                         {
-                            sal_uInt32 offBmi, cbBmi, offBits, cbBits, nStyle, 
nWidth, nBrushStyle, elpNumEntries;
+                            sal_uInt32 offBmi, cbBmi, offBits, cbBits, 
nPenStyle, nWidth, nBrushStyle, elpNumEntries;
                             sal_Int32 elpHatch;
                             
mpInputStream->ReadUInt32(offBmi).ReadUInt32(cbBmi).ReadUInt32(offBits).ReadUInt32(cbBits);
-                            
mpInputStream->ReadUInt32(nStyle).ReadUInt32(nWidth).ReadUInt32(nBrushStyle);
-
-                            SAL_INFO("emfio", "\t\tStyle: 0x" << std::hex << 
nStyle << std::dec);
+                            
mpInputStream->ReadUInt32(nPenStyle).ReadUInt32(nWidth).ReadUInt32(nBrushStyle);
+                            SAL_INFO("emfio", "\t\tStyle: 0x" << std::hex << 
nPenStyle << std::dec);
+                            if ((nPenStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
+                                nPenStyle = PS_COSMETIC;
+                            if ((nPenStyle & PS_GEOMETRIC) == 0)
+                                nWidth = 0;
                             SAL_INFO("emfio", "\t\tWidth: " << nWidth);
                             Color aColorRef = ReadColor();
                             
mpInputStream->ReadInt32(elpHatch).ReadUInt32(elpNumEntries);
@@ -1183,7 +1190,7 @@ namespace emfio
                             if (!mpInputStream->good())
                                 bStatus = false;
                             else
-                                CreateObjectIndexed(nIndex, 
std::make_unique<WinMtfLineStyle>(aColorRef, nStyle, nWidth));
+                                CreateObjectIndexed(nIndex, 
std::make_unique<WinMtfLineStyle>(aColorRef, nPenStyle, nWidth));
                         }
                     }
                     break;
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 7f067e4fcd15..5b82c54daa21 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -791,12 +791,12 @@ namespace emfio
                 break;
                 case StockObject::WHITE_PEN :
                 {
-                    maLineStyle = WinMtfLineStyle( COL_WHITE );
+                    maLineStyle = WinMtfLineStyle(COL_WHITE, PS_COSMETIC, 0);
                 }
                 break;
                 case StockObject::BLACK_PEN :
                 {
-                    maLineStyle = WinMtfLineStyle( COL_BLACK );
+                    maLineStyle = WinMtfLineStyle(COL_BLACK, PS_COSMETIC, 0);
                 }
                 break;
                 case StockObject::NULL_PEN :
commit 9eeb19602622e13f636de1a43559002b1786f272
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Feb 12 20:21:35 2023 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 13 20:56:00 2023 +0100

    Resolves: tdf#153566 set darkmode menubar background color
    
    because we use it for custom menu titles backgrounds
    
    Change-Id: I1ae679bc032d29c4901befc2f1b0cbb53d0a5d1e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146801
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index dc804a76ab35..e6c8f8a48582 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2638,6 +2638,34 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings 
)
     Color aMenuBarRolloverTextColor;
     Color aHighlightTextColor = 
ImplWinColorToSal(GetSysColor(COLOR_HIGHLIGHTTEXT));
 
+    BOOL bFlatMenus = FALSE;
+    SystemParametersInfoW( SPI_GETFLATMENU, 0, &bFlatMenus, 0);
+    if( bFlatMenus )
+    {
+        aStyleSettings.SetUseFlatMenus( true );
+        // flat borders for our controls etc. as well in this mode (ie, no 3d 
borders)
+        // this is not active in the classic style appearance
+        aStyleSettings.SetUseFlatBorders( true );
+    }
+    else
+    {
+        aStyleSettings.SetUseFlatMenus( false );
+        aStyleSettings.SetUseFlatBorders( false );
+    }
+
+    if( bFlatMenus )
+    {
+        aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENUHILIGHT ) ) );
+        aStyleSettings.SetMenuBarRolloverColor( ImplWinColorToSal( 
GetSysColor( COLOR_MENUHILIGHT ) ) );
+        aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( 
COLOR_3DSHADOW ) ) );
+    }
+    else
+    {
+        aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( 
COLOR_HIGHLIGHT ) ) );
+        aStyleSettings.SetMenuBarRolloverColor( ImplWinColorToSal( 
GetSysColor( COLOR_HIGHLIGHT ) ) );
+        aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( 
COLOR_3DLIGHT ) ) );
+    }
+
     const bool bUseDarkMode(UseDarkMode());
 
     OUString sThemeName(!bUseDarkMode ? u"colibre" : u"colibre_dark");
@@ -2681,6 +2709,8 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
         hTheme = OpenThemeData(mhWnd, L"Toolbar");
         GetThemeColor(hTheme, 0, 0, TMT_FILLCOLOR, &color);
         aStyleSettings.SetInactiveTabColor( ImplWinColorToSal( color ) );
+        // see ImplDrawNativeControl for dark mode
+        aStyleSettings.SetMenuBarColor( aStyleSettings.GetWindowColor() );
         CloseThemeData(hTheme);
 
         if (hTheme = OpenThemeData(mhWnd, L"Textstyle"))
@@ -2707,6 +2737,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings 
)
         aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENUTEXT ) ) );
         aMenuBarTextColor = ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) );
         aMenuBarRolloverTextColor = aHighlightTextColor;
+        if( bFlatMenus )
+            aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENUBAR ) ) );
+        else
+            aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENU ) ) );
         aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() );
         aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
     }
@@ -2770,7 +2804,6 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
     aStyleSettings.SetHighlightTextColor(aHighlightTextColor);
     aStyleSettings.SetListBoxWindowHighlightColor( 
aStyleSettings.GetHighlightColor() );
     aStyleSettings.SetListBoxWindowHighlightTextColor( 
aStyleSettings.GetHighlightTextColor() );
-    aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
     aStyleSettings.SetMenuHighlightTextColor( 
aStyleSettings.GetHighlightTextColor() );
 
     ImplSVData* pSVData = ImplGetSVData();
@@ -2779,30 +2812,12 @@ void WinSalFrame::UpdateSettings( AllSettings& 
rSettings )
     pSVData->maNWFData.maMenuBarHighlightTextColor = COL_TRANSPARENT;
     GetSalData()->mbThemeMenuSupport = false;
     aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) 
) );
-    aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
-    aStyleSettings.SetMenuBarRolloverColor( aStyleSettings.GetHighlightColor() 
);
-    aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); 
// overridden below for flat menus
-    aStyleSettings.SetUseFlatBorders( false );
-    aStyleSettings.SetUseFlatMenus( false );
     
aStyleSettings.SetMenuBarHighlightTextColor(aStyleSettings.GetMenuHighlightTextColor());
     aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( 
COLOR_ACTIVECAPTION ) ) );
     aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( 
COLOR_CAPTIONTEXT ) ) );
     aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( 
COLOR_INACTIVECAPTION ) ) );
     aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( 
COLOR_INACTIVECAPTIONTEXT ) ) );
-    BOOL bFlatMenus = FALSE;
-    SystemParametersInfoW( SPI_GETFLATMENU, 0, &bFlatMenus, 0);
-    if( bFlatMenus )
-    {
-        aStyleSettings.SetUseFlatMenus( true );
-        aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENUBAR ) ) );
-        aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( 
COLOR_MENUHILIGHT ) ) );
-        aStyleSettings.SetMenuBarRolloverColor( ImplWinColorToSal( 
GetSysColor( COLOR_MENUHILIGHT ) ) );
-        aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( 
COLOR_3DSHADOW ) ) );
 
-        // flat borders for our controls etc. as well in this mode (ie, no 3d 
borders)
-        // this is not active in the classic style appearance
-        aStyleSettings.SetUseFlatBorders( true );
-    }
     aStyleSettings.SetCheckedColorSpecialCase( );
 
     // caret width

Reply via email to