[Libreoffice-commits] core.git: 5 commits - include/comphelper pyuno/PythonTest_pyuno_pytests_ssl.mk pyuno/qa sw/source
Caolán McNamara
caolanm at redhat.com
Thu Apr 24 06:13:29 PDT 2014
include/comphelper/documentconstants.hxx | 5 --
pyuno/PythonTest_pyuno_pytests_ssl.mk | 2 -
pyuno/qa/pytests/ssl.py | 10 -----
pyuno/qa/pytests/testssl.py | 10 +++++
sw/source/core/uibase/docvw/SidebarWin.cxx | 6 ++-
sw/source/core/uibase/shells/langhelper.cxx | 3 +
sw/source/core/view/vprint.cxx | 56 ++++++++++------------------
7 files changed, 37 insertions(+), 55 deletions(-)
New commits:
commit 9fd97266ce7dbeac33c93b6dace69d64c02d222c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 23 15:22:13 2014 +0100
Related: fdo#36815 center scaled comment page vertically
so comments at the top of the page don't get clipped
off the true printable area
Change-Id: Icb796c901372437b276e7ce4e31c08e0bf2ec250
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index b680e52..0022fff 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -455,26 +455,6 @@ sal_Bool SwViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Push();
- // fdo#36815 for comments in margins print to a metafile
- // and then scale that metafile down so that the comments
- // will fit on the real page, and replay that scaled
- // output to the real outputdevice
- GDIMetaFile *pOrigRecorder(NULL);
- GDIMetaFile *pMetaFile(NULL);
- sal_Int16 nPostItMode = rPrintData.GetPrintPostIts();
- if (nPostItMode == POSTITS_INMARGINS)
- {
- //get and disable the existing recorder
- pOrigRecorder = pOutDev->GetConnectMetaFile();
- pOutDev->SetConnectMetaFile(NULL);
- // turn off output to the device
- pOutDev->EnableOutput(false);
- // just record the rendering commands to the metafile
- // instead
- pMetaFile = new GDIMetaFile;
- pMetaFile->Record(pOutDev);
- }
-
// Print/PDF export for (multi-)selection has already generated a
// temporary document with the selected text.
// (see XRenderable implementation in unotxdoc.cxx)
@@ -490,6 +470,8 @@ sal_Bool SwViewShell::PrintOrPDFExport(
pDrawView->SetBufferedOverlayAllowed( false );
}
+ sal_Int16 nPostItMode = rPrintData.GetPrintPostIts();
+
{ // additional scope so that the CurrShell is reset before destroying the shell
SET_CURR_SHELL( pShell );
@@ -537,22 +519,6 @@ sal_Bool SwViewShell::PrintOrPDFExport(
pPostItManager->CalcRects();
pPostItManager->LayoutPostIts();
pPostItManager->DrawNotesForPage(pOutDev, nPage-1);
-
- //Now scale the recorded page down so the notes
- //will fit in the final page
- pMetaFile->Stop();
- pMetaFile->WindStart();
- double fScale = 0.75;
- pMetaFile->Scale( fScale, fScale );
- pMetaFile->WindStart();
-
- //Enable output the the device again
- pOutDev->EnableOutput(true);
- //Restore the original recorder
- pOutDev->SetConnectMetaFile(pOrigRecorder);
- //play back the scaled page
- pMetaFile->Play(pOutDev);
- delete pMetaFile;
}
}
@@ -562,6 +528,24 @@ sal_Bool SwViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Pop();
+ // fdo#36815 for comments in margins get the metafile we are printing to
+ // and then scale and vertically center that metafile down so that the
+ // comments will fit on the real page
+ GDIMetaFile *pRecorder = pOutDev->GetConnectMetaFile();
+ if (nPostItMode == POSTITS_INMARGINS && pRecorder)
+ {
+ pRecorder->Stop();
+ pRecorder->WindStart();
+ double fScale = 0.75;
+ long nOrigHeight = pOutDev->GetOutputSize().Height();
+ long nNewHeight = nOrigHeight*fScale;
+ long nShiftY = (nOrigHeight-nNewHeight)/2;
+ pRecorder->Scale(fScale, fScale);
+ pRecorder->WindStart();
+ pRecorder->Move(0, nShiftY, pOutDev->ImplGetDPIX(), pOutDev->ImplGetDPIY());
+ pRecorder->WindStart();
+ }
+
return sal_True;
}
commit dc3b3e129955856012df78acb1e8e2bbbec0df51
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 23 19:37:45 2014 +0100
mpTextRangeOverlay might not exist
if there is no range for the comment
Change-Id: I34b9ca9f0974f1d614268fd2df2ded704cd543d2
diff --git a/sw/source/core/uibase/docvw/SidebarWin.cxx b/sw/source/core/uibase/docvw/SidebarWin.cxx
index 3539878..3c77d98 100644
--- a/sw/source/core/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/core/uibase/docvw/SidebarWin.cxx
@@ -274,8 +274,10 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
*pDev, aNewViewInfos );
- pProcessor->process(mpAnchor->getOverlayObjectPrimitive2DSequence());
- pProcessor->process(mpTextRangeOverlay->getOverlayObjectPrimitive2DSequence());
+ if (mpAnchor)
+ pProcessor->process(mpAnchor->getOverlayObjectPrimitive2DSequence());
+ if (mpTextRangeOverlay)
+ pProcessor->process(mpTextRangeOverlay->getOverlayObjectPrimitive2DSequence());
delete pProcessor;
}
commit 7dca5341d799d59a81e6dac84586fa2daa02a550
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Apr 24 13:51:27 2014 +0100
crash in selecting text in comments midway in para
Change-Id: Iaab71e201fae6a03936ccc6aac040027a183209c
diff --git a/sw/source/core/uibase/shells/langhelper.cxx b/sw/source/core/uibase/shells/langhelper.cxx
index e3ec901..a75d665 100644
--- a/sw/source/core/uibase/shells/langhelper.cxx
+++ b/sw/source/core/uibase/shells/langhelper.cxx
@@ -568,7 +568,8 @@ namespace SwLangHelper
// string for guessing language
OUString aText;
- aText = rEditEngine->GetText(aDocSelection);
+ // get the full text of the paragraph that the end of selection is in
+ aText = rEditEngine->GetText(aDocSelection.nEndPos);
if (!aText.isEmpty())
{
sal_Int32 nStt = 0;
commit d65d2b1d7e94f60849a4071644b6ee83309c719f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 23 12:28:38 2014 +0100
remove unused macros
Change-Id: Ie051a0d584fc0470237f4ac0723e8730a6b47ed3
diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx
index 913d0c7..47d31a5 100644
--- a/include/comphelper/documentconstants.hxx
+++ b/include/comphelper/documentconstants.hxx
@@ -48,11 +48,6 @@
#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII "application/vnd.sun.xml.impress.template"
#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII "application/vnd.sun.xml.calc.template"
-#define MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII )
-#define MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII )
-#define MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII )
-#define MIMETYPE_VND_SUN_XML_CALC_TEMPLATE OUString( MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII )
-
// formats of SO8
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII "application/vnd.oasis.opendocument.text"
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII "application/vnd.oasis.opendocument.text-web"
commit 6e24cf09c5f73a6496320a42fb070e78f1527357
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 23 11:43:19 2014 +0100
test for _ssl
I'm still suspicious
Change-Id: I56bfbe1ea2f92ffba6264b7543fa5df7f29f2bd0
diff --git a/pyuno/PythonTest_pyuno_pytests_ssl.mk b/pyuno/PythonTest_pyuno_pytests_ssl.mk
index 95779dd..cdb859f 100644
--- a/pyuno/PythonTest_pyuno_pytests_ssl.mk
+++ b/pyuno/PythonTest_pyuno_pytests_ssl.mk
@@ -10,7 +10,7 @@
$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_ssl))
$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_ssl,$(SRCDIR)/pyuno/qa/pytests,\
- ssl \
+ testssl \
))
# vim: set noet sw=4 ts=4:
diff --git a/pyuno/qa/pytests/ssl.py b/pyuno/qa/pytests/testssl.py
similarity index 90%
rename from pyuno/qa/pytests/ssl.py
rename to pyuno/qa/pytests/testssl.py
index f0a0a37..ed6c99c 100644
--- a/pyuno/qa/pytests/ssl.py
+++ b/pyuno/qa/pytests/testssl.py
@@ -3,7 +3,7 @@ import unittest
#I want to ensure that import ssl works on all platforms
class SSLTest(unittest.TestCase):
def test_ssl_import(self):
- import ssl
+ import _ssl
if __name__ == '__main__':
unittest.main()
More information about the Libreoffice-commits
mailing list