drawinglayer/source/processor2d/cairopixelprocessor2d.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 1616c8c27c2f5d91b9f6b2ebac702ac51528eb8b
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Sun Jan 11 09:37:08 2026 +0200
Commit:     Tor Lillqvist <[email protected]>
CommitDate: Fri Feb 27 18:46:06 2026 +0100

    Build fix for Windows in an --enable-headless build, i.e. CODA-W
    
    No need to look up a cairo function dynamically as we know that in
    Windows we are using a cairo we build ourselves so we can be sure that
    it is has what we want.
    
    There is a TEXT() macro in winnt.h, and we use that (indirectly)
    elsewhere, so we can't just undefine it in postwin.h. Thus we can't
    initialise a variable calld TEXT using parentheses.
    
    Change-Id: I8987e3b33d51ea232f8262413d17a50910d8e7b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197007
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200640
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
index 15c477c2ccf6..26871b351307 100644
--- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
@@ -74,6 +74,7 @@ void impl_cairo_set_hairline(cairo_t* pRT,
                              const drawinglayer::geometry::ViewInformation2D& 
rViewInformation,
                              bool bCairoCoordinateLimitWorkaroundActive)
 {
+#ifndef _WIN32
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 18, 0)
     void* addr(dlsym(nullptr, "cairo_set_hairline"));
     if (nullptr != addr)
@@ -95,6 +96,13 @@ void impl_cairo_set_hairline(cairo_t* pRT,
                 .getLength());
         cairo_set_line_width(pRT, fPx);
     }
+#else
+    // No system cairo on Windows, so cairo is by necessity one built by us, 
and we know that it is
+    // the right version with cairo_set_hairline().
+    (void)rViewInformation;
+    (void)bCairoCoordinateLimitWorkaroundActive;
+    cairo_set_hairline(pRT, true);
+#endif
 }
 
 void addB2DPolygonToPathGeometry(cairo_t* pRT, const basegfx::B2DPolygon& 
rPolygon)
@@ -4447,8 +4455,8 @@ basegfx::BColor CairoPixelProcessor2D::getFillColor(const 
basegfx::BColor& rColo
 
 basegfx::BColor CairoPixelProcessor2D::getTextColor(const basegfx::BColor& 
rColor) const
 {
-    constexpr DrawModeFlags TEXT(DrawModeFlags::BlackText | 
DrawModeFlags::GrayText
-                                 | DrawModeFlags::SettingsText);
+    constexpr DrawModeFlags TEXT
+        = DrawModeFlags::BlackText | DrawModeFlags::GrayText | 
DrawModeFlags::SettingsText;
     const DrawModeFlags 
aDrawModeFlags(getViewInformation2D().getDrawModeFlags());
 
     if (!(aDrawModeFlags & TEXT))

Reply via email to