[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - bridges/source

2020-11-14 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/shared/vtablefactory.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1a4f7443491e809959b53838fb0cfad287317a88
Author: Tor Lillqvist 
AuthorDate: Wed Apr 29 20:12:21 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Sun Nov 15 08:41:37 2020 +0100

Use MAP_JIT on macOS

See 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-executable-page-protection
and 
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit

Change-Id: I192038efa9cff4fb723bf4bdc8644f0b09f0fcda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93181
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105847
Tested-by: Jenkins CollaboraOffice 

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx 
b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 70187cbd2fe7..d17533534e9b 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -77,6 +77,11 @@ extern "C" void * allocExec(
 std::size_t n = (*size + (pagesize - 1)) & ~(pagesize - 1);
 void * p;
 #if defined SAL_UNX
+#if defined MACOSX
+p = mmap(
+nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON 
| MAP_JIT, -1,
+0);
+#else
 p = mmap(
 nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,
 0);
@@ -88,6 +93,7 @@ extern "C" void * allocExec(
 munmap (p, n);
 p = nullptr;
 }
+#endif
 #elif defined _WIN32
 p = VirtualAlloc(nullptr, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: toolkit/source

2020-11-14 Thread Michael Weghorn (via logerrit)
 toolkit/source/awt/vclxwindows.cxx |   22 --
 1 file changed, 22 deletions(-)

New commits:
commit 42a691933429dbb315de2bd7ba2724993c60411f
Author: Michael Weghorn 
AuthorDate: Fri Nov 13 15:14:17 2020 +0100
Commit: Michael Weghorn 
CommitDate: Sat Nov 14 23:36:53 2020 +0100

tdf#138187 Don't open UNO hyperlink control's URL twice

It looks like handling the click by opening the URL
was added directly to 'FixedHyperlink' in

commit f0006e79c4112b06b65c098722729b9a3f3301c7
Date:   Thu Oct 20 10:49:24 2016 +0200
Handle link click directly in FixedHyperlink

to deduplicate the handling done explicitly in various
dialogs by themselves.

The handling in 'VCLXFixedHyperlink::ProcessWindowEvent',
which did the same for the case where no action listeners
exist, there since

commit ea665e6fe7af34fcdcefd73bc05c68eb88e42073
Date:   Tue Jan 29 14:05:57 2008 +
INTEGRATION: CWS fwk80_SRC680 (1.64.12); FILE MERGED
2008/01/24 12:27:38 pb 1.64.12.6: fix: #i83756# 
VCLXFixedHyperlink::ImplGetPropertyIds() added
2008/01/24 07:50:51 pb 1.64.12.5: RESYNC: (1.64-1.64.18.1); FILE MERGED
2008/01/15 09:14:01 mav 1.64.12.4: adopt for gcc
2008/01/15 08:13:04 pb 1.64.12.3: fix: #i83756# open the hyperlink if 
there are no action listeners
2008/01/14 09:48:30 pb 1.64.12.2: fix: #i83756# 
VCLXFixedHyperlink::get/setProperty() added
2008/01/11 15:04:28 pb 1.64.12.1: fix: #i83756# class VCLXFixedHyperlink

remained, though, so clicking a UNO hyperlink control
resulted in the corresponding URL being opened twice.

Drop the extra handling from there so this only
happens once.

(I couldn't quickly double-check that the URL is
only opened once before f0006e79c4112b06b65c098722729b9a3f3301c7
since opening the dialog from the sample file fails in
such old versions in the bibisect repo.)

Change-Id: I32eace51bf8f14e968a939398c2bf2fd6f83de28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105793
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/toolkit/source/awt/vclxwindows.cxx 
b/toolkit/source/awt/vclxwindows.cxx
index 554b5fc7f212..d7404132d545 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2877,28 +2877,6 @@ void VCLXFixedHyperlink::ProcessWindowEvent( const 
VclWindowEvent& rVclWindowEve
 aEvent.Source = static_cast(this);
 maActionListeners.actionPerformed( aEvent );
 }
-else
-{
-// open the URL
-OUString sURL;
-VclPtr< FixedHyperlink > pBase = GetAs< FixedHyperlink >();
-if ( pBase )
-sURL = pBase->GetURL();
-Reference< css::system::XSystemShellExecute > 
xSystemShellExecute( css::system::SystemShellExecute::create(
-::comphelper::getProcessComponentContext() ) );
-if ( !sURL.isEmpty() )
-{
-try
-{
-// start browser
-xSystemShellExecute->execute(
-sURL, OUString(), 
css::system::SystemShellExecuteFlags::URIS_ONLY );
-}
-catch( uno::Exception& )
-{
-}
-}
-}
 [[fallthrough]];
 }
 default:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - pyuno/source

2020-11-14 Thread Stephan Bergmann (via logerrit)
 pyuno/source/module/pyuno.cxx  |4 ++--
 pyuno/source/module/pyuno_callable.cxx |4 ++--
 pyuno/source/module/pyuno_iterator.cxx |8 
 pyuno/source/module/pyuno_runtime.cxx  |4 ++--
 pyuno/source/module/pyuno_struct.cxx   |4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit cef33044bcc72181824f32aaa84555447629852d
Author: Stephan Bergmann 
AuthorDate: Mon May 11 22:46:12 2020 +0200
Commit: Muhammet Kara 
CommitDate: Sat Nov 14 22:44:38 2020 +0100

Fix initialization of Python-3.8--only at-end tp_print member

Until Python 3.7, PyTypeObject had a member tp_print following tp_dealloc, 
which
had then been repurposed as

>  /* Methods to implement standard operations */
>
>  destructor tp_dealloc;
> -printfunc tp_print;
> +Py_ssize_t tp_vectorcall_offset;
>  getattrfunc tp_getattr;
>  setattrfunc tp_setattr;
>  PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 
2)

in  "bpo-36974: implement PEP 590
(GH-13185)" towards Python 3.8.  Then only on the 3.8 branch (and prior to 
tag
v3.8.0),  "[3.8] bpo-37250: put back 
tp_print
for backwards compatibility (GH-14193)" added

>  destructor tp_finalize;
>  vectorcallfunc tp_vectorcall;
>
> +/* bpo-37250: kept for backwards compatibility in CPython 3.8 only */
> +Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
> +
>  #ifdef COUNT_ALLOCS
>  /* these must be last and never explicitly initialized */
>  Py_ssize_t tp_allocs;

at the end of PyTypeObject.  This was apparently done so that third-party 
code
containing initialization code like

  X.tp_print = 0;

would continue to compile (by just adding back a member with that name, 
even if
at a "random" new---and otherwise unused---location).  However, for our way 
of
list-initializing PyTypeObject instances in pyuno that new member caused
"missing field 'tp_print' initializer" -Wmissing-field-initializers 
warnings, so
50ccb7e82b7053306721cbe220323be072306a29 "python 3.8.2 compile: add 
tp_print to
PyTypeObject" added initializers for this new at-end member.  But it did so 
in a
way that raises three concerns:

1  The new member was already added in Python 3.8.0 (prior to tag v3.8.0), 
not
   only in 3.8.2.

2  The new member was only added to Python 3.8.  It has not been added to
   current master towards 3.9.

3  It is unclear why the comments mention "Py_ssize_t" as the type of that 
new
   member, when actually it is of a function pointer type (see above).  
Probably
   best to just drop that from the comments, to avoid confusion.

Change-Id: Ib44f43befd5f28d4c1ac1e9e14bd55bfb4473507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94019
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 23d9966751566028c50ca95ca203d20f36c64f30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105850
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 63117fc4acdc..7246658df6ca 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -1684,12 +1684,12 @@ static PyTypeObject PyUNOType =
 , nullptr
 #if PY_VERSION_HEX >= 0x0308
 , nullptr // vectorcallfunc tp_vectorcall
-#if PY_VERSION_HEX >= 0x03080200
+#if PY_VERSION_HEX < 0x0309
 #if defined __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 #endif
-, nullptr //Py_ssize_t tp_print
+, nullptr // tp_print
 #if defined __clang__
 #pragma clang diagnostic pop
 #endif
diff --git a/pyuno/source/module/pyuno_callable.cxx 
b/pyuno/source/module/pyuno_callable.cxx
index 02aa082025ba..73bec5d34b5b 100644
--- a/pyuno/source/module/pyuno_callable.cxx
+++ b/pyuno/source/module/pyuno_callable.cxx
@@ -231,12 +231,12 @@ static PyTypeObject PyUNO_callable_Type =
 , nullptr
 #if PY_VERSION_HEX >= 0x0308
 , nullptr // vectorcallfunc tp_vectorcall
-#if PY_VERSION_HEX >= 0x03080200
+#if PY_VERSION_HEX < 0x0309
 #if defined __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 #endif
-, nullptr //Py_ssize_t tp_print
+, nullptr // tp_print
 #if defined __clang__
 #pragma clang diagnostic pop
 #endif
diff --git a/pyuno/source/module/pyuno_iterator.cxx 
b/pyuno/source/module/pyuno_iterator.cxx
index 8337feba9a9d..840fc977014a 100644
--- a/pyuno/source/module/pyuno_iterator.cxx
+++ b/pyuno/source/module/pyuno_iterator.cxx
@@ -167,12 +167,12 @@ static P

[Libreoffice-commits] core.git: vcl/qa

2020-11-14 Thread Luboš Luňák (via logerrit)
 vcl/qa/cppunit/BackendTest.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 88fdc3cd5eb6c88d2649f01f91bf7acd703e6364
Author: Luboš Luňák 
AuthorDate: Sat Nov 14 11:11:45 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 22:25:34 2020 +0100

enable vcl backendtest unittest for headless too

This test would have caught the SalPoint mismatch from 3d90997fb6f232
causing gradient problems, if only this were enabled for headless too.
So explicitly disable only the two invert() tests.

Change-Id: Ib6f6a8c8cd9675ca6d20a761ebebdbc8ef0ebd45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105832
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index ff495b10c1de..94bf1e142960 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -84,7 +84,6 @@ public:
 // silently in case a new backend is added.
 #define SHOULD_ASSERT  
\
 (assertBackendNameNotEmpty(aOutDevTest.getRenderBackendName()) 
\
- && aOutDevTest.getRenderBackendName() != "svp"
\
  && aOutDevTest.getRenderBackendName() != "opengl" 
\
  && aOutDevTest.getRenderBackendName() != "qt5"
\
  && aOutDevTest.getRenderBackendName() != "qt5svp" 
\
@@ -373,7 +372,7 @@ public:
 Bitmap aBitmap = aOutDevTest.setupInvert_N50();
 auto eResult = 
vcl::test::OutputDeviceTestCommon::checkInvertN50Rectangle(aBitmap);
 exportImage("05-02_invert_N50_test-rectangle.png", aBitmap);
-if (SHOULD_ASSERT)
+if (SHOULD_ASSERT && aOutDevTest.getRenderBackendName() != "svp")
 CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
 }
 
@@ -383,7 +382,7 @@ public:
 Bitmap aBitmap = aOutDevTest.setupInvert_TrackFrame();
 auto eResult = 
vcl::test::OutputDeviceTestCommon::checkInvertTrackFrameRectangle(aBitmap);
 exportImage("05-03_invert_TrackFrame_test-rectangle.png", aBitmap);
-if (SHOULD_ASSERT)
+if (SHOULD_ASSERT && aOutDevTest.getRenderBackendName() != "svp")
 CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: oox/inc oox/source

2020-11-14 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/textparagraphproperties.hxx   |2 +
 oox/source/drawingml/textparagraph.cxx  |   14 ++-
 oox/source/drawingml/textparagraphproperties.cxx|7 +++
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   32 +++-
 4 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit c9619a5f6c351ede0dbfb3cf07df0ac9b74c2992
Author: Gülşah Köse 
AuthorDate: Thu Nov 12 01:52:15 2020 +0300
Commit: Gülşah Köse 
CommitDate: Sat Nov 14 22:06:22 2020 +0100

tdf#138148 Protect aspect ratio of graphic bullets.

Change-Id: I166d547cdc01853fd81436c6cdc8d64b0fe817be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105618
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 23a177d289f5..7dd41610024b 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -54,6 +54,7 @@ public:
 void setSuffixNone();
 void setSuffixMinusRight();
 void setBulletSize(sal_Int16 nSize);
+void setBulletAspectRatio(double nAspectRatio);
 void setFontSize(sal_Int16 nSize);
 void setStyleName( const OUString& rStyleName ) { maStyleName <<= 
rStyleName; }
 void setGraphic( css::uno::Reference< css::graphic::XGraphic > const & 
rXGraphic );
@@ -68,6 +69,7 @@ public:
 css::uno::Any   msNumberingPrefix;
 css::uno::Any   msNumberingSuffix;
 css::uno::Any   mnSize;
+css::uno::Any   mnAspectRatio; // Width/Height
 css::uno::Any   mnFontSize;
 css::uno::Any   maStyleName;
 css::uno::Any   maGraphic;
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 21c8d44c0079..8aa4d8895040 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -144,11 +144,23 @@ void TextParagraph::insertAt(
 {
 tools::Long nFirstCharHeightMm = 
TransformMetric(nCharHeightFirst > 0 ? nCharHeightFirst : 1200, 
FieldUnit::POINT, FieldUnit::MM);
 float fBulletSizeRel = 1.f;
+double fBulletAspectRatio = 1.0;
+
 if( aParaProp.getBulletList().mnSize.hasValue() )
 fBulletSizeRel = 
aParaProp.getBulletList().mnSize.get() / 100.f;
 
+if( aParaProp.getBulletList().mnAspectRatio.hasValue() )
+fBulletAspectRatio = 
aParaProp.getBulletList().mnAspectRatio.get();
+
 css::awt::Size aBulletSize;
-aBulletSize.Width = aBulletSize.Height = 
std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+if( fBulletAspectRatio != 1.0 )
+{
+aBulletSize.Height = std::lround(fBulletSizeRel * 
nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+aBulletSize.Width = aBulletSize.Height * 
fBulletAspectRatio;
+}
+else
+aBulletSize.Width = aBulletSize.Height = 
std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+
 aioBulletList.setProperty( PROP_GraphicSize, aBulletSize);
 }
 
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 8121edb156ff..197f0e51f28a 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -246,6 +246,11 @@ void BulletList::setBulletSize(sal_Int16 nSize)
 mnSize <<= nSize;
 }
 
+void BulletList::setBulletAspectRatio(double nAspectRatio)
+{
+mnAspectRatio <<= nAspectRatio;
+}
+
 void BulletList::setFontSize(sal_Int16 nSize)
 {
 mnFontSize <<= nSize;
@@ -272,6 +277,8 @@ void BulletList::apply( const BulletList& rSource )
 msNumberingSuffix = rSource.msNumberingSuffix;
 if ( rSource.mnSize.hasValue() )
 mnSize = rSource.mnSize;
+if ( rSource.mnAspectRatio.hasValue() )
+mnAspectRatio = rSource.mnAspectRatio;
 if ( rSource.mnFontSize.hasValue() )
 mnFontSize = rSource.mnFontSize;
 if ( rSource.maStyleName.hasValue() )
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index b58d8952ca76..e81101f85ec2 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -22,6 +22,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -43,8 +46,32 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::xml::sax;
 using namespace ::com::sun::star::style;
 using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::graphic;
 
 namespace o

[Libreoffice-commits] core.git: sw/inc sw/source

2020-11-14 Thread Aron Budea (via logerrit)
 sw/inc/inspectorproperties.hrc|4 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   17 +
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 514a4f302f9f49db5a0b22cbe49bd98191296735
Author: Aron Budea 
AuthorDate: Sat Nov 14 20:33:39 2020 +0100
Commit: Mike Kaganski 
CommitDate: Sat Nov 14 21:55:39 2020 +0100

tdf#136868, tdf#136912, Styles Inspector: Translatable categories

...and "Direct Formatting" renamed to "Character Direct Formatting"

Change-Id: I9fe711bfebfaa90a9797b6e1a47e41a5f307170b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105843
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc
index f51521b30e9e..6ef374a2f857 100644
--- a/sw/inc/inspectorproperties.hrc
+++ b/sw/inc/inspectorproperties.hrc
@@ -27,6 +27,10 @@
 and Text cursor properties
  */
 
+// Node names
+#define RID_CHAR_DIRECTFORMAT   
NC_("RID_CHAR_DIRECTFORMAT", "Character Direct Formatting")
+#define RID_PARA_DIRECTFORMAT   
NC_("RID_PARA_DIRECTFORMAT", "Paragraph Direct Formatting")
+
 // Format names
 #define RID_BORDER_COLOR
NC_("RID_ATTRIBUTE_NAMES_MAP", "Color")
 #define RID_BORDER_DISTANCE 
NC_("RID_ATTRIBUTE_NAMES_MAP", "Border Distance")
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 6dfaf8ccd966..e2c3c15d0e24 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace sw::sidebar
 {
@@ -440,16 +441,16 @@ static void UpdateTree(SwDocShell* pDocSh, 
std::vector&
 {
 SwDoc* pDoc = pDocSh->GetDoc();
 SwPaM* pCursor = pDoc->GetEditShell()->GetCursor();
-svx::sidebar::TreeNode aDFNode;
+svx::sidebar::TreeNode aCharDFNode;
 svx::sidebar::TreeNode aCharNode;
 svx::sidebar::TreeNode aParaNode;
 svx::sidebar::TreeNode aParaDFNode;
 
-aDFNode.sNodeName = "Direct Formatting";
-aCharNode.sNodeName = "Character Styles";
-aParaNode.sNodeName = "Paragraph Styles";
-aParaDFNode.sNodeName = "Paragraph Direct Formatting";
-aDFNode.NodeType = svx::sidebar::TreeNode::Category;
+aCharNode.sNodeName = SwResId(STR_CHARACTERSTYLEFAMILY);
+aParaNode.sNodeName = SwResId(STR_PARAGRAPHSTYLEFAMILY);
+aCharDFNode.sNodeName = SwResId(RID_CHAR_DIRECTFORMAT);
+aParaDFNode.sNodeName = SwResId(RID_PARA_DIRECTFORMAT);
+aCharDFNode.NodeType = svx::sidebar::TreeNode::Category;
 aCharNode.NodeType = svx::sidebar::TreeNode::Category;
 aParaNode.NodeType = svx::sidebar::TreeNode::Category;
 aParaDFNode.NodeType = svx::sidebar::TreeNode::Category;
@@ -471,7 +472,7 @@ static void UpdateTree(SwDocShell* pDocSh, 
std::vector&
UNO_NAME_NUMBERING_LEVEL,
UNO_NAME_PARRSID };
 
-InsertValues(xRange, aIsDefined, aDFNode, false, aHiddenProperties);
+InsertValues(xRange, aIsDefined, aCharDFNode, false, aHiddenProperties);
 
 uno::Reference 
xStyleFamiliesSupplier(pDocSh->GetBaseModel(),
  
uno::UNO_QUERY);
@@ -536,7 +537,7 @@ static void UpdateTree(SwDocShell* pDocSh, 
std::vector&
 aStore.push_back(aParaNode);
 aStore.push_back(aParaDFNode);
 aStore.push_back(aCharNode);
-aStore.push_back(aDFNode);
+aStore.push_back(aCharDFNode);
 }
 
 IMPL_LINK(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, pLink, 
void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

2020-11-14 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin2.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 8d317a4f8159117c27721192cc8f8ac6c694fdc0
Author: Caolán McNamara 
AuthorDate: Fri Nov 13 16:55:07 2020 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Nov 14 21:01:00 2020 +0100

tdf#136336 ensure tooltip area surrounds the current mouse position

with at least a pixel margin

Change-Id: I74935f0275863cfd5a799927034d0a31dae073cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105547
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index c023047a5560..b48b18ec43d2 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -364,6 +364,13 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
 aRect.SetRight( aPt.X() );
 aRect.SetBottom( aPt.Y() );
 
+// tdf#136336 ensure tooltip area surrounds the current mouse 
position with at least a pixel margin
+aRect.Union(tools::Rectangle(rEvt.GetMousePosPixel(), Size(1, 
1)));
+aRect.AdjustLeft(-1);
+aRect.AdjustRight(1);
+aRect.AdjustTop(-1);
+aRect.AdjustBottom(1);
+
 if( bBalloon )
 Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, 
sText );
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/inc vcl/opengl vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win

2020-11-14 Thread Noel Grandin (via logerrit)
 include/vcl/salgtype.hxx |9 ---
 vcl/headless/svpgdi.cxx  |   32 +-
 vcl/inc/headless/svpgdi.hxx  |   14 ++--
 vcl/inc/opengl/gdiimpl.hxx   |   18 +++---
 vcl/inc/qt5/Qt5Graphics.hxx  |   14 ++--
 vcl/inc/quartz/salgdi.h  |   14 ++--
 vcl/inc/salgdi.hxx   |   30 +-
 vcl/inc/salgdiimpl.hxx   |   14 ++--
 vcl/inc/skia/gdiimpl.hxx |   14 ++--
 vcl/inc/unx/genpspgraphics.h |   14 ++--
 vcl/inc/unx/salgdi.h |   14 ++--
 vcl/inc/win/salgdi.h |   14 ++--
 vcl/opengl/gdiimpl.cxx   |   70 +++
 vcl/qt5/Qt5Graphics_GDI.cxx  |   44 +++---
 vcl/quartz/salgdicommon.cxx  |   60 ++--
 vcl/skia/gdiimpl.cxx |   35 ++-
 vcl/source/gdi/salgdilayout.cxx  |   50 
 vcl/source/outdev/curvedshapes.cxx   |8 +-
 vcl/source/outdev/line.cxx   |4 -
 vcl/source/outdev/polygon.cxx|   22 +++
 vcl/source/outdev/polyline.cxx   |6 +-
 vcl/source/outdev/rect.cxx   |4 -
 vcl/unx/generic/gdi/gdiimpl.cxx  |   28 -
 vcl/unx/generic/gdi/gdiimpl.hxx  |   16 ++---
 vcl/unx/generic/gdi/salgdi.cxx   |   14 ++--
 vcl/unx/generic/print/genpspgraphics.cxx |   30 +-
 vcl/win/gdi/gdiimpl.cxx  |   93 +++
 vcl/win/gdi/gdiimpl.hxx  |   14 ++--
 vcl/win/gdi/salgdi.cxx   |   12 ++--
 vcl/win/gdi/salgdi2.cxx  |2 
 30 files changed, 352 insertions(+), 361 deletions(-)

New commits:
commit 0f04b8204a77ecaee7d9ebe6868808445c8b138a
Author: Noel Grandin 
AuthorDate: Thu Nov 12 12:29:08 2020 +0200
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 20:43:07 2020 +0100

remove SalPoint

 that "SalPoint" doesn't really seem to to have a purpose
except to highlight that "Point" is assumed to use LONG under windows
and can be passed unchanged to those windows drawing apis
 so I guess remove SalPoint entirely, use Point instead,
and convert to "POINT" under windows ?

Change-Id: Ic15a7f4516e2075a228fa65cac4e8494d5b3abaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105634
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
index d19bf776a31f..90217026 100644
--- a/include/vcl/salgtype.hxx
+++ b/include/vcl/salgtype.hxx
@@ -36,15 +36,6 @@ enum class DeviceFormat {
 
 constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF );
 
-// must equal to the Windows POINT type, which is why we use sal_Int32
-struct SalPoint
-{
-sal_Int32mnX;
-sal_Int32mnY;
-};
-
-typedef const SalPoint*   PCONSTSALPOINT;
-
 struct SalTwoRect
 {
 tools::LongmnSrcX;
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index d878527562c2..40e2ad1542b1 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1082,12 +1082,12 @@ void SvpSalGraphics::drawRect( tools::Long nX, 
tools::Long nY, tools::Long nWidt
 m_aLineColor = aOrigLineColor;
 }
 
-void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAry)
+void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, const Point* pPtAry)
 {
 basegfx::B2DPolygon aPoly;
-aPoly.append(basegfx::B2DPoint(pPtAry->mnX, pPtAry->mnY), nPoints);
+aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
 for (sal_uInt32 i = 1; i < nPoints; ++i)
-aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].mnX, pPtAry[i].mnY));
+aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
 aPoly.setClosed(false);
 
 drawPolyLine(
@@ -1102,12 +1102,12 @@ void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, 
const SalPoint* pPtAry)
 false);
 }
 
-void SvpSalGraphics::drawPolygon(sal_uInt32 nPoints, const SalPoint* pPtAry)
+void SvpSalGraphics::drawPolygon(sal_uInt32 nPoints, const Point* pPtAry)
 {
 basegfx::B2DPolygon aPoly;
-aPoly.append(basegfx::B2DPoint(pPtAry->mnX, pPtAry->mnY), nPoints);
+aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
 for (sal_uInt32 i = 1; i < nPoints; ++i)
-aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].mnX, pPtAry[i].mnY));
+aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
 
 drawPolyPolygon(
 basegfx::B2DHomMatrix(),
@@ -1117,7 +1117,7 @@ void SvpSalGraphics::drawPolygon(sal_uInt32 nPoints, 
const SalPoint* pPtAry)
 
 void SvpSalGraphics::drawPolyPolygon(sal_uInt32 nPoly,
  const sal_uInt32* pPointCounts,
- PCONSTSALPOINT*   pPtAry)
+

[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2020-11-14 Thread László Németh (via logerrit)
 sw/inc/docary.hxx   |5 +-
 sw/qa/extras/uiwriter/uiwriter2.cxx |   35 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |9 
 sw/source/core/doc/docredln.cxx |   10 +++-
 4 files changed, 56 insertions(+), 3 deletions(-)

New commits:
commit 4ad0459494303745b377c848c681a747f294fc64
Author: László Németh 
AuthorDate: Fri Nov 13 20:07:09 2020 +0100
Commit: László Németh 
CommitDate: Sat Nov 14 20:41:54 2020 +0100

tdf#138135: sw ChangesInMargin: join characters at backspace

Words deleted by pressing multiple backspaces weren't shown
on margin, only their first letter.

Change-Id: I2f5d0bb057250d3bfd788e1007f1ad24f8c3c2fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105807
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 9b4a6e80ea26..4a3e2031420e 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -259,8 +259,11 @@ public:
  @param tableIndex position in SwRedlineTable to start searching at, will 
be updated with the index of the returned
redline (or the next redline after the given position 
if not found)
  @param next true: redline starts at position and ends after, false: 
redline starts before position and ends at or after
+ @param visibletrue: redline must be visible false: redline must be 
not visible
 */
-const SwRangeRedline* FindAtPosition( const SwPosition& startPosition, 
size_type& tableIndex, bool next = true ) const;
+const SwRangeRedline* FindAtPosition( const SwPosition& startPosition,
+  size_type& tableIndex,
+  bool next = true, bool visible = 
true ) const;
 
 boolempty() const { return maVector.empty(); }
 size_type   size() const { return maVector.size(); }
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 31ce73fb1c0b..dccf9de83c70 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1925,6 +1925,41 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137684)
 CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf138135)
+{
+load(DATA_DIRECTORY, "tdf132160.odt");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+
+// switch on "Show changes in margin" mode
+dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+
+SwWrtShell* const pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell->GetViewOptions()->IsShowChangesInMargin());
+
+// select and delete a word letter by letter by using backspace
+dispatchCommand(mxComponent, ".uno:GoToNextWord", {});
+
+for (int i = 0; i <= 10; ++i)
+{
+dispatchCommand(mxComponent, ".uno:SwBackspace", {});
+}
+CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("support"));
+
+// single Undo undoes the deletion of the whole word
+//
+// This was only a 1-character Undo because of missing
+// joining of the deleted characters
+dispatchCommand(mxComponent, ".uno:Undo", {});
+
+CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Encryption"));
+
+// switch off "Show changes in margin" mode
+dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf52391)
 {
 load(DATA_DIRECTORY, "tdf52391.fodt");
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 2e018b7a0567..146095349261 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3992,6 +3992,15 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa
 // within a paragraph TODO: fix also for paragraph join
 pRedline->GetPoint()->nNode == pRedline->GetMark()->nNode)
 {
+// show hidden previous deletion for joining
+SwRedlineTable::size_type index = 0;
+const SwRangeRedline* pPrevRedline = rTable.FindAtPosition(
+*pRedline->End(), index, /*bNext=*/false, 
/*bGetVisible=*/false );
+if ( pPrevRedline && RedlineType::Delete == 
pPrevRedline->GetType() )
+{
+SwRangeRedline* pPrevRed = rTable[ index ];
+pPrevRed->Show(1, index, /*bForced=*/true);
+}
 pRedline->Show(0, rTable.GetPos(pRedline), /*bForced=*/false);
 pRedline->Sh

[Libreoffice-commits] core.git: sc/source

2020-11-14 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/docsh4.cxx |1 -
 sc/source/ui/inc/inputwin.hxx|1 -
 2 files changed, 2 deletions(-)

New commits:
commit e56c19c9aec4d118b247a6b7daa2cb529fee400a
Author: Caolán McNamara 
AuthorDate: Sat Nov 14 15:10:42 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 20:27:49 2020 +0100

don't need to include vcl/button.hxx

Change-Id: I55d0157436df09d5f28afb92819f996eff2e71db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105835
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8526f99d9931..111fb8262234 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -40,7 +40,6 @@ using namespace ::com::sun::star;
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 03a6cf359941..75755509bec3 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmloff/source

2020-11-14 Thread Noel Grandin (via logerrit)
 xmloff/source/draw/XMLImageMapContext.cxx |   47 ++
 1 file changed, 22 insertions(+), 25 deletions(-)

New commits:
commit 4cc03d53ff5e72739f3cfb6fd3d713e4bb263f31
Author: Noel Grandin 
AuthorDate: Sat Nov 14 18:04:18 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 14 20:15:30 2020 +0100

use fastparser in XMLImageMapObjectContext

Change-Id: Iefe6acbbacf308144372fb664943bd978225a0f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105839
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmloff/source/draw/XMLImageMapContext.cxx 
b/xmloff/source/draw/XMLImageMapContext.cxx
index 0585bd60407f..4852fbc19af4 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -127,10 +127,9 @@ public:
 
 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 
-SvXMLImportContextRef CreateChildContext(
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
-const css::uno::Reference & xAttrList ) 
override;
+virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >& 
AttrList ) override;
 
 protected:
 
@@ -207,30 +206,28 @@ void XMLImageMapObjectContext::endFastElement(sal_Int32 )
 // else: not valid -> don't create and insert
 }
 
-SvXMLImportContextRef XMLImageMapObjectContext::CreateChildContext(
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
-const Reference & /*xAttrList*/ )
+css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLImageMapObjectContext::createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken(rLocalName, XML_EVENT_LISTENERS) )
-{
-Reference xEvents( xMapEntry, UNO_QUERY );
-return new XMLEventsImportContext(
-GetImport(), nPrefix, rLocalName, xEvents);
-}
-else if ( (XML_NAMESPACE_SVG == nPrefix) &&
-  IsXMLToken(rLocalName, XML_TITLE) )
-{
-return new XMLStringBufferImportContext(
-GetImport(), nPrefix, rLocalName, sTitleBuffer);
-}
-else if ( (XML_NAMESPACE_SVG == nPrefix) &&
-  IsXMLToken(rLocalName, XML_DESC) )
+switch (nElement)
 {
-return new XMLStringBufferImportContext(
-GetImport(), nPrefix, rLocalName, sDescriptionBuffer);
+case XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS):
+{
+Reference xEvents( xMapEntry, UNO_QUERY );
+return new XMLEventsImportContext(
+GetImport(), xEvents);
+}
+case XML_ELEMENT(SVG, XML_TITLE):
+case XML_ELEMENT(SVG_COMPAT, XML_TITLE):
+return new XMLStringBufferImportContext(
+GetImport(), sTitleBuffer);
+case XML_ELEMENT(SVG, XML_DESC):
+case XML_ELEMENT(SVG_COMPAT, XML_DESC):
+return new XMLStringBufferImportContext(
+GetImport(), sDescriptionBuffer);
 }
+XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: tools/qa

2020-11-14 Thread Mike Kaganski (via logerrit)
 tools/qa/cppunit/test_bigint.cxx |   22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 396196d6143e377f83a81557f4630ac7e7ad9471
Author: Mike Kaganski 
AuthorDate: Sat Nov 14 19:07:41 2020 +0300
Commit: Mike Kaganski 
CommitDate: Sat Nov 14 19:51:56 2020 +0100

BigInt's non-big value type is currently sal_Int32

Change-Id: Iaca11d6279e17cf6301ef35d416829377c0ec964
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105841
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/tools/qa/cppunit/test_bigint.cxx b/tools/qa/cppunit/test_bigint.cxx
index efea3e341235..a91d16f93def 100644
--- a/tools/qa/cppunit/test_bigint.cxx
+++ b/tools/qa/cppunit/test_bigint.cxx
@@ -57,40 +57,38 @@ void BigIntTest::testConstructionFromLongLong()
 }
 
 #if SAL_TYPES_SIZEOFLONG < SAL_TYPES_SIZEOFLONGLONG
-// positive number just fitting to long
+// positive number just fitting to sal_Int32
 {
-BigInt 
bi(static_cast(std::numeric_limits::max()));
+BigInt 
bi(static_cast(std::numeric_limits::max()));
 CPPUNIT_ASSERT(bi.IsSet());
 CPPUNIT_ASSERT(!bi.IsZero());
 CPPUNIT_ASSERT(!bi.IsNeg());
 CPPUNIT_ASSERT(bi.IsLong());
-CPPUNIT_ASSERT_EQUAL(std::numeric_limits::max(), 
static_cast(bi));
+CPPUNIT_ASSERT_EQUAL(std::numeric_limits::max(), 
static_cast(bi));
 }
 
-// negative number just fitting to long
+// negative number just fitting to sal_Int32
 {
-BigInt 
bi(static_cast(std::numeric_limits::min()));
+BigInt 
bi(static_cast(std::numeric_limits::min()));
 CPPUNIT_ASSERT(bi.IsSet());
 CPPUNIT_ASSERT(!bi.IsZero());
 CPPUNIT_ASSERT(bi.IsNeg());
 CPPUNIT_ASSERT(bi.IsLong());
-CPPUNIT_ASSERT_EQUAL(std::numeric_limits::min(), 
static_cast(bi));
+CPPUNIT_ASSERT_EQUAL(std::numeric_limits::min(), 
static_cast(bi));
 }
 
-// positive number not fitting to long
+// positive number not fitting to sal_Int32
 {
-BigInt 
bi(static_cast(std::numeric_limits::max())
-  + static_cast(1));
+BigInt 
bi(static_cast(std::numeric_limits::max()) + 1);
 CPPUNIT_ASSERT(bi.IsSet());
 CPPUNIT_ASSERT(!bi.IsZero());
 CPPUNIT_ASSERT(!bi.IsNeg());
 CPPUNIT_ASSERT(!bi.IsLong());
 }
 
-// negative number not fitting to long
+// negative number not fitting to sal_Int32
 {
-BigInt 
bi(static_cast(std::numeric_limits::min())
-  - static_cast(1));
+BigInt 
bi(static_cast(std::numeric_limits::min()) - 1);
 CPPUNIT_ASSERT(bi.IsSet());
 CPPUNIT_ASSERT(!bi.IsZero());
 CPPUNIT_ASSERT(bi.IsNeg());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2020-11-14 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/globalfilter/globalfilter.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 562df2ad1c5196a36a16eb733371ee8eac4b502a
Author: Mike Kaganski 
AuthorDate: Sat Nov 14 19:06:29 2020 +0300
Commit: Mike Kaganski 
CommitDate: Sat Nov 14 19:20:23 2020 +0100

Fix unit tests involving tools::Long

Change-Id: Id32e6cfee81b2b59dc38bc1abcbeeb42cc376bfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105840
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx 
b/sw/qa/extras/globalfilter/globalfilter.cxx
index c0c72c5b7dfa..a2ef4d318ca6 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -1289,8 +1289,8 @@ void Test::testBulletAsImage()
 Graphic aGraphic(uno::Reference(xBitmap, 
uno::UNO_QUERY));
 CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
GraphicType::Bitmap, aGraphic.GetType());
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), 
aGraphic.GetSizeBytes() > o3tl::make_unsigned(0));
-CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 16L, 
aGraphic.GetSizePixel().Width());
-CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 16L, 
aGraphic.GetSizePixel().Height());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
tools::Long(16), aGraphic.GetSizePixel().Width());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
tools::Long(16), aGraphic.GetSizePixel().Height());
 
 // Graphic Size
 CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
sal_Int32(400), aSize.Width);
@@ -1349,8 +1349,8 @@ void Test::testBulletAsImage()
 Graphic aGraphic(uno::Reference(xBitmap, 
uno::UNO_QUERY));
 CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
GraphicType::Bitmap, aGraphic.GetType());
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), 
aGraphic.GetSizeBytes() > o3tl::make_unsigned(0));
-CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 16L, 
aGraphic.GetSizePixel().Width());
-CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 16L, 
aGraphic.GetSizePixel().Height());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
tools::Long(16), aGraphic.GetSizePixel().Width());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
tools::Long(16), aGraphic.GetSizePixel().Height());
 
 // Graphic Size
 if (rFilterName == "write8") // ODT is correct
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source

2020-11-14 Thread Julien Nabet (via logerrit)
 l10ntools/inc/helper.hxx|4 
 l10ntools/source/helper.cxx |6 ++
 2 files changed, 10 insertions(+)

New commits:
commit 457d76327a57303124804a201d58b52ba23ccefe
Author: Julien Nabet 
AuthorDate: Sat Nov 14 09:58:49 2020 +0100
Commit: Julien Nabet 
CommitDate: Sat Nov 14 19:16:12 2020 +0100

loplugin:stringviewparam (l10ntools)

Change-Id: I9102a00e19af87de4f666d1759551be3af311fe0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105828
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx
index a6eed4ff59d3..ff81f5792105 100644
--- a/l10ntools/inc/helper.hxx
+++ b/l10ntools/inc/helper.hxx
@@ -28,7 +28,11 @@ OString escapeAll(
 const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
 /// Unescape all given character in the text
 OString unEscapeAll(
+#ifdef DEBUG
 const OString& rText, const OString& rEscaped, const OString& rUnEscaped  
);
+#else
+const OString& rText, const OString& rEscaped, std::string_view rUnEscaped 
 );
+#endif
 
 /// Convert special characters to XML entity references
 OString QuotHTML( const OString &rString );
diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx
index b842755c27f6..22f5cc5df506 100644
--- a/l10ntools/source/helper.cxx
+++ b/l10ntools/source/helper.cxx
@@ -31,9 +31,15 @@ OString escapeAll(
 
 
 OString unEscapeAll(
+#ifdef DEBUG
 const OString& rText, const OString& rEscaped, const OString& rUnEscaped)
+#else
+const OString& rText, const OString& rEscaped, std::string_view rUnEscaped)
+#endif
 {
+#ifdef DEBUG
 assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
+#endif
 OStringBuffer sReturn;
 const sal_Int32 nLength = rText.getLength();
 for ( sal_Int32 nIndex = 0; nIndex < nLength; ++nIndex )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmloff/inc xmloff/source

2020-11-14 Thread Noel Grandin (via logerrit)
 xmloff/inc/XMLImageMapContext.hxx |7 +--
 xmloff/source/draw/XMLImageMapContext.cxx |   64 +-
 2 files changed, 24 insertions(+), 47 deletions(-)

New commits:
commit df3e347b30e60e3fbb6f32cbbed67377518e7862
Author: Noel Grandin 
AuthorDate: Sat Nov 14 18:00:36 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 14 19:06:04 2020 +0100

use fastparser in XMLImageMapContext

Change-Id: Ibdb7338298182515b624df4815c9d0177fe4badc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105838
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmloff/inc/XMLImageMapContext.hxx 
b/xmloff/inc/XMLImageMapContext.hxx
index 90b014000e4c..d026477a6c3a 100644
--- a/xmloff/inc/XMLImageMapContext.hxx
+++ b/xmloff/inc/XMLImageMapContext.hxx
@@ -50,10 +50,9 @@ public:
 
 virtual ~XMLImageMapContext() override;
 
-virtual SvXMLImportContextRef CreateChildContext(
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
-const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList 
) override;
+virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >& 
AttrList ) override;
 
 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
 };
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx 
b/xmloff/source/draw/XMLImageMapContext.cxx
index a8f8d13d98b8..0585bd60407f 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::xmloff::token;
@@ -118,8 +119,6 @@ public:
 
 XMLImageMapObjectContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 css::uno::Reference const & xMap,
 const char* pServiceName);
 
@@ -147,11 +146,9 @@ protected:
 
 XMLImageMapObjectContext::XMLImageMapObjectContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 Reference const & xMap,
 const char* pServiceName) :
-SvXMLImportContext(rImport, nPrefix, rLocalName),
+SvXMLImportContext(rImport),
 xImageMap(xMap),
 bIsActive(true),
 bValid(false)
@@ -290,8 +287,6 @@ public:
 
 XMLImageMapRectangleContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 css::uno::Reference const & xMap);
 
 protected:
@@ -307,10 +302,8 @@ protected:
 
 XMLImageMapRectangleContext::XMLImageMapRectangleContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 Reference const & xMap) :
-XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
+XMLImageMapObjectContext(rImport, xMap,
  "com.sun.star.image.ImageMapRectangleObject"),
 bXOK(false),
 bYOK(false),
@@ -388,8 +381,6 @@ public:
 
 XMLImageMapPolygonContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 css::uno::Reference const & xMap);
 
 protected:
@@ -405,10 +396,8 @@ protected:
 
 XMLImageMapPolygonContext::XMLImageMapPolygonContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 Reference const & xMap) :
-XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
+XMLImageMapObjectContext(rImport, xMap,
  "com.sun.star.image.ImageMapPolygonObject"),
 bViewBoxOK(false),
 bPointsOK(false)
@@ -474,8 +463,6 @@ public:
 
 XMLImageMapCircleContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 css::uno::Reference const & xMap);
 
 protected:
@@ -491,10 +478,8 @@ protected:
 
 XMLImageMapCircleContext::XMLImageMapCircleContext(
 SvXMLImport& rImport,
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
 Reference const & xMap)
-: XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
+: XMLImageMapObjectContext(rImport, xMap,
   "com.sun.star.image.ImageMapCircleObject")
 , nRadius(0)
 , bXOK(false)
@@ -582,33 +567,26 @@ XMLImageMapContext::~XMLImageMapContext()
 {
 }
 
-SvXMLImportContextRef XMLImageMapContext::CreateChildContext(
-sal_uInt16 nPrefix,
-const OUString& rLocalName,
-const Reference & /*xAttrList*/ )
+css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLImageMapContext::createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
-SvXMLImportContextRef xContext;
-
-if ( XML_NAMESPACE_DRAW == nPrefix )
+switch (nElement)
 {
-if ( IsXMLToken(rLocalName, XML_AREA_RECTANGLE) )

[Libreoffice-commits] core.git: xmloff/inc xmloff/source

2020-11-14 Thread Noel Grandin (via logerrit)
 xmloff/inc/XMLEmbeddedObjectImportContext.hxx |6 +--
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |   31 +++---
 2 files changed, 16 insertions(+), 21 deletions(-)

New commits:
commit 0d8191bf574751d8006344ae4db9ef1e4bf547f8
Author: Noel Grandin 
AuthorDate: Sat Nov 14 17:53:46 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 14 18:46:25 2020 +0100

use fastparser in XMLEmbeddedObjectImportContext

Change-Id: I57352475bb62c75cddc7f3eafc0e0fcca166953b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105837
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx 
b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
index 7f2a739e07af..95942f2331c5 100644
--- a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
+++ b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
@@ -44,9 +44,9 @@ public:
 
 virtual ~XMLEmbeddedObjectImportContext() override;
 
-virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
-   const OUString& rLocalName,
-   const css::uno::Reference< 
css::xml::sax::XAttributeList >& xAttrList ) override;
+virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >& 
AttrList ) override;
 
 virtual void SAL_CALL startFastElement(
 sal_Int32 nElement,
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx 
b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index bfb182edaf3d..a8cc84392627 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -51,13 +51,12 @@ class XMLEmbeddedObjectImportContext_Impl : public 
SvXMLImportContext
 
 public:
 
-XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport, sal_uInt16 
nPrfx,
-const OUString& rLName,
+XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport,
 const css::uno::Reference< 
css::xml::sax::XFastDocumentHandler >& rHandler );
 
-virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
-   const OUString& rLocalName,
-   const css::uno::Reference< 
css::xml::sax::XAttributeList >& xAttrList ) override;
+virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
+sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >& 
AttrList ) override;
 
 virtual void SAL_CALL startFastElement(
 sal_Int32 nElement,
@@ -71,19 +70,17 @@ public:
 }
 
 XMLEmbeddedObjectImportContext_Impl::XMLEmbeddedObjectImportContext_Impl(
-SvXMLImport& rImport, sal_uInt16 nPrfx,
-const OUString& rLName,
+SvXMLImport& rImport,
 const Reference< XFastDocumentHandler >& rHandler ) :
-SvXMLImportContext( rImport, nPrfx, rLName ),
+SvXMLImportContext( rImport ),
 mxFastHandler( rHandler )
 {
 assert(mxFastHandler);
 }
 
-SvXMLImportContextRef XMLEmbeddedObjectImportContext_Impl::CreateChildContext(
-sal_uInt16 /*nPrefix*/,
-const OUString& /*rLocalName*/,
-const Reference< XAttributeList >& )
+css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLEmbeddedObjectImportContext_Impl::createFastChildContext(
+sal_Int32 ,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >&  )
 {
 // we carry no state, so just re-use the same instance
 return this;
@@ -231,14 +228,12 @@ 
XMLEmbeddedObjectImportContext::~XMLEmbeddedObjectImportContext()
 {
 }
 
-SvXMLImportContextRef XMLEmbeddedObjectImportContext::CreateChildContext(
-sal_uInt16 nPrefix, const OUString& rLocalName,
-const Reference< XAttributeList >& )
+css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLEmbeddedObjectImportContext::createFastChildContext(
+sal_Int32 ,
+const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
 {
 if( mxFastHandler.is() )
-return new XMLEmbeddedObjectImportContext_Impl( GetImport(),
-nPrefix, rLocalName,
-mxFastHandler );
+return new XMLEmbeddedObjectImportContext_Impl( GetImport(), 
mxFastHandler );
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: emfio/qa emfio/source

2020-11-14 Thread Bartosz Kosiorek (via logerrit)
 emfio/qa/cppunit/emf/EmfImportTest.cxx  |   53 
 emfio/qa/cppunit/emf/data/TestCreatePen.emf |binary
 emfio/source/reader/emfreader.cxx   |   29 +--
 3 files changed, 71 insertions(+), 11 deletions(-)

New commits:
commit eb2fdd9bc6696732fa472f6883993334898cef7a
Author: Bartosz Kosiorek 
AuthorDate: Fri Nov 13 13:24:36 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Sat Nov 14 18:12:42 2020 +0100

tdf#35986 EMF import: Add support for PS_COSMETIC line style in CREATEPEN

When the PS_COSMETIC line style is set in CREATEPEN,
line width should be set to one logical unit and a style that is a solid 
color

This patch is fixing that, allowing to properly import EMF file.
The corresponding unit tests were added

Change-Id: I1a0caf6382d9c313d9725d0b94e2fcd37122a099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105790
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx 
b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 94914da60f8a..29c084874b6d 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -50,6 +50,7 @@ class Test : public test::BootstrapFixture, public 
XmlTestTools, public unotest:
 void TestDrawLine();
 void TestLinearGradient();
 void TestTextMapMode();
+void TestCreatePen();
 void TestPdfInEmf();
 
 Primitive2DSequence parseEmf(const OUString& aSource);
@@ -66,6 +67,7 @@ public:
 CPPUNIT_TEST(TestDrawLine);
 CPPUNIT_TEST(TestLinearGradient);
 CPPUNIT_TEST(TestTextMapMode);
+CPPUNIT_TEST(TestCreatePen);
 CPPUNIT_TEST(TestPdfInEmf);
 CPPUNIT_TEST_SUITE_END();
 };
@@ -270,6 +272,57 @@ void Test::TestTextMapMode()
 assertXPath(pDocument, 
"/primitive2D/metafile/transform/polygonstroke[20]/line", "width", "11");
 }
 
+
+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 will be 
displayed as solid hairline
+Primitive2DSequence aSequence = 
parseEmf("/emfio/qa/cppunit/emf/data/TestCreatePen.emf");
+CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength()));
+drawinglayer::Primitive2dXmlDump dumper;
+xmlDocUniquePtr pDocument = 
dumper.dumpAndParse(comphelper::sequenceToContainer(aSequence));
+CPPUNIT_ASSERT (pDocument);
+
+assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygon", 
"path", "m0 0h31250v18192h-31250z");
+
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke", 3);
+assertXPathContent(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[1]/polygon", "17898,5693 
20172,5693");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "color", 
"#008000");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "width", "3");
+
+assertXPathContent(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[2]/polygon", "17898,6959 
20172,6959");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "color", 
"#80");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "width", "3");
+
+assertXPathContent(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[3]/polygon", "17898,7381 
20172,7381");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[3]/line", "color", 
"#ff");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonstroke[3]/line", "width", "3");
+
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonhairline", 755);
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonhairline[10]", "color", "#ff");
+assertXPathContent(pDocument, 
"/primitive2D/metafile/transform/mask/polygonhairline[10]/polygon", 
"27925,14180 27875,14180");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/polygonhairline[100]", "color", 
"#008000");
+assertXPathContent(pDocument, 
"/primitive2D/metafile/transform/mask/polygonhairline[100]/polygon", 
"26100,14414 26050,14414");
+
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion", 69);
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion[1]", "width", "374");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion[1]", "x", "28124");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion[1]", "y", "16581");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion[1]", "text", "0.0");
+assertXPath(pDocument, 
"/primitive2D/metafile/transform/mask/textsimpleportion[1]", "fontcolor", 
"#00");
+
+assertXPath

[Libreoffice-commits] core.git: drawinglayer/source emfio/qa emfio/source

2020-11-14 Thread Bartosz Kosiorek (via logerrit)
 drawinglayer/source/tools/primitive2dxmldump.cxx |   45 
 emfio/qa/cppunit/emf/EmfImportTest.cxx   |   81 ++-
 emfio/qa/cppunit/emf/data/TextMapMode.emf|binary
 emfio/source/reader/mtftools.cxx |   35 +++--
 4 files changed, 137 insertions(+), 24 deletions(-)

New commits:
commit b0b78838e795fcd7f3c53e7f74fb32b2921a5ccb
Author: Bartosz Kosiorek 
AuthorDate: Thu Nov 12 21:48:44 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Sat Nov 14 18:10:09 2020 +0100

tdf#35986 tdf#92315 tdf#116335 tdf#116622 Add support for MapMode TEXT

To properly import some EMF files, the proper implementation of MapMode Text
needs to be done according to MS documentation.
I have also added regression tests.

Change-Id: Id788294a498b93bebb62118d13ea545f80a60f01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105771
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index b9c4e2f83d1d..7a19e0486c89 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -206,7 +207,50 @@ void Primitive2dXmlDump::decomposeAndWrite(
 rWriter.endElement();
 }
 break;
+case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D:
+{
+const PointArrayPrimitive2D& rPointArrayPrimitive2D = 
dynamic_cast(*pBasePrimitive);
+rWriter.startElement("pointarray");
+
+rWriter.attribute("color", 
convertColorToString(rPointArrayPrimitive2D.getRGBColor()));
+
+const std::vector< basegfx::B2DPoint > aPositions = 
rPointArrayPrimitive2D.getPositions();
+for (std::vector::const_iterator iter = 
aPositions.begin(); iter != aPositions.end(); ++iter)
+{
+rWriter.startElement("point");
+rWriter.attribute("x", OUString::number(iter->getX()));
+rWriter.attribute("y", OUString::number(iter->getY()));
+rWriter.endElement();
+}
+
+rWriter.endElement();
+}
+break;
+case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
+{
+const PolygonStrokePrimitive2D& rPolygonStrokePrimitive2D = 
dynamic_cast(*pBasePrimitive);
+rWriter.startElement("polygonstroke");
+
+rWriter.startElement("polygon");
+
rWriter.content(basegfx::utils::exportToSvgPoints(rPolygonStrokePrimitive2D.getB2DPolygon()));
+rWriter.endElement();
+
+rWriter.startElement("line");
+const drawinglayer::attribute::LineAttribute& aLineAttribute = 
rPolygonStrokePrimitive2D.getLineAttribute();
+rWriter.attribute("color", 
convertColorToString(aLineAttribute.getColor()));
+rWriter.attribute("width", aLineAttribute.getWidth());
+
+rWriter.endElement();
+
+rWriter.startElement("stroke");
+const drawinglayer::attribute::StrokeAttribute& 
aStrokeAttribute = rPolygonStrokePrimitive2D.getStrokeAttribute();
+rWriter.attribute("fulldotdashlen", 
aStrokeAttribute.getFullDotDashLen());
+//rWriter.attribute("dotdasharray", 
aStrokeAttribute.getDotDashArray());
+rWriter.endElement();
 
+rWriter.endElement();
+}
+break;
 case PRIMITIVE2D_ID_POLYPOLYGONSTROKEPRIMITIVE2D:
 {
 const PolyPolygonStrokePrimitive2D& 
rPolyPolygonStrokePrimitive2D = dynamic_cast(*pBasePrimitive);
@@ -434,6 +478,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
 {
 rWriter.startElement("unhandled");
 rWriter.attribute("id", OUStringToOString(sCurrentElementTag, 
RTL_TEXTENCODING_UTF8));
+rWriter.attribute("idNumber", nId);
 drawinglayer::primitive2d::Primitive2DContainer 
aPrimitiveContainer;
 pBasePrimitive->get2DDecomposition(aPrimitiveContainer,

drawinglayer::geometry::ViewInformation2D());
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx 
b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 9c03f92eb061..94914da60f8a 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -44,13 +44,12 @@ class Test : public test::BootstrapFixture, public 
XmlTestTools, public unotest:
 {
 uno::Reference mxComponent;
 
-void checkRectPrimitive(Primitive2DSequence const & rPrimitive);
-
-void testWorking();
+void testPolyPolygon();
 void TestDrawString();
 void TestDrawStringTransparent();
 vo

[Libreoffice-commits] core.git: chart2/source

2020-11-14 Thread Andrea Gelmini (via logerrit)
 chart2/source/controller/sidebar/ChartElementsPanel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fc351e37d6513be91c03d9a81e977a817d65206d
Author: Andrea Gelmini 
AuthorDate: Sat Nov 14 12:27:23 2020 +0100
Commit: Julien Nabet 
CommitDate: Sat Nov 14 18:06:52 2020 +0100

Fix typo

Change-Id: Iea4c4b35f4e658bffcfcac8ee933fbd96f7448f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105833
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx 
b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index c380459cfd9f..27b96dc74007 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -664,7 +664,7 @@ void 
ChartElementsPanel::setTitleVisible(TitleHelper::eTitleType eTitle, bool bV
 else
 {
 // TODO tdf#92768 use TitleHelper::hideTitle() here once there is
-// rendering suport for the property "Visible"
+// rendering support for the property "Visible"
 TitleHelper::removeTitle(eTitle, mxModel);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - include/vcl vcl/source xmlsecurity/inc xmlsecurity/qa xmlsecurity/source xmlsecurity/workben

2020-11-14 Thread Miklos Vajna (via logerrit)
 include/vcl/filter/PDFiumLibrary.hxx|2 
 include/vcl/filter/pdfdocument.hxx  |6 +
 vcl/source/filter/ipdf/pdfdocument.cxx  |   82 ++--
 vcl/source/pdf/PDFiumLibrary.cxx|   12 +-
 xmlsecurity/inc/pdfio/pdfdocument.hxx   |2 
 xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p1.pdf |binary
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx   |   25 +-
 xmlsecurity/source/helper/pdfsignaturehelper.cxx|5 -
 xmlsecurity/source/pdfio/pdfdocument.cxx|   18 ++--
 xmlsecurity/workben/pdfverify.cxx   |3 
 10 files changed, 129 insertions(+), 26 deletions(-)

New commits:
commit 00479937dc071246cc27f33fd6397668448a7ed9
Author: Miklos Vajna 
AuthorDate: Mon Oct 19 16:50:07 2020 +0200
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 16:32:15 2020 +0100

xmlsecurity: handle MDP permission during PDF verify

(cherry picked from commit 586f6abee92af3cdabdce034b607b9a046ed3946)

Conflicts:
include/vcl/filter/PDFiumLibrary.hxx
vcl/source/pdf/PDFiumLibrary.cxx
xmlsecurity/source/helper/pdfsignaturehelper.cxx

Change-Id: I626fca7c03079fb0374c577dcfe024e7db6ed5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105785
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 639c71d61a3d..3e2851d21e0e 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -58,7 +58,7 @@ public:
 }
 
 /// Get bitmap checksum of the page, without annotations/commenting.
-BitmapChecksum getChecksum();
+BitmapChecksum getChecksum(int nMDPPerm);
 };
 
 class VCL_DLLPUBLIC PDFiumDocument final
diff --git a/include/vcl/filter/pdfdocument.hxx 
b/include/vcl/filter/pdfdocument.hxx
index 638aef3b5a4d..ff52aa98d317 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -379,6 +379,7 @@ public:
 size_t GetObjectOffset(size_t nIndex) const;
 const std::vector>& GetElements() const;
 std::vector GetPages();
+PDFObjectElement* GetCatalog();
 /// Remember the end location of an EOF token.
 void PushBackEOF(size_t nOffset);
 /// Look up object based on object number, possibly by parsing object 
streams.
@@ -404,6 +405,11 @@ public:
 bool Write(SvStream& rStream);
 /// Get a list of signatures embedded into this document.
 std::vector GetSignatureWidgets();
+/**
+ * Get the value of the "modification detection and prevention" permission:
+ * Valid values are 1, 2 and 3: only 3 allows annotations after signing.
+ */
+int GetMDPPerm();
 /// Remove the nth signature from read document in the edit buffer.
 bool RemoveSignature(size_t nPosition);
 /// Get byte offsets of the end of incremental updates.
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx 
b/vcl/source/filter/ipdf/pdfdocument.cxx
index 79efb85f9b97..b647421887e4 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -1862,10 +1862,8 @@ static void visitPages(PDFObjectElement* pPages, 
std::vector&
 pPages->setVisiting(false);
 }
 
-std::vector PDFDocument::GetPages()
+PDFObjectElement* PDFDocument::GetCatalog()
 {
-std::vector aRet;
-
 PDFReferenceElement* pRoot = nullptr;
 
 PDFTrailerElement* pTrailer = nullptr;
@@ -1885,11 +1883,18 @@ std::vector PDFDocument::GetPages()
 
 if (!pRoot)
 {
-SAL_WARN("vcl.filter", "PDFDocument::GetPages: trailer has no Root 
key");
-return aRet;
+SAL_WARN("vcl.filter", "PDFDocument::GetCatalog: trailer has no Root 
key");
+return nullptr;
 }
 
-PDFObjectElement* pCatalog = pRoot->LookupObject();
+return pRoot->LookupObject();
+}
+
+std::vector PDFDocument::GetPages()
+{
+std::vector aRet;
+
+PDFObjectElement* pCatalog = GetCatalog();
 if (!pCatalog)
 {
 SAL_WARN("vcl.filter", "PDFDocument::GetPages: trailer has no 
catalog");
@@ -1962,6 +1967,71 @@ std::vector 
PDFDocument::GetSignatureWidgets()
 return aRet;
 }
 
+int PDFDocument::GetMDPPerm()
+{
+int nRet = 3;
+
+std::vector aSignatures = GetSignatureWidgets();
+if (aSignatures.empty())
+{
+return nRet;
+}
+
+for (const auto& pSignature : aSignatures)
+{
+vcl::filter::PDFObjectElement* pSig = pSignature->LookupObject("V");
+if (!pSig)
+{
+SAL_WARN("vcl.filter", "PDFDocument::GetMDPPerm: can't find 
signature object");
+continue;
+}
+
+auto pReference = 
dynamic_cast(pSig->Lookup("Reference"));
+if (!pReference || pReference->GetElements().empty())
+{
+continue;
+}
+
+auto pFirstReference = 
dynamic_cast(pReference->GetElements()[0]);
+if (!pFirstReferen

[Libreoffice-commits] core.git: bin/distro-install-desktop-integration sysui/CustomTarget_deb.mk sysui/CustomTarget_share.mk sysui/desktop

2020-11-14 Thread Chris Mayo (via logerrit)
 bin/distro-install-desktop-integration 
|5 
 sysui/CustomTarget_deb.mk  
|1 
 sysui/CustomTarget_share.mk
|   36 ---
 sysui/desktop/freedesktop/freedesktop-menus.spec   
|3 
 sysui/desktop/mimetypes/drawing-template.keys  
|   10 -
 sysui/desktop/mimetypes/drawing.keys   
|   10 -
 sysui/desktop/mimetypes/extension.keys 
|   10 -
 sysui/desktop/mimetypes/formula.keys   
|   10 -
 sysui/desktop/mimetypes/master-document.keys   
|   10 -
 sysui/desktop/mimetypes/ms-excel-sheet-12.keys 
|   10 -
 sysui/desktop/mimetypes/ms-excel-sheet-binary-12.keys  
|   10 -
 sysui/desktop/mimetypes/ms-excel-sheet.keys
|   10 -
 sysui/desktop/mimetypes/ms-excel-template-12.keys  
|   10 -
 sysui/desktop/mimetypes/ms-powerpoint-presentation-12.keys 
|   10 -
 sysui/desktop/mimetypes/ms-powerpoint-presentation.keys
|   10 -
 sysui/desktop/mimetypes/ms-powerpoint-template-12.keys 
|   10 -
 sysui/desktop/mimetypes/ms-word-document-12.keys   
|   10 -
 sysui/desktop/mimetypes/ms-word-document.keys  
|   10 -
 sysui/desktop/mimetypes/ms-word-document2.keys 
|   10 -
 sysui/desktop/mimetypes/ms-word-template-12.keys   
|   10 -
 sysui/desktop/mimetypes/oasis-database.keys
|   10 -
 sysui/desktop/mimetypes/oasis-drawing-flat-xml.keys
|   10 -
 sysui/desktop/mimetypes/oasis-drawing-template.keys
|   10 -
 sysui/desktop/mimetypes/oasis-drawing.keys 
|   10 -
 sysui/desktop/mimetypes/oasis-formula.keys 
|   10 -
 sysui/desktop/mimetypes/oasis-master-document-template.keys
|9 
 sysui/desktop/mimetypes/oasis-master-document.keys 
|   10 -
 sysui/desktop/mimetypes/oasis-presentation-flat-xml.keys   
|   10 -
 sysui/desktop/mimetypes/oasis-presentation-template.keys   
|   10 -
 sysui/desktop/mimetypes/oasis-presentation.keys
|   10 -
 sysui/desktop/mimetypes/oasis-spreadsheet-flat-xml.keys
|   10 -
 sysui/desktop/mimetypes/oasis-spreadsheet-template.keys
|   10 -
 sysui/desktop/mimetypes/oasis-spreadsheet.keys 
|   10 -
 sysui/desktop/mimetypes/oasis-text-flat-xml.keys   
|   10 -
 sysui/desktop/mimetypes/oasis-text-template.keys   
|9 
 sysui/desktop/mimetypes/oasis-text.keys
|   10 -
 sysui/desktop/mimetypes/oasis-web-template.keys
|   10 -
 sysui/desktop/mimetypes/openoffice.applications
|9 
 sysui/desktop/mimetypes/openoffice.mime
|   95 --
 
sysui/desktop/mimetypes/openxmlformats-officedocument-presentationml-presentation.keys
 |   10 -
 
sysui/desktop/mimetypes/openxmlformats-officedocument-presentationml-template.keys
 |   10 -
 sysui/desktop/mimetypes/openxmlformats-officedocument-spreadsheetml-sheet.keys 
|   10 -
 
sysui/desktop/mimetypes/openxmlformats-officedocument-spreadsheetml-template.keys
  |   10 -
 
sysui/desktop/mimetypes/openxmlformats-officedocument-wordprocessingml-document.keys
   |   10 -
 
sysui/desktop/mimetypes/openxmlformats-officedocument-wordprocessingml-template.keys
   |   10 -
 sysui/desktop/mimetypes/presentation-template.keys 
|   10 -
 sysui/desktop/mimetypes/presentation.keys  
|   10 -
 sysui/desktop/mimetypes/spreadsheet-template.keys  
|   10 -
 sysui/desktop/mimetypes/spreadsheet.keys   
|   10 -
 sysui/desktop/mimetypes/text-template.keys 
|9 
 sysui/desktop/mimetypes/text.keys  
|

[Libreoffice-commits] core.git: sw/qa sw/source

2020-11-14 Thread Xisco Fauli (via logerrit)
 dev/null|binary
 sw/qa/core/layout/layout.cxx|   15 ---
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|3 -
 sw/source/core/layout/objectformattertxtfrm.cxx |   51 
 4 files changed, 19 insertions(+), 50 deletions(-)

New commits:
commit ad53d723715b2ca3ab0d3415c532295ef17ced29
Author: Xisco Fauli 
AuthorDate: Fri Nov 13 14:50:16 2020 +0100
Commit: Xisco Fauli 
CommitDate: Sat Nov 14 14:35:41 2020 +0100

Revert "tdf#137881 sw: fix text box size regression"

This reverts commit f2eef84ff03660cbb46a76c317e640e054ed0a56.

Reason for revert: 
https://bugs.documentfoundation.org/show_bug.cgi?id=135198#c9

This also reverts part of 768cfcee178b284be6d96d384364e59e40ecb375
without breaking tdf#137960 nor tdf#137964

Change-Id: Ifa418e66b8a45c6204babfae6513ca67aed93289
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105545
Reviewed-by: Dániel Arató 
Reviewed-by: Xisco Fauli 
Tested-by: Xisco Fauli 

diff --git a/sw/qa/core/layout/data/bottom-textbox-size.docx 
b/sw/qa/core/layout/data/bottom-textbox-size.docx
deleted file mode 100644
index a1c700f28ae9..
Binary files a/sw/qa/core/layout/data/bottom-textbox-size.docx and /dev/null 
differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index ff339322fe70..a992a32ae7d4 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -196,21 +196,6 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testTextBoxStaysInsideShape)
nTextBoxTopAfter < nTextBoxTopBefore);
 }
 
-CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxSizeAtBottomOfPage)
-{
-// tdf#137881: check whether text box at the bottom of the page stays the 
right size
-load(DATA_DIRECTORY, "bottom-textbox-size.docx");
-SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
-SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
-SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-SdrObject* pTextBoxObj = pPage->GetObj(0);
-
-uno::Reference xShape(pTextBoxObj->getUnoShape(), 
uno::UNO_QUERY_THROW);
-const sal_Int32 nHeight = xShape->getSize().Height;
-CPPUNIT_ASSERT_EQUAL_MESSAGE("text box was not supposed to be resized on 
fileopen",
- static_cast(2200), nHeight);
-}
-
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 5919d1a6f76d..ec680a69a6ad 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1065,7 +1065,8 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, 
"textbox-wps-only.docx")
 if ( nsScreen.frame.size.width * scaleFactor > 4000 )
 return;
 #endif
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, 
"VertOrientPosition"));
+// Vertically oriented to page due to tdf#135198
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5304), getProperty(xFrame, 
"VertOrientPosition"));
 }
 
 DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index e3a9b4eb6711..85313839f889 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -355,41 +355,24 @@ bool SwObjectFormatterTextFrame::DoFormatObjs()
 SwFrameFormat& rFormat = pObj->GetFrameFormat();
 if (SwTextBoxHelper::isTextBox(&rFormat, RES_DRAWFRMFMT))
 {
-const SwFrameFormat* pOtherFormat = 
SwTextBoxHelper::getOtherTextBoxFormat(&rFormat, RES_DRAWFRMFMT);
-if (rFormat.GetVertOrient().GetPos() != 
pOtherFormat->GetVertOrient().GetPos() ||
-rFormat.GetAnchor().GetAnchorId() != 
pOtherFormat->GetAnchor().GetAnchorId())
+if (const SwPageFrame* pPageFrame = pObj->GetPageFrame())
 {
-if (const SwPageFrame* pPageFrame = 
pObj->GetPageFrame())
-{
-SwDoc* pDoc = rFormat.GetDoc();
-
-// avoid Undo creation,
-::sw::UndoGuard const 
ug(pDoc->GetIDocumentUndoRedo());
-
-SfxItemSet aSet(pDoc->GetAttrPool(),
-svl::Items{});
-
-const SwRect& rPageFrameArea = 
pPageFrame->getFrameArea();
-if (rFormat.GetVertOrient().GetPos() != 
pOtherFormat->GetVertOrient().GetPos())
-{
-
aSet.Put(SwFormatVertOrient(pObj->GetObjRect().Top() - rPageFrameArea.Top(),
- 

[Libreoffice-commits] core.git: vcl/skia

2020-11-14 Thread Luboš Luňák (via logerrit)
 vcl/skia/win/gdiimpl.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 96f5152486a28d77050dc114e293431afddf5142
Author: Luboš Luňák 
AuthorDate: Thu Nov 12 15:56:32 2020 +0100
Commit: Luboš Luňák 
CommitDate: Sat Nov 14 12:20:27 2020 +0100

fix updates of Skia draw region for Windows widgets (tdf#137559)

Change-Id: I787c427dd17334095d5b2d90c6a9670d58ee9a4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105762
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index c3cb3a48b066..6b68571d6ab1 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -92,6 +92,8 @@ bool 
WinSkiaSalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey const&
<< this << "): "
<< SkIRect::MakeXYWH(nX, nY, 
iterator->second->width(),
 
iterator->second->height()));
+addUpdateRegion(
+SkRect::MakeXYWH(nX, nY, iterator->second->width(), 
iterator->second->height()));
 mSurface->getCanvas()->drawImage(iterator->second, nX, nY);
 postDraw();
 return true;
@@ -110,6 +112,7 @@ bool 
WinSkiaSalGraphicsImpl::RenderAndCacheNativeControl(CompatibleDC& rWhite, C
 SAL_INFO("vcl.skia.trace",
  "renderandcachednativecontrol("
  << this << "): " << SkIRect::MakeXYWH(nX, nY, image->width(), 
image->height()));
+addUpdateRegion(SkRect::MakeXYWH(nX, nY, image->width(), image->height()));
 mSurface->getCanvas()->drawImage(image, nX, nY);
 postDraw();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa sw/source

2020-11-14 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ooxmlexport/data/conditional-text.fodt |8 ++
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx   |   13 ++
 sw/source/filter/ww8/docxattributeoutput.cxx|   24 +++-
 3 files changed, 44 insertions(+), 1 deletion(-)

New commits:
commit 5d839ff8a81ade6453a239a258b2a2571e32001e
Author: Miklos Vajna 
AuthorDate: Fri Nov 13 16:26:43 2020 +0100
Commit: Miklos Vajna 
CommitDate: Sat Nov 14 12:01:39 2020 +0100

DOCX export: handle conditional fields

At least the subset where the condition syntax matches between Writer
and Word.

Change-Id: I107f2b4caeda6f696af8d5c5b455854cfa92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105798
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/conditional-text.fodt 
b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
new file mode 100644
index ..296c1c4ecc4d
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
@@ -0,0 +1,8 @@
+
+http://openoffice.org/2004/writer"; 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   True
+  
+ 
+
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index eaf33fdda6b0..1a94982df7e9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -663,6 +663,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132185, 
"tdf132185.docx")
 assertXPathContent(pXmlDoc, "/w:ftr/w:p/w:r[2]/w:instrText", " PAGE \\* 
roman ");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testConditionalText, 
"conditional-text.fodt")
+{
+// Load a document which has a conditional text field in it.
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+std::u16string_view aExpected(u" IF 1 < 2 \"True\" \"False\"");
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0
+// - In <...>, XPath '/w:document/w:body/w:p/w:r[2]/w:instrText' not found
+// i.e. the field was lost on export.
+assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", 
aExpected);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index c2c1bee6..99cd7eabd6c4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7881,8 +7881,30 @@ void DocxAttributeOutput::RefField( const SwField&  
rField, const OUString& rRef
 // There is nothing to do here for the set fields
 }
 
-void DocxAttributeOutput::HiddenField( const SwField& /*rField*/ )
+void DocxAttributeOutput::HiddenField(const SwField& rField)
 {
+auto eSubType = static_cast(rField.GetSubType());
+if (eSubType == SwFieldTypesEnum::ConditionalText)
+{
+OUString aCond = rField.GetPar1();
+OUString aTrueFalse = rField.GetPar2();
+sal_Int32 nPos = aTrueFalse.indexOf('|');
+OUString aTrue;
+OUString aFalse;
+if (nPos == -1)
+{
+aTrue = aTrueFalse;
+}
+else
+{
+aTrue = aTrueFalse.subView(0, nPos);
+aFalse = aTrueFalse.subView(nPos + 1);
+}
+OUString aCmd = FieldString(ww::eIF) + aCond + " \"" + aTrue + "\" \"" 
+ aFalse + "\"";
+m_rExport.OutputField(&rField, ww::eIF, aCmd);
+return;
+}
+
 SAL_INFO("sw.ww8", "TODO DocxAttributeOutput::HiddenField()" );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-11-14 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin2.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 05b279e7e0773d3c3da2688a2b95edfb8c88308c
Author: Caolán McNamara 
AuthorDate: Fri Nov 13 16:55:07 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 10:51:14 2020 +0100

tdf#136336 ensure tooltip area surrounds the current mouse position

with at least a pixel margin

Change-Id: I74935f0275863cfd5a799927034d0a31dae073cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105800
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index 0ffe30e41044..18003f48bb99 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -365,6 +365,13 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
 aRect.SetRight( aPt.X() );
 aRect.SetBottom( aPt.Y() );
 
+// tdf#136336 ensure tooltip area surrounds the current mouse 
position with at least a pixel margin
+aRect.Union(tools::Rectangle(rEvt.GetMousePosPixel(), Size(1, 
1)));
+aRect.AdjustLeft(-1);
+aRect.AdjustRight(1);
+aRect.AdjustTop(-1);
+aRect.AdjustBottom(1);
+
 if( bBalloon )
 Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, 
sText );
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source

2020-11-14 Thread Caolán McNamara (via logerrit)
 vcl/source/window/builder.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 8fe325c9e584d2b60875106858162e28d22d9020
Author: Caolán McNamara 
AuthorDate: Fri Nov 13 17:04:56 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 10:49:50 2020 +0100

allow F1<->F26 accelerators in .ui

Change-Id: I574a92839664643b1e42f3184471bc05e8b4da31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105801
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c1163335aaff..9e322c3f1935 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3507,6 +3507,12 @@ namespace
 return vcl::KeyCode(KEY_RIGHT, bShift, bMod1, bMod2, bMod3);
 else if (rKey.first == "asterisk")
 return vcl::KeyCode(KEY_MULTIPLY, bShift, bMod1, bMod2, bMod3);
+else if (rKey.first.getLength() > 1 && rKey.first[0] == 'F')
+{
+sal_uInt32 nIndex = rKey.first.copy(1).toUInt32();
+assert(nIndex >= 1 && nIndex <= 26);
+return vcl::KeyCode(KEY_F1 + nIndex - 1, bShift, bMod1, bMod2, 
bMod3);
+}
 
 assert (rKey.first.getLength() == 1);
 char cChar = rKey.first.toChar();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl vcl/source

2020-11-14 Thread Caolán McNamara (via logerrit)
 include/vcl/toolkit/ivctrl.hxx |1 +
 vcl/source/control/imivctl.hxx |5 +
 vcl/source/control/ivctrl.cxx  |6 ++
 3 files changed, 12 insertions(+)

New commits:
commit d538de17562b2c7ca2c382aeae7c95827999abe5
Author: Caolán McNamara 
AuthorDate: Thu Nov 12 15:13:07 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 14 10:48:45 2020 +0100

Related: tdf#131970 icon-switcher should be in single-selection mode

Change-Id: Ie5ac5ccf1273905832e934998f206425401b0f30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105763
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index f4c50b48c84d..e322631036a3 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -213,6 +213,7 @@ public:
 virtual voiddispose() override;
 
 WinBits GetStyle() const;
+void SetSelectionMode(SelectionMode eMode);
 
 voidSetFont( const vcl::Font& rFont );
 voidSetPointFont( const vcl::Font& rFont );
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 8e63a555b6b9..9695e99a665d 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -252,6 +252,11 @@ public:
 SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, 
WinBits nWinStyle );
 ~SvxIconChoiceCtrl_Impl();
 
+void SetSelectionMode(SelectionMode eMode)
+{
+eSelectionMode = eMode;
+}
+
 voidClear( bool bInCtor );
 voidSetStyle( WinBits nWinStyle );
 WinBits GetStyle() const { return nWinBits; }
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index dc304e511937..87b746c88da0 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -97,6 +97,11 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, 
WinBits nWinStyle )
 _pImpl->SetPositionMode( SvxIconChoiceCtrlPositionMode::AutoArrange );
 }
 
+void SvtIconChoiceCtrl::SetSelectionMode(SelectionMode eMode)
+{
+_pImpl->SetSelectionMode(eMode);
+}
+
 SvtIconChoiceCtrl::~SvtIconChoiceCtrl()
 {
 disposeOnce();
@@ -440,6 +445,7 @@ VerticalTabControl::VerticalTabControl(vcl::Window* pParent)
 {
 SetStyle(GetStyle() | WB_DIALOGCONTROL);
 SetType(WindowType::VERTICALTABCONTROL);
+m_xChooser->SetSelectionMode(SelectionMode::Single);
 m_xChooser->SetClickHdl(LINK(this, VerticalTabControl, ChosePageHdl_Impl));
 m_xChooser->set_width_request(110);
 m_xChooser->set_height_request(400);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits