From 5ab0e302b5319c27292b49eeec9877582f1f77e3 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sat, 15 Feb 2020 14:52:59 +0300
Subject: Make Elementary the default on Haiku


diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index 253242b..6b55799 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -56,6 +56,9 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& desktopEnvi
 #ifdef _WIN32
     (void)desktopEnvironment;
     return "colibre";
+#elif defined(__HAIKU__)
+    (void)desktopEnvironment;
+    return "elementary";
 #else
     OUString r;
     if ( desktopEnvironment.equalsIgnoreAsciiCase("plasma5") ||
-- 
2.30.2


From 1bedbb1c2eaa36d0e1d2b875b5e125c90045fd47 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 7 Aug 2020 12:14:40 +0300
Subject: Show used vcl backend in About window on Haiku


diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 79d6dfa..6071ffe 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1195,7 +1195,7 @@ OUString Application::GetHWOSConfInfo(const int bSelection, const bool bLocalize
 #endif
             appendDetails(u"", Localize(SV_APP_DEFAULT, bLocalize));
 
-#if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__)
+#if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__  || defined __HAIKU__)
         appendDetails(u"; ", SV_APP_VCLBACKEND + GetToolkitName());
 #endif
     }
-- 
2.30.2


From 7c49d4b9b8e1b6669d0739318321c71e4e4c4efd Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Wed, 24 Oct 2018 17:01:34 +0300
Subject: Identify Haiku in about window


diff --git a/vcl/unx/generic/app/geninst.cxx b/vcl/unx/generic/app/geninst.cxx
index 0093f64..04042bd 100644
--- a/vcl/unx/generic/app/geninst.cxx
+++ b/vcl/unx/generic/app/geninst.cxx
@@ -26,6 +26,11 @@
 #  include <sys/utsname.h>
 #endif
 
+#if defined(__HAIKU__)
+#  include <sys/utsname.h>
+#  include <private/libroot/system_revision.h>
+#endif
+
 #include <config_features.h>
 #if HAVE_FEATURE_OPENGL
 #include <vcl/opengl/OpenGLContext.hxx>
@@ -89,6 +94,16 @@ OUString SalGenericInstance::getOSVersion()
     }
     return OUString::createFromAscii( stName.sysname ) + " " +
         aKernelVer.copy( 0, nIndex );
+#elif defined(__HAIKU__)
+    struct utsname stName;
+    if ( uname( &stName ) != 0 )
+        return aKernelVer;
+
+	const char *haikuRevision = __get_haiku_revision();
+	if (haikuRevision[0] != '\0')
+		return OUString::createFromAscii( stName.sysname ) + " " + OUString::createFromAscii(haikuRevision);
+
+	return OUString::createFromAscii( stName.sysname );
 #else
     return aKernelVer;
 #endif
-- 
2.30.2


From dd1936ff5962dfcd89a0a9fd972d7675cc846623 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sat, 15 Feb 2020 15:04:53 +0300
Subject: Implement ShellExec on Haiku


diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index 87b78fe..7588126 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -171,6 +171,9 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
             aBuffer.append(" -R");
         }
         aBuffer.append(" --");
+
+#elif __HAIKU__
+		aBuffer.append("open");
 #else
         // Just use xdg-open on non-Mac
         aBuffer.append("xdg-open");
-- 
2.30.2


From dfec624de1fc74f21a29fcb3b7ef322ceb90a845 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sat, 20 Jul 2019 01:18:50 +0300
Subject: Comment out linking with pthread


diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 4a96547..49f872b 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -45,9 +45,9 @@ gb_CFLAGS := \
 # At least libstdc++ (which is approximated here with !HAVE_LIBCXX) needs -pthread when including
 # various C++ headers like <thread>, see <https://gcc.gnu.org/onlinedocs/gcc-8.3.0/libstdc++/manual/
 # manual/using.html#manual.intro.using.flags>:
-ifeq ($(HAVE_LIBCXX),)
-gb_CXX_LINKFLAGS := -pthread
-endif
+#ifeq ($(HAVE_LIBCXX),)
+#gb_CXX_LINKFLAGS := -pthread
+#endif
 
 gb_CXXFLAGS := \
 	$(gb_CXXFLAGS_COMMON) \
-- 
2.30.2


From baae0c588fc4ccf6d9e02ce1b615ce09fe56fb9c Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 11 Aug 2019 11:47:40 +1000
Subject: Add XP_HAIKU defs for xmlsec


diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 17d64fe..5693089 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -184,6 +184,12 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
     svl/source/uno/pathservice \
 ))
 
+ifeq ($(OS),HAIKU)
+$(eval $(call gb_Library_add_defs,svl,\
+    -DXP_HAIKU=1 \
+))
+endif
+
 ifeq ($(OS),WNT)
 $(eval $(call gb_Library_add_exception_objects,svl,\
     svl/source/svdde/ddecli \
diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk
index 450e19b..568ff83 100644
--- a/xmlsecurity/Library_xsec_xmlsec.mk
+++ b/xmlsecurity/Library_xsec_xmlsec.mk
@@ -124,6 +124,12 @@ endif
 
 else # !$(OS),WNT
 
+ifeq ($(OS),HAIKU)
+$(eval $(call gb_Library_add_defs,xsec_xmlsec,\
+	-DXP_HAIKU=1 \
+))
+endif
+
 ifeq ($(SYSTEM_XMLSEC),)
 $(eval $(call gb_Library_add_libs,xsec_xmlsec,\
        $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
-- 
2.30.2


From ee13859a22ee1df556c28afe1d71f7e28ac88e85 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 7 Aug 2020 12:37:45 +0300
Subject: Cast to boolean


diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 8807927..c570173 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -172,13 +172,13 @@ static void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputS
     rContext.aOwner.set(&rContext.cinfo);
     jpeg_svstream_src(&rContext.cinfo, pInputStream);
     SourceManagerStruct *source = reinterpret_cast<SourceManagerStruct*>(rContext.cinfo.src);
-    jpeg_read_header(&rContext.cinfo, TRUE);
+    jpeg_read_header(&rContext.cinfo, static_cast<boolean>(TRUE));
 
     rContext.cinfo.scale_num = 1;
     rContext.cinfo.scale_denom = 1;
     rContext.cinfo.output_gamma = 1.0;
-    rContext.cinfo.raw_data_out = FALSE;
-    rContext.cinfo.quantize_colors = FALSE;
+    rContext.cinfo.raw_data_out = static_cast<boolean>(FALSE);
+    rContext.cinfo.quantize_colors = static_cast<boolean>(FALSE);
 
     jpeg_calc_output_dimensions(&rContext.cinfo);
 
@@ -372,7 +372,7 @@ bool WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream,
     }
 
     jpeg_set_defaults( &cinfo );
-    jpeg_set_quality( &cinfo, static_cast<int>(nQualityPercent), FALSE );
+    jpeg_set_quality( &cinfo, static_cast<int>(nQualityPercent), static_cast<boolean>(FALSE) );
 
     if (o3tl::convertsToAtMost(rPPI.getX(), 65535) && o3tl::convertsToAtMost(rPPI.getY(), 65535))
     {
@@ -404,7 +404,7 @@ bool WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream,
         cinfo.comp_info[0].v_samp_factor = 2;
     }
 
-    jpeg_start_compress( &cinfo, TRUE );
+    jpeg_start_compress( &cinfo, static_cast<boolean>(TRUE) );
 
     for( nY = 0; nY < nHeight; nY++ )
     {
@@ -439,10 +439,10 @@ void Transform(void* pInputStream, void* pOutputStream, Degree10 nAngle)
     jvirt_barray_ptr* aSourceCoefArrays      = nullptr;
     jvirt_barray_ptr* aDestinationCoefArrays = nullptr;
 
-    aTransformOption.force_grayscale = FALSE;
-    aTransformOption.trim            = FALSE;
-    aTransformOption.perfect         = FALSE;
-    aTransformOption.crop            = FALSE;
+    aTransformOption.force_grayscale = static_cast<boolean>(FALSE);
+    aTransformOption.trim            = static_cast<boolean>(FALSE);
+    aTransformOption.perfect         = static_cast<boolean>(FALSE);
+    aTransformOption.crop            = static_cast<boolean>(FALSE);
 
     // Angle to transform option
     // 90 Clockwise = 270 Counterclockwise
@@ -471,7 +471,7 @@ void Transform(void* pInputStream, void* pOutputStream, Degree10 nAngle)
     aDestinationInfo.err->error_exit     = errorExit;
     aDestinationInfo.err->output_message = outputMessage;
 
-    aDestinationInfo.optimize_coding = TRUE;
+    aDestinationInfo.optimize_coding = static_cast<boolean>(TRUE);
 
     JpegDecompressOwner aDecompressOwner;
     JpegCompressOwner aCompressOwner;
@@ -497,7 +497,7 @@ void Transform(void* pInputStream, void* pOutputStream, Degree10 nAngle)
     jpeg_svstream_src (&aSourceInfo, pInputStream);
 
     jcopy_markers_setup(&aSourceInfo, aCopyOption);
-    jpeg_read_header(&aSourceInfo, TRUE);
+    jpeg_read_header(&aSourceInfo, static_cast<boolean>(TRUE));
     jtransform_request_workspace(&aSourceInfo, &aTransformOption);
 
     aSourceCoefArrays = jpeg_read_coefficients(&aSourceInfo);
@@ -507,7 +507,7 @@ void Transform(void* pInputStream, void* pOutputStream, Degree10 nAngle)
     jpeg_svstream_dest (&aDestinationInfo, pOutputStream);
 
     // Compute optimal Huffman coding tables instead of precomputed tables
-    aDestinationInfo.optimize_coding = TRUE;
+    aDestinationInfo.optimize_coding = static_cast<boolean>(TRUE);
     jpeg_write_coefficients(&aDestinationInfo, aDestinationCoefArrays);
     jcopy_markers_execute(&aSourceInfo, &aDestinationInfo, aCopyOption);
     jtransform_execute_transformation(&aSourceInfo, &aDestinationInfo, aSourceCoefArrays, &aTransformOption);
-- 
2.30.2


From c6d997672800388b766a33b1855c568935abe761 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 8 Feb 2021 15:50:11 +1000
Subject: Use dpi=100 for qt5 backend


diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index a2730be..9be0a6e 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -747,6 +747,10 @@ void Qt5Graphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
         rDPIX = rDPIY = sForceDPI.toInt32();
         return;
     }
+#ifdef __HAIKU__
+    rDPIX = rDPIY = 100;
+    return;
+#endif
 
     if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle())
         return;
-- 
2.30.2


From 117aec49dfca2c4be21e16539e40824fe1f91ea9 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 8 Feb 2021 15:52:13 +1000
Subject: Disable hidpi for Haiku


diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index bf8d529..e8dca9a 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -637,10 +637,11 @@ void Qt5Instance::MoveFakeCmdlineArgs(std::unique_ptr<char* []>& rFakeArgv,
 
 std::unique_ptr<QApplication> Qt5Instance::CreateQApplication(int& nArgc, char** pArgv)
 {
+#ifndef __HAIKU__
     QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
     // for scaled icons in the native menus
     QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-
+#endif
     FreeableCStr session_manager;
     if (getenv("SESSION_MANAGER") != nullptr)
     {
-- 
2.30.2


From afd76d862076e22b2e042065bb9bf426687ffd67 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 8 Feb 2021 21:47:12 +1000
Subject: Don't use fontconfig


diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index b429485..0719575 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -111,10 +111,10 @@ void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
         const OString& rFileName = rMgr.getFontFileSysPath(aInfo.m_nID);
         rFontManager.AddFontFile(rFileName, nFaceNum, nVariantNum, aInfo.m_nID, aDFA);
     }
-
+#ifndef __HAIKU__
     if (bUseFontconfig)
         SalGenericInstance::RegisterFontSubstitutors(pPFC);
-
+#endif
     for (auto& family : aFDB.families())
         for (auto& style : aFDB.styles(family))
             pPFC->Add(Qt5FontFace::fromQFontDatabase(family, style));
-- 
2.30.2


From 560b63239cf935af041793ed25e7115b9bb0337a Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 7 Aug 2020 12:47:56 +0300
Subject: Revert fstack-protector check removal in
 9db11a8ab648f4d04e59e6bb94cd640f64835447


diff --git a/config_host.mk.in b/config_host.mk.in
index 8bce24c..783a2f0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -266,6 +266,7 @@ export HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=@HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZE
 export HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=@HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW@
 export HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
+export HAVE_GCC_STACK_PROTECTOR_STRONG=@HAVE_GCC_STACK_PROTECTOR_STRONG@
 export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
 export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
 export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
diff --git a/configure.ac b/configure.ac
index b629d5a..828fa22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6993,6 +6993,17 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
         AC_MSG_RESULT([no])
     fi
 
+    AC_MSG_CHECKING([whether $CC_BASE supports -fstack-protector-strong])
+    save_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS -O0 -Werror -fstack-protector-strong"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; a[7] = 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
+    CFLAGS=$save_CFLAGS
+    if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+    fi
+
     AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
     int v = 0;
@@ -7130,6 +7141,7 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
 fi
 
 AC_SUBST(HAVE_GCC_AVX)
+AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
 
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 09ca90a..9248195 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -62,7 +62,7 @@ gb_CFLAGS_COMMON := \
 	-fmessage-length=0 \
 	-fno-common \
 	-pipe \
-	$(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong) \
+	$(if $(or $(filter EMSCRIPTEN,$(OS)),$(filter HAIKU,$(OS))),-fno-stack-protector,-fstack-protector-strong) \
 	$(if $(gb_COLOR),-fdiagnostics-color=always) \
 
 gb_CXXFLAGS_COMMON := \
@@ -79,7 +79,7 @@ gb_CXXFLAGS_COMMON := \
 	-fmessage-length=0 \
 	-fno-common \
 	-pipe \
-	$(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong) \
+	$(if $(or $(filter EMSCRIPTEN,$(OS)),$(filter HAIKU,$(OS))),-fno-stack-protector,-fstack-protector-strong) \
 	$(if $(gb_COLOR),-fdiagnostics-color=always) \
 
 ifeq ($(HAVE_WDEPRECATED_COPY_DTOR),TRUE)
@@ -144,7 +144,7 @@ endif
 gb_VISIBILITY_FLAGS_CXX := -fvisibility-inlines-hidden
 gb_CXXFLAGS_COMMON += $(gb_VISIBILITY_FLAGS_CXX)
 
-gb_LinkTarget_LDFLAGS += $(if $(filter EMSCRIPTEN,$(OS)),-fno-stack-protector,-fstack-protector-strong)
+gb_LinkTarget_LDFLAGS += $(if $(or $(filter EMSCRIPTEN,$(OS)),$(filter HAIKU,$(OS))),-fno-stack-protector,-fstack-protector-strong)
 
 ifneq ($(gb_ENABLE_PCH),)
 ifeq ($(COM_IS_CLANG),TRUE)
-- 
2.30.2


From bf6d867eb750ebe9e5d1b3464f0b775807a71172 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 20 Aug 2021 23:33:13 +1000
Subject: Revert Qt::Popup window handling


diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 02032d1..e0000bd 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -144,7 +144,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
         else if ((nStyle & SalFrameStyleFlags::FLOAT)
                  && (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
             aWinFlags |= Qt::Tool | Qt::FramelessWindowHint;
-        else if (nStyle & SalFrameStyleFlags::TOOLTIP)
+        else if (nStyle & (nStyle & SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::TOOLTIP))
             aWinFlags |= Qt::ToolTip;
         else if ((nStyle & SalFrameStyleFlags::FLOAT)
                  && !(nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index ebb11ce..dcbc2cc 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -177,14 +177,7 @@ void Qt5Widget::handleMouseButtonEvent(const Qt5Frame& rFrame, const QMouseEvent
     rFrame.CallCallback(nEventType, &aEvent);
 }
 
-void Qt5Widget::mousePressEvent(QMouseEvent* pEvent)
-{
-    if ((windowFlags() & Qt::Popup)
-        && !geometry().translated(geometry().topLeft() * -1).contains(pEvent->pos()))
-        close();
-    else
-        handleMousePressEvent(m_rFrame, pEvent);
-}
+void Qt5Widget::mousePressEvent(QMouseEvent* pEvent) { handleMousePressEvent(m_rFrame, pEvent); }
 
 void Qt5Widget::mouseReleaseEvent(QMouseEvent* pEvent)
 {
@@ -608,8 +601,7 @@ Qt5Widget::Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f)
 {
     create();
     setMouseTracking(true);
-    if (!(f & Qt::Popup))
-        setFocusPolicy(Qt::StrongFocus);
+    setFocusPolicy(Qt::StrongFocus);
 }
 
 static ExtTextInputAttr lcl_MapUndrelineStyle(QTextCharFormat::UnderlineStyle us)
-- 
2.30.2


From 1123e2cb9c5754f813da94ddfbf36fe0d35dfcbb Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Tue, 14 Sep 2021 12:20:48 +0200
Subject: Adapt to Bison 3.8 internal yyn -> yyrule rename

see
<https://git.savannah.gnu.org/cgit/bison.git/commit/?id=f30067ed51f23802fc91761ede1506dfa72b2865>
"glr2.cc: log the execution of deferred actions" including "Rename argument yyn
as yyrule for clarity."

YYBISON was defined as 1 rather than as a representation of the Bison version
prior to
<https://git.savannah.gnu.org/cgit/bison.git/commit/?id=21c147b6e5372563b7c4741deadaddb9354f4b09>
"yacc.c: provide the Bison version as an integral macro", which shouldn't be a
problem here.  And YYBISON is apparently completely undefined with
/usr/bin/bison on macOS.

(The preceding comment always mentioned "yyi" and "yyrmap" in apparent mismatch
with the actually used "yyn" and "yyr1" ever since
c25ec0608a167bcf1d891043f02273761c351701 "initial import", so just leave it
untouched.)

Change-Id: I4f901407aa21ed4abec84e661d813ee7599f02f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122082
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 45227d9b79dc4f2a2aa6874cd4e3c02b7934b197)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122069
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>

diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index d14f36e..c4be0bc 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -74,9 +74,15 @@ inline connectivity::OSQLInternalNode* newNode(const OUString& _newValue,
 
 // yyi is the internal number of the rule that is currently being reduced
 // This can be mapped to external rule number via the yyrmap.
+#if defined YYBISON && YYBISON >= 30800
+#define SQL_NEW_RULE 			newNode("", SQLNodeType::Rule, yyr1[yyrule])
+#define SQL_NEW_LISTRULE 		newNode("", SQLNodeType::ListRule, yyr1[yyrule])
+#define SQL_NEW_COMMALISTRULE   newNode("", SQLNodeType::CommaListRule, yyr1[yyrule])
+#else
 #define SQL_NEW_RULE 			newNode("", SQLNodeType::Rule, yyr1[yyn])
 #define SQL_NEW_LISTRULE 		newNode("", SQLNodeType::ListRule, yyr1[yyn])
 #define SQL_NEW_COMMALISTRULE   newNode("", SQLNodeType::CommaListRule, yyr1[yyn])
+#endif
 
 
 extern connectivity::OSQLParser* xxx_pGLOBAL_SQLPARSER;
-- 
2.30.2

