sw/qa/extras/ooxmlexport/data/tdf135906.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |    5 +++++
 sw/source/filter/ww8/docxsdrexport.cxx       |    1 +
 vcl/qt5/QtGraphics_GDI.cxx                   |    9 ++++++++-
 vcl/qt5/QtSvpGraphics.cxx                    |    9 ++++++++-
 5 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 0afd2d3bfa9d55249ffd1408681ff04decf2d8fa
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Thu Nov 18 11:28:42 2021 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Nov 19 09:12:44 2021 +0100

    tdf#135906 docxexport: set serializer before writing
    
    This fixes a 6.3 regresssion from
    commit aafaf1f55fa413ad49d4556cf7c0a713dd206ae4.
    
    Change-Id: Ia2d3d26fe2cfa2b213326021f6b97f8d40c6e98c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125441
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf135906.docx 
b/sw/qa/extras/ooxmlexport/data/tdf135906.docx
new file mode 100644
index 000000000000..701fccff5ed4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135906.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 0a7879269a75..a8a6029392f0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -48,6 +48,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135164_cancelledNumbering, 
"tdf135164_cancelledN
     CPPUNIT_ASSERT_EQUAL(OUString("i"), getProperty<OUString>(xPara, 
"ListLabelString"));
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf135906, "tdf135906.docx")
+{
+    // just test round-tripping. The document was exported as corrupt and 
didn't re-load.
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testParaStyleNumLevel)
 {
     loadAndSave("para-style-num-level.docx");
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 3b25c0c0c608..2efafc412d82 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1689,6 +1689,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* 
sdrObject, const SwFrameFormat
     Size aSize(sdrObject->GetSnapRect().getWidth(), 
sdrObject->GetSnapRect().getHeight());
     startDMLAnchorInline(&rFrameFormat, aSize);
 
+    m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer());
     m_pImpl->getDrawingML()->WriteDiagram(xShape, nDiagramId);
 
     endDMLAnchorInline(&rFrameFormat);
commit dc0016bc8d7e6c4456f4442c7ccf287bfc0c2e9b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Nov 18 21:15:10 2021 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Nov 19 09:12:34 2021 +0100

    tdf#137924 qt (>=5.14): Use proper DPI without requiring window handle
    
    For Qt >= 5.14, don't require a window handle to retrieve
    the screen and then the associated DPI value from that one,
    but directly use 'QWidget::screen' (introduced in QT 5.14)
    to retrieve the screen.
    
    Previously, no DPI values would be set in case there was
    no window handle.
    
    This makes UI scaling work without having to manually set
    'SAL_FORCEDPI' on Wayland.
    
    While various UI elements (like e.g. the "Help" -> "About LibreOffice"
    still look quite broken with the qt5 and kf5 VCL plugins
    in a Plasma Wayland session (at least on my Debian testing with
    Qt 5.15.2 and Plasma 5.23), they look OK
    when using the qt6 VCL plugin with a custom build of qtbase
    and qtwayland from Qt's "dev" git branches.
    
    Change-Id: I5feae46ed86a8b7d3cf92d4a973f7a0f9a9f95de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125507
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx
index 0f9faa022d0b..f87de50827df 100644
--- a/vcl/qt5/QtGraphics_GDI.cxx
+++ b/vcl/qt5/QtGraphics_GDI.cxx
@@ -746,10 +746,17 @@ void QtGraphics::GetResolution(sal_Int32& rDPIX, 
sal_Int32& rDPIY)
         return;
     }
 
-    if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle())
+    if (!m_pFrame)
+        return;
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+    QScreen* pScreen = m_pFrame->GetQWidget()->screen();
+#else
+    if (!m_pFrame->GetQWidget()->window()->windowHandle())
         return;
 
     QScreen* pScreen = 
m_pFrame->GetQWidget()->window()->windowHandle()->screen();
+#endif
     rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
     rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
 }
diff --git a/vcl/qt5/QtSvpGraphics.cxx b/vcl/qt5/QtSvpGraphics.cxx
index b6018a95e299..3632c8990706 100644
--- a/vcl/qt5/QtSvpGraphics.cxx
+++ b/vcl/qt5/QtSvpGraphics.cxx
@@ -102,10 +102,17 @@ void QtSvpGraphics::GetResolution(sal_Int32& rDPIX, 
sal_Int32& rDPIY)
         return;
     }
 
-    if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle())
+    if (!m_pFrame)
+        return;
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+    QScreen* pScreen = m_pFrame->GetQWidget()->screen();
+#else
+    if (!m_pFrame->GetQWidget()->window()->windowHandle())
         return;
 
     QScreen* pScreen = 
m_pFrame->GetQWidget()->window()->windowHandle()->screen();
+#endif
     rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
     rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
 }

Reply via email to