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

2021-10-21 Thread Noel Grandin (via logerrit)
 sw/inc/bparr.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 88e78230dedb0767e2f5067961b66a3858b3b7a5
Author: Noel Grandin 
AuthorDate: Thu Oct 21 15:56:55 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 22 08:31:56 2021 +0200

re-arrange BlockInfo a little

so that it is more likely that the interesting data is next to each
other and thus in CPU cache (i.e. the control fields and the first few
elements of the array)

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

diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index f4c1c47d6da1..c9bc8d041ab1 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -57,10 +57,10 @@ public:
 struct BlockInfo final
 {
 BigPtrArray* pBigArr;  ///< in this array the block is located
-std::array
- mvData;   ///< data block
 sal_Int32nStart, nEnd; ///< start- and end index
 sal_uInt16   nElem;///< number of elements
+std::array
+ mvData;   ///< data block
 };
 
 class SW_DLLPUBLIC BigPtrArray


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sfx2/source

2021-10-21 Thread Noel Grandin (via logerrit)
 sfx2/source/doc/docfile.cxx |   60 +++-
 1 file changed, 27 insertions(+), 33 deletions(-)

New commits:
commit a692b0f1229fa92e1ce773b1d3aa0522b2617f3d
Author: Noel Grandin 
AuthorDate: Thu Oct 21 09:07:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 22 08:31:36 2021 +0200

tdf#144650 crash after opening of read-only file

Change-Id: Ia888ae79940cbc618b2e693d0e658c152346e926
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123948
Reviewed-by: Kevin Suo 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit 6772ed1dcd0a3f89f65375e10cba06544c46226a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123981

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c7655e2c5f62..734611b9f6f1 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4734,10 +4734,11 @@ void CheckReadOnlyTask::doWork()
 // must have timed-out
 termLock.unlock();
 std::unique_lock globalLock(g_chkReadOnlyGlobalMutex);
-for (const auto& [pMed, roEntry] : g_newReadOnlyDocs)
+for (auto it = g_newReadOnlyDocs.begin(); it != 
g_newReadOnlyDocs.end(); )
 {
+auto [pMed, roEntry] = *it;
 g_existingReadOnlyDocs[pMed] = roEntry;
-g_newReadOnlyDocs.erase(pMed);
+it = g_newReadOnlyDocs.erase(it);
 }
 if (g_existingReadOnlyDocs.size() == 0)
 {
@@ -4746,47 +4747,40 @@ void CheckReadOnlyTask::doWork()
 }
 globalLock.unlock();
 
-bool bErase = false;
-for (const auto& [pMed, roEntry] : g_existingReadOnlyDocs)
+auto checkForErase = [](SfxMedium* pMed, const 
std::shared_ptr& roEntry) -> bool
 {
-bErase = false;
-comphelper::ScopeGuard g([&bErase, pMed = pMed]() {
-if (bErase)
-g_existingReadOnlyDocs.erase(pMed);
-});
-
 if (pMed == nullptr || roEntry == nullptr || roEntry->_pMutex == 
nullptr
 || roEntry->_pIsDestructed == nullptr)
-{
-bErase = true;
-continue;
-}
+return true;
 
 std::unique_lock 
medLock(*(roEntry->_pMutex));
 if (*(roEntry->_pIsDestructed) || pMed->GetWorkerReloadEvent() != 
nullptr)
-{
-bErase = true;
-}
-else
-{
-osl::File aFile(
-
pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset));
-if (aFile.open(osl_File_OpenFlag_Write) != 
osl::FileBase::E_None)
-continue;
+return true;
 
-if (!pMed->CheckCanGetLockfile())
-continue;
+osl::File aFile(
+
pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset));
+if (aFile.open(osl_File_OpenFlag_Write) != osl::FileBase::E_None)
+return false;
 
-bErase = true;
+if (!pMed->CheckCanGetLockfile())
+return false;
 
-if (aFile.close() != osl::FileBase::E_None)
-continue;
+if (aFile.close() != osl::FileBase::E_None)
+return true;
 
-// we can load, ask user
-ImplSVEvent* pEvent = Application::PostUserEvent(
-LINK(nullptr, SfxMedium, ShowReloadEditableDialog), pMed);
-pMed->SetWorkerReloadEvent(pEvent);
-}
+// we can load, ask user
+ImplSVEvent* pEvent = Application::PostUserEvent(
+LINK(nullptr, SfxMedium, ShowReloadEditableDialog), pMed);
+pMed->SetWorkerReloadEvent(pEvent);
+return true;
+};
+
+for (auto it = g_existingReadOnlyDocs.begin(); it != 
g_existingReadOnlyDocs.end(); )
+{
+if (checkForErase(it->first, it->second))
+it = g_existingReadOnlyDocs.erase(it);
+else
+++it;
 }
 }
 }


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

2021-10-21 Thread Julien Nabet (via logerrit)
 filter/source/svg/svgexport.cxx |8 
 filter/source/svg/svgfilter.cxx |4 ++--
 filter/source/svg/svgwriter.cxx |   20 ++--
 filter/source/svg/svgwriter.hxx |4 ++--
 4 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 116340b2bab8365c08bec532e1a7126b5312e159
Author: Julien Nabet 
AuthorDate: Thu Oct 21 17:44:20 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 22 08:29:55 2021 +0200

Use size_t instead of sal_uLong in filter/source/svg

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

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 0e0ba464e762..8eb8e8ccfe42 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2404,8 +2404,8 @@ bool SVGFilter::implCreateObjectsFromShape( const 
Reference< css::drawing::XDraw
 MetaAction*   pAction;
 bool bIsTextShapeStarted = false;
 const GDIMetaFile& rMtf = 
aGraphic.GetGDIMetaFile();
-sal_uLong nCount = rMtf.GetActionSize();
-for( sal_uLong nCurAction = 0; nCurAction 
< nCount; ++nCurAction )
+size_t nCount = rMtf.GetActionSize();
+for( size_t nCurAction = 0; nCurAction < 
nCount; ++nCurAction )
 {
 pAction = rMtf.GetAction( nCurAction );
 const MetaActionType nType = 
pAction->GetType();
@@ -2510,8 +2510,8 @@ void SVGFilter::implCreateObjectsFromBackground( const 
Reference< css::drawing::
 GDIMetaFile aTiledMtf;
 bool bBitmapFound = false;
 MetaAction* pAction;
-sal_uLong nCount = aMtf.GetActionSize();
-for( sal_uLong nCurAction = 0; nCurAction < nCount; ++nCurAction )
+size_t nCount = aMtf.GetActionSize();
+for( size_t nCurAction = 0; nCurAction < nCount; ++nCurAction )
 {
 pAction = aMtf.GetAction( nCurAction );
 const MetaActionType nType = pAction->GetType();
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 830767a33458..e2a3279f86c1 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -660,7 +660,7 @@ private:
 return;
 }
 
-const sal_uLong nStreamLen(aStream->remainingSize());
+const sal_uInt64 nStreamLen(aStream->remainingSize());
 
 if(aStream->GetError())
 {
@@ -669,7 +669,7 @@ private:
 
 mnFirstRead = aStream->ReadBytes(
 &mnFirstBytes[0],
-std::min(nStreamLen, sal_uLong(mnFirstBytesSize)));
+std::min(nStreamLen, static_cast(mnFirstBytesSize)));
 
 if(aStream->GetError())
 {
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index a386ad935fb4..43386384cfcb 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -586,18 +586,18 @@ bool SVGTextWriter::implGetTextPositionFromBitmap( const 
MetaAction* pAction, Po
  * 0 if no text found and end of text shape is reached
  * 1 if text found!
  */
-sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& rMtf, sal_uLong& 
nCurAction,
+sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& rMtf, size_t& 
nCurAction,
  sal_uInt32 nWriteFlags)
 {
 Point aPos;
-sal_uLong nCount = rMtf.GetActionSize();
+size_t nCount = rMtf.GetActionSize();
 bool bEOL = false;
 bool bEOP = false;
 bool bETS = false;
 bool bConfigured = false;
 bool bEmpty = true;
 
-sal_uLong nActionIndex = nCurAction + 1;
+size_t nActionIndex = nCurAction + 1;
 for( ; nActionIndex < nCount; ++nActionIndex )
 {
 const MetaAction*pAction = rMtf.GetAction( nActionIndex );
@@ -628,7 +628,7 @@ sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& 
rMtf, sal_uLong& nCu
 const MetaFloatTransparentAction* pA
 = static_cast(pAction);
 GDIMetaFile aTmpMtf(pA->GetGDIMetaFile());
-sal_uLong nTmpAction = 0;
+size_t nTmpAction = 0;
 if (setTextPosition(aTmpMtf, nTmpAction, nWriteFlags) == 1)
 {
 // Text is found in the inner metafile.
@@ -726,12 +726,12 @@ sal_Int32 SVGTextWriter::setTextPosition(const 
GDIMetaFile& rMtf, sal_uLong& nCu
 }
 
 
-void SVGTextWriter::setTextProperties( const GDIMetaFile& rMtf, sal_uLong 
nCurAction )
+void SVGTextWriter::setTextProperties( const GDIMetaFile& rMtf, size_t 
nCurAction )
 {
-sal_uLong nCount = rMtf.GetActionSize();
+size_t nCount = rMtf.GetActionSize

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-10-21 Thread Kevin Suo (via logerrit)
 sc/qa/unit/data/xlsx/tdf130104_indent.xlsx |binary
 sc/qa/unit/subsequent_export-test2.cxx |   91 +
 sc/source/filter/excel/xeextlst.cxx|2 
 sc/source/filter/excel/xestyle.cxx |   15 ++--
 sc/source/filter/excel/xlroot.cxx  |9 ++
 sc/source/filter/inc/xestyle.hxx   |2 
 sc/source/filter/inc/xlroot.hxx|9 +-
 sc/source/filter/oox/stylesbuffer.cxx  |4 -
 8 files changed, 119 insertions(+), 13 deletions(-)

New commits:
commit 7982723a2943d8dcfc533a507880ab5991a04908
Author: Kevin Suo 
AuthorDate: Mon Oct 4 23:11:30 2021 +0800
Commit: Mike Kaganski 
CommitDate: Fri Oct 22 08:29:21 2021 +0200

tdf#130104 - FILESAVE XLSX: cell indent increased on each save

In OOXML, 1 indent = 3 space char width.

-
The Old Method:
-

XLSX Import:

As per the line:
sal_Int32 nIndent = getUnitConverter().scaleToMm100( 3.0 * 
maModel.mnIndent, Unit::Space );
assume the width of space char is 88, then:
If the OOXML indent is 1, then nIndent would be 264.5, and casted to 264.
If the OOXML indent is 2, then nIndent would be 528.5, and casted to 528.
If the OOXML indent is 3, then nIndent would be 792.5, and casted to 792.
...

Also, as Mike Kaganski has pointed out, we use twips in sc indent 
internally, thus it is wrong to convert to Mm100 unit here.

XLSX Export:

As per the line:
nTmpIndent = (nTmpIndent + 100) / 200;
Assume we did not edit the document upon open, and simply save it. Now:
If our indent is 264, then the calculated OOXML indent would be 1.82, and 
then casted to 1, while the expected value is 1.
If our indent is 528, then the calculated OOXML indent would be 3.14, and 
then casted to 3, while the expected value is 2.
If our indent is 792, then the calculated OOXML indent would be 4.46, and 
then casted to 4, while the expected value is 3.
...

Then if you reopen the saved xlsx file with Calc, the increament of indent 
continues on each save which causes serious
format loss.

Most importantly, if you change the indent of cells using the Calc toolbar 
indent icon, one-click would be 10pt = 200 twips,
see defined macro SC_INDENT_STEP. This causes a mess when you change the 
indent in an xlsx document.

-
The New Method
-

In this patch, I have changed the XLSX import to convert the excel indent 
unit to 3-spaces-width *in twips*.
Then, per code advice from Mike Kaganski, as a mirror operation, I have 
changed the XLSX export logic to detect the width
of the space char (which *should* be the same as the one detected at the 
time of xlsx import), and use this width to convert
the indent in twips unit to excel unit. This way, the indent will remain 
the same on xlsx export.

-
TODO:
-

1. On xlsx import of the file tdf130104_indent.xlsx, the default font (i.e. 
font for the "Normal" style) is "Times New Roman".
However, when the UI locale is set to Simplified Chinese and "Asian" option 
is enabled in Tools->Options->Language Settigns->
Languages->"Default Languages for Documents", upon resave as xlsx, the 
default font for the document is changed to "Noto Sans CJK SC"
on my system, which causes the space-width detected to be different from 
the width detected on xlsx import. This seems to be another
bug, see tdf#131349. (Luckily the unit test in this patch passes, this is 
because the change of space width resulted from the change
in default font is very small thus the conversion is not impacted.)

2. The UI part need to be improved, so that after xlsx import, if the user 
hit the "Increase Indent" or "Decrease Indent" toolar
icon to change the indent, Calc should be able to detect that we are 
operating in an xlsx file, thus the "increment" should
be 3 * width of space char, rather than the current SC_INDENT_STEP. Also, 
the if the user changes the default font of the xlsx
document, the Calc should recalculate the indent for each cell to reflect 
the possible change in width of space char.

Change-Id: I5f7a4ecbcd93079d1c19db3b0b641dda949f6fbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123111
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 6b93ee72df1aa42d1a3482ffc396bd0c23134f8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123872
Tested-by: Jenkins

diff --git a/sc/qa/unit/data/xlsx/tdf130104_indent.xlsx 
b/sc/qa/unit/data/xlsx/tdf130104_indent.xlsx
new file mode 100644
index ..9cb1e78e4587
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf130104_indent.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index cc266e5a2bc0..361ab683a7f3 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit

[Libreoffice-commits] core.git: emfio/Library_emfio.mk

2021-10-21 Thread Hossein (via logerrit)
 emfio/Library_emfio.mk |1 -
 1 file changed, 1 deletion(-)

New commits:
commit df93cc61ebf2251b2d41d72a50d72edc2a9e1cb3
Author: Hossein 
AuthorDate: Thu Oct 21 12:50:03 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 22 08:14:14 2021 +0200

Remove sax dependency from emfio

Module 'sax' was one of the dependencies of 'emfio'. This is also
mentioned in:

   https://wiki.documentfoundation.org/Development/Build_System

Previously, module 'emfio' was directly depending on 'drawinglayer'
and 'sax'. But the build is fine when 'sax' is removed from
'emfio/Library_emfio.mk'. Also there is no mention of sax when
invoking 'git grep sax' inside emfio folder.

With this patch, the 'emfio' dependency on 'sax' is removed.

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

diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk
index 281f077130f1..cd877c52fa5b 100644
--- a/emfio/Library_emfio.mk
+++ b/emfio/Library_emfio.mk
@@ -48,7 +48,6 @@ $(eval $(call gb_Library_use_libraries,emfio,\
 comphelper \
 tl \
 salhelper \
-sax \
 vcl \
 svt \
 utl \


[Libreoffice-commits] core.git: vcl/README.GDIMetaFile vcl/README.lifecycle vcl/README.md vcl/README.scheduler vcl/README.vars

2021-10-21 Thread Hossein (via logerrit)
 vcl/README.GDIMetaFile |  242 +-
 vcl/README.lifecycle   |  440 ++---
 vcl/README.md  |8 
 vcl/README.scheduler   |  154 -
 vcl/README.vars|  130 +++---
 5 files changed, 510 insertions(+), 464 deletions(-)

New commits:
commit dc984e7fed26ed26a2cafecb0c5b27feca56bfe2
Author: Hossein 
AuthorDate: Wed Oct 20 10:55:25 2021 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Fri Oct 22 08:09:26 2021 +0200

Converted VCL documentation to Markdown

Converted VCL documentation to Markdown format:

* README.md   Main README file (Added link to other md files)
* README.vars Environment Variables in VCL
* README.GDIMetaFile  GDIMetaFile class
* README.lifecycleUnderstanding Transitional VCL Lifecycle
* README.schedulerVCL Scheduler

Change-Id: I15d973b14005a4944f7b5104c5c80184e1083203
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123867
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/vcl/README.GDIMetaFile b/vcl/README.GDIMetaFile
index 98be38d086d8..386a91e2adff 100644
--- a/vcl/README.GDIMetaFile
+++ b/vcl/README.GDIMetaFile
@@ -1,180 +1,171 @@
-GDIMetaFile class
-=
+# GDIMetaFile class
 
-The GDIMetaFile class reads, writes, manipulates and replays metafiles via the 
VCL module.
+The `GDIMetaFile` class reads, writes, manipulates and replays metafiles via 
the
+`VCL` module.
 
-A typical use case is to initialize a new GDIMetaFile, open the actual stored 
metafile and
-read it in via GDIMetaFile::Read( aIStream ). This reads in the metafile into 
the GDIMetafile
-object - it can read in an old-style VCLMTF metafile (back in the days that 
Microsoft didn't
-document the metafile format this was used), as well as EMF+ files - and adds 
them to a list
-(vector) of MetaActions. You can also populate your own GDIMetaFile via 
AddAction(),
-RemoveAction(), ReplaceAction(), etc.
+A typical use case is to initialize a new `GDIMetaFile`, open the actual stored
+metafile and read it in via `GDIMetaFile::Read( aIStream )`. This reads in the
+metafile into the `GDIMetafile` object - it can read in an old-style `VCLMTF`
+metafile (back in the days that Microsoft didn't document the metafile format
+this was used), as well as EMF+ files - and adds them to a list (vector) of
+`MetaActions`. You can also populate your own `GDIMetaFile` via `AddAction()`,
+`RemoveAction()`, `ReplaceAction()`, etc.
 
-Once the GDIMetafile object is read to be used, you can "play" the metafile, 
pause it, wind
-forward or rewind the metafile. The metafile can be moved, scaled, rotated and 
clipped, as
-well have the colours adjusted or replaced, or even made monochrome.
+Once the `GDIMetafile` object is read to be used, you can "play" the metafile,
+"pause" it, "wind forward" or "rewind" the metafile. The metafile can be moved,
+scaled, rotated and clipped, as well have the colours adjusted or replaced, or
+even made monochrome.
 
-The GDIMetafile can be used to get an OutputDevice's metafile via the Linker() 
and Record()
-functions.
+The GDIMetafile can be used to get an `OutputDevice`'s metafile via the
+`Linker()` and `Record()` functions.
 
+## Using GDIMetafile
 
-Using GDIMetafile
--
+First, create a new `GDIMetafile`, this can be done via the default 
constructor.
+It can then be constructed manually, or you can use `Record()` on an
+`OutputDevice` to populate the `GDIMetaFile`, or of course you can read it from
+file with `Read()`. From here you can then elect to manipulate the metafile, or
+play it back to another `GDIMetafile` or to an `OutputDevice` via `Play()`. To
+store the file, use `Write()`.
 
-First, create a new GDIMetafile, this can be done via the default constructor. 
It can then
-be constructed manually, or you can use Record() on an OutputDevice to 
populate the
-GDIMetaFile, or of course you can read it from file with Read(). From here you 
can then
-elect to manipulate the metafile, or play it back to another GDIMetafile or to 
an
-OutputDevice via Play(). To store the file, use Write().
+### CONSTRUCTORS AND DESTRUCTORS
 
-CONSTRUCTORS AND DESTRUCTORS
+- `GDIMetaFile`
+- `GDIMetaFile( cosnt GDIMetaFile& rMtf )` - copy constructor
+- `~GDIMetaFile`
 
-- GDIMetaFile
-- GDIMetaFile( cosnt GDIMetaFile& rMtf ) - copy constructor
-- ~GDIMetaFile
+### OPERATORS
 
+- `operator =`
+- `operator ==`
+- `operator !=`
 
-OPERATORS
+### RECORDING AND PLAYBACK FUNCTIONS
 
-- operator =
-- operator ==
-- operator !=
-
-
-RECORDING AND PLAYBACK FUNCTIONS
-
-- Play(GDIMetaFile&, size_t)   - play back metafile into another 
metafile up
- to position
-- Play(OutputDevice*, size_t)  - play back metafile into 
OutputDevice up to
- position
-- Play(OutputDevice*, Point, Size, size_t) -

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

2021-10-21 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   29 
 sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |  168 +
 2 files changed, 123 insertions(+), 74 deletions(-)

New commits:
commit 58a3e2a6fad68d8d5e6091e063c0b26e3608f998
Author: Jim Raykowski 
AuthorDate: Tue Oct 19 02:10:41 2021 -0800
Commit: Jim Raykowski 
CommitDate: Fri Oct 22 04:19:10 2021 +0200

tdf#144999 SwNavigator: Add way to collapse all categories

This patch adds a context menu item that can be used to collapse the
content tree to the root categories all at once.

Change-Id: I15274e6db838e9e8503a79384bed4ffcf983041c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123811
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index a7aea176df5d..56ce7d9b5e87 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1529,6 +1529,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
 return false;
 
+grab_focus();
+
 if (std::unique_ptr xEntry(m_xTreeView->make_iterator());
 rCEvt.IsMouseEvent() &&  m_xTreeView->get_dest_row_at_pos(
 rCEvt.GetMousePosPixel(), xEntry.get(), false))
@@ -1849,6 +1851,22 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 if (bRemoveSectionTracking)
 xPop->remove("sectiontracking");
 
+bool bSetSensitiveCollapseAllCategories = false;
+if (!m_bIsRoot)
+{
+bool bEntry = m_xTreeView->get_iter_first(*xEntry);
+while (bEntry)
+{
+if (m_xTreeView->get_row_expanded(*xEntry))
+{
+bSetSensitiveCollapseAllCategories = true;
+break;
+}
+bEntry = m_xTreeView->iter_next_sibling(*xEntry);
+}
+}
+xPop->set_sensitive("collapseallcategories", 
bSetSensitiveCollapseAllCategories);
+
 OString sCommand = xPop->popup_at_rect(m_xTreeView.get(), 
tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1)));
 if (!sCommand.isEmpty())
 ExecuteContextMenuAction(sCommand);
@@ -4216,6 +4234,17 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const 
weld::TreeIter&, rEntry, OUStrin
 
 void SwContentTree::ExecuteContextMenuAction(const OString& 
rSelectedPopupEntry)
 {
+if (rSelectedPopupEntry == "collapseallcategories")
+{
+std::unique_ptr xEntry = m_xTreeView->make_iterator();
+bool bEntry = m_xTreeView->get_iter_first(*xEntry);
+while (bEntry)
+{
+m_xTreeView->collapse_row(*xEntry);
+bEntry = m_xTreeView->iter_next_sibling(*xEntry);
+}
+return;
+}
 if (rSelectedPopupEntry == "tabletracking")
 {
 m_bTableTracking = !m_bTableTracking;
diff --git a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui 
b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
index db918b084bb0..49b6b03d3c48 100644
--- a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
+++ b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
@@ -1,197 +1,197 @@
 
-
+
 
   
   
 True
-False
+False
 
   
 True
-False
-True
+False
+True
 
   
 
 
   
 True
-False
+False
   
 
 
   
 True
-False
+False
 Send Outline 
to Clipboard
-True
+True
   
 
 
   
 True
-False
+False
 Go to
-True
+True
 
   
 
 
   
 True
-False
+False
   
 
 
   
 True
-False
+False
 Select
-True
+True
   
 
 
   
 True
-False
+False
 Delete
-True
+True
 
   
 
 
   
 True
-False
+False
 Promote Chapter
-True
+True
 
   
 
 
   
 True
-False
+False
 Demote Chapter
-True
+True
 
   
 
 
   
 True
-False
+False
 Promote Level
-True
+True
 
   
 
 
   
 True
-False
+False
 Demote Level
-True
+True
 
   
 
 
   
 True
-False
+False
 _Remove Index
-True
+True
   
 
 
   
 True
-False
+False
 _Update
-True
+True
   
 
 
   
 True
-False
+False
 Edit...
-True
+True
   
 
 
   
 True
-False
+False
 _Unprotect
-True

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

2021-10-21 Thread Eike Rathke (via logerrit)
 xmloff/source/style/chrlohdl.cxx |   58 +--
 1 file changed, 56 insertions(+), 2 deletions(-)

New commits:
commit cb56ec6aa8f03fbc70c808bd4f519ce9d3c21f7d
Author: Eike Rathke 
AuthorDate: Fri Oct 22 01:56:46 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Oct 22 04:02:12 2021 +0200

Resolves: tdf#92015 Handle malused *:rfc-language-tag ODF violation

... and don't let it overwrite existing fo:* tags with less
information.

Change-Id: I63c223f6bccd682e4173449ddc76c36e8fac6c35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124042
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx
index 4b6b1aebbf1d..05dd6d770e5a 100644
--- a/xmloff/source/style/chrlohdl.cxx
+++ b/xmloff/source/style/chrlohdl.cxx
@@ -339,8 +339,62 @@ bool XMLCharRfcLanguageTagHdl::importXML( const OUString& 
rStrImpValue, uno::Any
 
 if( !IsXMLToken( rStrImpValue, XML_NONE ) )
 {
-aLocale.Variant = rStrImpValue;
-aLocale.Language = I18NLANGTAG_QLT;
+// Stored may be a *:rfc-language-tag in violation of ODF v1.3
+// 19.516 style:rfc-language-tag "It shall only be used if its value
+// cannot be expressed as a valid combination of the fo:language
+// 19.871, fo:script 19.242 and fo:country 19.234 attributes".
+// That could override a more detailed fo:* and we also don't want an
+// unjustified I18NLANGTAG_QLT extended locale tag, but fetch the
+// values in case fo:* doesn't follow.
+// Rule out the obvious.
+if (rStrImpValue.getLength() < 7)
+{
+SAL_WARN("xmloff.style","rfc-language-tag too short: {" << 
rStrImpValue << "} Set: "
+<< aLocale.Language <<","<< aLocale.Country <<","<< 
aLocale.Variant);
+// Ignore empty and keep Ssss or any earlier qlt already set.
+if (!rStrImpValue.isEmpty() && aLocale.Language != I18NLANGTAG_QLT)
+{
+// Shorter than ll-Ssss, so try ll-CC or lll-CC or ll or lll
+sal_Int32 h = rStrImpValue.indexOf('-');
+OUString aLang;
+if (2 <= h && h <= 3)
+aLang = rStrImpValue.copy(0, h);
+else if (h < 0 && 2 <= rStrImpValue.getLength() && 
rStrImpValue.getLength() <= 3)
+aLang = rStrImpValue;
+OUString aCoun;
+if (!aLang.isEmpty() && aLang.getLength() + 3 == 
rStrImpValue.getLength())
+aCoun = rStrImpValue.copy( aLang.getLength() + 1);
+// Ignore identical value or less information.
+if ((!aLang.isEmpty() && aLang != aLocale.Language) ||
+(!aCoun.isEmpty() && aCoun != aLocale.Country))
+{
+// Do not override existing values.
+if (aLocale.Language.isEmpty())
+aLocale.Language = aLang;
+if (aLocale.Country.isEmpty())
+aLocale.Country = aCoun;
+if (aLang != aLocale.Language || aCoun != aLocale.Country)
+{
+// No match, so we still need the qlt anyway. 
Whatever..
+aLocale.Variant = rStrImpValue;
+aLocale.Language = I18NLANGTAG_QLT;
+}
+}
+else if (aLang.isEmpty() && aCoun.isEmpty())
+{
+// Both empty, some other tag.
+aLocale.Variant = rStrImpValue;
+aLocale.Language = I18NLANGTAG_QLT;
+}
+}
+SAL_WARN("xmloff.style","rfc-language-tag too short: now set: "
+<< aLocale.Language <<","<< aLocale.Country <<","<< 
aLocale.Variant);
+}
+else
+{
+aLocale.Variant = rStrImpValue;
+aLocale.Language = I18NLANGTAG_QLT;
+}
 }
 
 rValue <<= aLocale;


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

2021-10-21 Thread Regina Henschel (via logerrit)
 svx/qa/unit/customshapes.cxx  |   43 ++
 svx/qa/unit/data/tdf145245_ExtrusionPosition.odp  |binary
 svx/source/customshapes/EnhancedCustomShape3d.cxx |4 +-
 3 files changed, 45 insertions(+), 2 deletions(-)

New commits:
commit 5ab21caf603ba0a1c95bbc94a29eebe3483d1599
Author: Regina Henschel 
AuthorDate: Thu Oct 21 16:09:44 2021 +0200
Commit: Regina Henschel 
CommitDate: Thu Oct 21 23:36:16 2021 +0200

tdf#145245 correct relative position of extrusion

ODF specifies for draw:extrusion-depth, 'The draw:extrusion-depth
attribute specifies the depth of an extrusion. It takes two white space
separated values. The first value specifies the depth of the extrusion
in units, the second value specifies the fraction of the extrusion that
lies before a shape. The second value shall be in the range [0,1].'

The default for the second value is 0. Because LibreOffice has no UI to
change the value, the error becomes only visible, if you create own
custom shapes.

On import the ODF values are put in CustomShapeGeometry>Extrusion>
Depth. Method GetExtrusionDepth() calculates from that the length
values rBackwardDepth and rForwardDepth so that its sum is the depth.

CreateCustomShapeProperties() in escherex.cxx#2699 and
ApplyCustomShapeGeometryAttributes() in msdffimp.cxx#1684 use them in
the same sence.

But methods Create3DObject() and CalculateNewSnapRect() in
EnhancedCustomShape3d.cxx have used these values as if they were
coordinates.

I have keept the calculation in GetExtrusionDepth(), because it
reflects the meaning in ODF. I have corrected the signs in
Create3DObject() and CalculateNewSnapRect().

Change-Id: If275bb263b6f3d790f5893a69f38f8433acfbe7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123997
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index d4e7ff045fe1..92fbfc9fa62e 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -127,6 +127,49 @@ void lcl_AssertRectEqualWithTolerance(std::string_view 
sInfo, const tools::Recta
std::abs(rExpected.GetHeight() - 
rActual.GetHeight()) <= nTolerance);
 }
 
+CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145245_ExtrusionPosition)
+{
+// The second parameter of the extrusion-depth property specifies how much 
of the extrusion
+// lies before the shape. The file contains three shapes which have the 
values 0, 0.5 and 1.
+// They are rotated around the x-axis so that the extrusion becomes 
visible. The extrusion
+// depth itself is 5cm. Y-coordinate of shape is 6cm.
+
+// Load document
+OUString aURL = m_directories.getURLFromSrc(sDataDirectory) + 
"tdf145245_ExtrusionPosition.odp";
+mxComponent = loadFromDesktop(aURL, 
"com.sun.star.comp.presentation.PresentationDocument");
+
+// The tolerance 40 is estimated and can be adjusted if required for HiDPI.
+{
+// First shape has extrusion behind the shape.
+uno::Reference xShape0(getShape(0));
+SdrObjCustomShape& rSdrCustomShape(
+
static_cast(*SdrObject::getSdrObjectFromXShape(xShape0)));
+tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
+tools::Rectangle aExpected(Point(1000, 1000), Size(6002, 5001));
+lcl_AssertRectEqualWithTolerance("Pos 0.0 extrusion", aExpected, 
aBoundRect, 40);
+}
+{
+// Second shape has half of extrusion behind the shape.
+uno::Reference xShape(getShape(1));
+SdrObjCustomShape& rSdrCustomShape(
+
static_cast(*SdrObject::getSdrObjectFromXShape(xShape)));
+// Without the fix the height was 1 instead of 5001.
+tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
+tools::Rectangle aExpected(Point(9000, 3500), Size(6002, 5001));
+lcl_AssertRectEqualWithTolerance("Pos 0.5 extrusion", aExpected, 
aBoundRect, 40);
+}
+{
+// Third shape has extrusion before the shape.
+uno::Reference xShape(getShape(2));
+SdrObjCustomShape& rSdrCustomShape(
+
static_cast(*SdrObject::getSdrObjectFromXShape(xShape)));
+// Without the fix the y-coordinate was 1000 instead of 6000.
+tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
+tools::Rectangle aExpected(Point(18000, 6000), Size(6002, 5001));
+lcl_AssertRectEqualWithTolerance("Pos 1.0 extrusion", aExpected, 
aBoundRect, 40);
+}
+}
+
 CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145111_Fontwork_rendering_font_size)
 {
 // The tested position and height depend on dpi.
diff --git a/svx/qa/unit/data/tdf145245_ExtrusionPosition.odp 
b/svx/qa/unit/data/tdf145245_ExtrusionPosition.odp
new file mode 100644
index ..a356cf9ed396
Binary files /dev/null and 

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

2021-10-21 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/wrtsh/wrtsh1.cxx |  134 +++---
 1 file changed, 124 insertions(+), 10 deletions(-)

New commits:
commit 827c0f9766f148520aed7fe3abe2b138a157a6d3
Author: Jim Raykowski 
AuthorDate: Sun Oct 17 21:10:06 2021 -0800
Commit: Jim Raykowski 
CommitDate: Thu Oct 21 23:35:51 2021 +0200

tdf#141634 Special end of para split for folded outline node

After split place the cursor on a new blank line after the folded
content and at the same level as the split outline node.

Change-Id: I4073a1c0047ab8479993d8e605cc038896cd4630
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123747
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 215cdf2980a5..e74ac03bdec0 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -105,6 +105,10 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 using namespace sw::mark;
 using namespace com::sun::star;
 namespace {
@@ -994,15 +998,121 @@ void SwWrtShell::InsertFootnote(const OUString &rStr, 
bool bEndNote, bool bEdit
 m_aNavigationMgr.addEntry(aPos);
 }
 
+// tdf#141634
+static bool lcl_FoldedOutlineNodeEndOfParaSplit(SwWrtShell *pThis)
+{
+SwTextNode* pTextNode = pThis->GetCursor()->GetNode().GetTextNode();
+if (pTextNode && pTextNode->IsOutline())
+{
+bool bVisible = true;
+pTextNode->GetAttrOutlineContentVisible(bVisible);
+if (!bVisible)
+{
+const SwNodes& rNodes = pThis->GetNodes();
+const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
+SwOutlineNodes::size_type nPos;
+(void) rOutlineNodes.Seek_Entry(pTextNode, &nPos);
+
+SwNode* pSttNd = rOutlineNodes[nPos];
+
+// determine end node of folded outline content
+SwNode* pEndNd = &rNodes.GetEndOfContent();
+if (rOutlineNodes.size() > nPos + 1)
+pEndNd = rOutlineNodes[nPos + 1];
+
+if (pThis->GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
+{
+// get the next outline node after the folded outline content 
(iPos)
+// it is the next outline node with the same level or less
+int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
+SwOutlineNodes::size_type iPos = nPos;
+while (++iPos < rOutlineNodes.size() &&
+   
rOutlineNodes[iPos]->GetTextNode()->GetAttrOutlineLevel() > nLevel);
+
+// get the correct end node
+// the outline node may be in frames, headers, footers special 
section of doc model
+SwNode* pStartOfSectionNodeSttNd = 
pSttNd->StartOfSectionNode();
+while (pStartOfSectionNodeSttNd->StartOfSectionNode()
+   != 
pStartOfSectionNodeSttNd->StartOfSectionNode()->StartOfSectionNode())
+{
+pStartOfSectionNodeSttNd = 
pStartOfSectionNodeSttNd->StartOfSectionNode();
+}
+pEndNd = pStartOfSectionNodeSttNd->EndOfSectionNode();
+
+if (iPos < rOutlineNodes.size())
+{
+SwNode* pStartOfSectionNode = 
rOutlineNodes[iPos]->StartOfSectionNode();
+while (pStartOfSectionNode->StartOfSectionNode()
+   != 
pStartOfSectionNode->StartOfSectionNode()->StartOfSectionNode())
+{
+pStartOfSectionNode = 
pStartOfSectionNode->StartOfSectionNode();
+}
+if (pStartOfSectionNodeSttNd == pStartOfSectionNode)
+pEndNd = rOutlineNodes[iPos];
+}
+}
+
+// table, text box, header, footer
+if (pSttNd->GetTableBox() || pSttNd->GetIndex() < 
rNodes.GetEndOfExtras().GetIndex())
+{
+// insert before section end node
+if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
+{
+SwNodeIndex aIdx(*pSttNd->EndOfSectionNode());
+while (aIdx.GetNode().IsEndNode())
+--aIdx;
+++aIdx;
+pEndNd = &aIdx.GetNode();
+}
+}
+// if pSttNd isn't in table but pEndNd is then insert after table
+else if (pEndNd->GetTableBox())
+{
+pEndNd = pEndNd->FindTableNode();
+SwNodeIndex aIdx(*pEndNd, -1);
+// account for nested tables
+while (aIdx.GetNode().GetTableBox())
+{
+pEndNd = aIdx.GetNode().FindTableNode();
+aIdx.Assign(*pEndNd, -1);
+}
+aIdx.Assign(*pEndNd->EndOfSectionNode(), +1);
+pEn

[Libreoffice-commits] core.git: emfio/README.md sd/qa

2021-10-21 Thread Andrea Gelmini (via logerrit)
 emfio/README.md  |2 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 0cd8050ec70a4a5f02801cc38e6486defdf83bd7
Author: Andrea Gelmini 
AuthorDate: Thu Oct 21 17:59:22 2021 +0200
Commit: Julien Nabet 
CommitDate: Thu Oct 21 23:00:39 2021 +0200

Fix typos

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

diff --git a/emfio/README.md b/emfio/README.md
index 60e9bc1ca9c7..a556a017147b 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -73,7 +73,7 @@ Due to the difference on the fonts available on various 
platforms, the outcome
 of text rendering can be different on Linux, Windows, macOS and elsewhere.
 
 ## Known Bugs
-Known remaing bugs for this module is gathered here:
+Known remaining bugs for this module is gathered here:
 
 * [Bug 103859 \[META\] EMF/WMF (Enhanced/Windows Metafile) bugs and
 enhancements](https://bugs.documentfoundation.org/show_bug.cgi?id=103859)
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index a41e050bac06..2d354dc39b03 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2849,7 +2849,7 @@ void SdTiledRenderingTest::testShapeEditInMultipleViews()
 CPPUNIT_ASSERT_EQUAL(6501L, aRectangle.GetWidth());
 CPPUNIT_ASSERT_EQUAL(4501L, aRectangle.GetHeight());
 
-// On View2 - Move handle 0 on the shape to a new mosition - resize
+// On View2 - Move handle 0 on the shape to a new position - resize
 Point aNewPosition = aRectangle.TopLeft() + Point(-1250, -1000);
 pView2->MoveShapeHandle(0, aNewPosition, -1);
 Scheduler::ProcessEventsToIdle();
@@ -2922,7 +2922,7 @@ void SdTiledRenderingTest::testShapeEditInMultipleViews()
 CPPUNIT_ASSERT_EQUAL(4501L, aRectangle.GetWidth());
 CPPUNIT_ASSERT_EQUAL(2001L, aRectangle.GetHeight());
 
-// On View2 - Move handle 0 on the shape to a new mosition - resize
+// On View2 - Move handle 0 on the shape to a new position - resize
 Point aNewPosition = aRectangle.TopLeft() + Point(-1250, -1000);
 pView2->MoveShapeHandle(0, aNewPosition, -1);
 Scheduler::ProcessEventsToIdle();


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

2021-10-21 Thread Caolán McNamara (via logerrit)
 vcl/workben/localestub/localedata_en_IL.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 5722e85ca0e0fc24c7e9fcd252113717d69b72d4
Author: Caolán McNamara 
AuthorDate: Thu Oct 21 20:03:02 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 21 21:14:57 2021 +0200

ofz#40166 fix build failure

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

diff --git a/vcl/workben/localestub/localedata_en_IL.cxx 
b/vcl/workben/localestub/localedata_en_IL.cxx
index bea5731a7454..c0323b6768f5 100644
--- a/vcl/workben/localestub/localedata_en_IL.cxx
+++ b/vcl/workben/localestub/localedata_en_IL.cxx
@@ -18,14 +18,14 @@ SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getLCInfo_en_IL(sal_Int16& count)
 count = SAL_N_ELEMENTS(LCInfoArray);
 return (sal_Unicode**)LCInfoArray;
 }
-extern sal_Unicode** SAL_CALL getLocaleItem_he_IL(sal_Int16& count);
+extern sal_Unicode** SAL_CALL getLocaleItem_en_US(sal_Int16& count);
 SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getLocaleItem_en_IL(sal_Int16& 
count)
 {
-return getLocaleItem_he_IL(count);
+return getLocaleItem_en_US(count);
 }
 static const sal_Unicode replaceTo0[]
 = { 0x5b, 0x24, 0x200e, 0x20aa, 0x2d, 0x42, 0x34, 0x30, 0x39, 0x5d, 0x0 };
-extern sal_Unicode const* const* SAL_CALL getAllFormats0_he_IL(sal_Int16& 
count,
+extern sal_Unicode const* const* SAL_CALL getAllFormats0_en_US(sal_Int16& 
count,
const 
sal_Unicode*& from,
const 
sal_Unicode*& to);
 SAL_DLLPUBLIC_EXPORT sal_Unicode const* const* SAL_CALL
@@ -33,12 +33,12 @@ getAllFormats0_en_IL(sal_Int16& count, const sal_Unicode*& 
from, const sal_Unico
 {
 to = replaceTo0;
 const sal_Unicode* tmp;
-return getAllFormats0_he_IL(count, from, tmp);
+return getAllFormats0_en_US(count, from, tmp);
 }
-extern sal_Unicode** SAL_CALL getDateAcceptancePatterns_he_IL(sal_Int16& 
count);
+extern sal_Unicode** SAL_CALL getDateAcceptancePatterns_en_US(sal_Int16& 
count);
 SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getDateAcceptancePatterns_en_IL(sal_Int16& count)
 {
-return getDateAcceptancePatterns_he_IL(count);
+return getDateAcceptancePatterns_en_US(count);
 }
 static const sal_Unicode replaceTo1[] = { 0x0 };
 extern sal_Unicode const* const* SAL_CALL getAllFormats1_en_US(sal_Int16& 
count,
@@ -86,10 +86,10 @@ SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getAllCalendars_en_IL(sal_Int16& cou
 {
 return getAllCalendars_en_US(count);
 }
-extern sal_Unicode** SAL_CALL getAllCurrencies_he_IL(sal_Int16& count);
+extern sal_Unicode** SAL_CALL getAllCurrencies_en_US(sal_Int16& count);
 SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getAllCurrencies_en_IL(sal_Int16& 
count)
 {
-return getAllCurrencies_he_IL(count);
+return getAllCurrencies_en_US(count);
 }
 extern sal_Unicode** SAL_CALL getTransliterations_en_US(sal_Int16& count);
 SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getTransliterations_en_IL(sal_Int16& count)


[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d99428453409b48e089800e4dafdff9cb65ccce2
Author: Rafael Lima 
AuthorDate: Thu Oct 21 20:05:09 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 20:05:09 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 08d7c8f595a3d4b4736e2bc993867cbcb4fa71d2
  - tdf#144463 Fix Slide Show help pages

Change-Id: I464f7c4c09bb04f484c94ff29ec1ad63c201eb3a
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123515
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 2aae6a437951..08d7c8f595a3 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 2aae6a437951d1029eaeb13fdeaa70ce48ef5e72
+Subproject commit 08d7c8f595a3d4b4736e2bc993867cbcb4fa71d2


[Libreoffice-commits] help.git: source/text

2021-10-21 Thread Rafael Lima (via logerrit)
 source/text/simpress/01/0610.xhp |   94 +++
 source/text/simpress/guide/show.xhp  |  141 +--
 2 files changed, 116 insertions(+), 119 deletions(-)

New commits:
commit 08d7c8f595a3d4b4736e2bc993867cbcb4fa71d2
Author: Rafael Lima 
AuthorDate: Wed Oct 13 23:00:32 2021 +0200
Commit: Olivier Hallot 
CommitDate: Thu Oct 21 20:05:08 2021 +0200

tdf#144463 Fix Slide Show help pages

Change-Id: I464f7c4c09bb04f484c94ff29ec1ad63c201eb3a
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123515
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/simpress/01/0610.xhp 
b/source/text/simpress/01/0610.xhp
index bbe3f2689..eda46db91 100644
--- a/source/text/simpress/01/0610.xhp
+++ b/source/text/simpress/01/0610.xhp
@@ -1,6 +1,5 @@
 
 
-
 
 
-
 
-
-Custom Slide Shows
-/text/simpress/01/0610.xhp
-
+  
+Custom Slide Shows
+/text/simpress/01/0610.xhp
+  
 
 
-
-
-
-Custom Slide Shows
-Defines a custom slide 
show using slides within the current presentation. You can then pick slides to 
meet the needs of your audience. You can create as many custom slide shows as 
you want.
-
-
-
-
-
-
-
-Name of the presentation(s)
-Lists the custom 
slide shows that are available.
-To create a 
custom slide show, click New.
-
-Use Custom Slide Show
-Runs the custom slide 
show you selected when you click Start. Otherwise, the entire 
presentation is shown.
-To run a custom slide show:
-
-
-Click the show 
in the list and then select Use Custom Slide Show.
-
-
-Click 
Start.
-
-
-
-New
-
-
-Edit
-Add, remove 
or reorder slides as well as change the name of the selected custom 
slide show.
-
-
-Copy
-Creates a copy of the selected 
custom slide show. You can modify the name of the show by clicking 
Edit.
-
-Start
-Runs the slide show. 
Ensure that Use Custom Slide Show is selected if you want to run a 
custom presentation.
-
+  
+  
+  
+  Custom Slide 
Shows
+  Defines a custom slide 
show using slides within the current presentation. You can then pick slides to 
meet the needs of your audience. You can create as many custom slide shows as 
you want.
+  
+  
+
+  
+  
+  
+  Read the help page Creating a Custom Slide 
Show to learn more about how to set up your own custom slide shows.
+  List of custom slide shows
+  Lists the custom 
slide shows that are available in the document.
+  
+  To create a custom slide 
show, click New.
+  To run a custom slide show:
+  
+
+  Select a custom slide show 
from the list.
+
+
+  Click 
Start.
+
+  
+  
+  New
+  
+  
+  Edit
+  Add, remove 
or reorder slides as well as change the name of the selected custom 
slide show.
+  
+  
+  Copy
+  Creates a copy of the selected 
custom slide show. You can modify the name of the show by clicking 
Edit.
+  
+  Start
+  Runs the selected custom 
slide show.
+  
+  
+  
+
+  
 
 
diff --git a/source/text/simpress/guide/show.xhp 
b/source/text/simpress/guide/show.xhp
index e4b0efafd..7be2daf99 100644
--- a/source/text/simpress/guide/show.xhp
+++ b/source/text/simpress/guide/show.xhp
@@ -1,6 +1,5 @@
 
-
-
+
 
-   
-
+
 
-
-Showing a Slide Show
-/text/simpress/guide/show.xhp
-
-
-Sun Microsystems, Inc.
-
+  
+Showing a Slide Show
+/text/simpress/guide/show.xhp
+  
+  
+Sun Microsystems, Inc.
+  
 
+
 
-running slide shows
-showing;slide shows
-slide shows; starting
-presentations; starting
-starting; slide shows
-automatic slide shows
-slide transitions;automatic
-automatic slide transition
-MW transferred three index entries from 
simpress/01/0313.xhp, deleted "slide shows;showing", made "running;..." a 
one level entry and added "automatic...". MW transferred 2 index entries from 
simpress/01/0604.xhp.
-Showing a Slide Show
-UFI: new file see i68756
-Different ways 
exist to start a slide show. Once a slide show is running, you can take control 
pressing keys or clicking the mouse buttons.
-By default, a 
slide show always starts with the first slide. You advance manually through 
slides up to the last slide. You can change these settings.
-Running 
a Slide Show
-
-
-Choose 
Slide Show - Slide Show to run the show.
-
-
-If you want all 
shows to start from the current slide instead of the first slide, choose 
%PRODUCTNAME - 
PreferencesTools - 
Options - %PRODUCTNAME Impress - 
General and click Always with current page.
-
-
-Click to 
advance to the next effect or to the next slide.
-
-
-Press Esc to abort the show before the end.
-Many more keys 
are available to control a slide 
show. You can also right-click to open a context menu with useful 
commands.
-Showing 
an automatic slide show (kiosk mode)
-For an 
automatic change to the next slide, you must assign a slide transition to each 
slide. 
-
-
-Open the 
Slide Transition sidebar deck.
-
-
-In the 
Advance slide area, click Automatically after, and 
select a time duration.
-
-
-Click 
Apply to All Slides.
-

[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 31a7c16c57234e7b0f2fb2a971e8d5ffa19ac83d
Author: Rafael Lima 
AuthorDate: Thu Oct 21 20:03:32 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 20:03:32 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 2aae6a437951d1029eaeb13fdeaa70ce48ef5e72
  - Fix  tags for better l10n (Part 2)

This is Part 2 of the fixes requested by translators concerning the use 
of the .

Change-Id: I4c846632ded9a7260f86818d7a0eb6257b414b19
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124008
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index c37c5f2131d0..2aae6a437951 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit c37c5f2131d0fe893d7de8995e7deb73262988aa
+Subproject commit 2aae6a437951d1029eaeb13fdeaa70ce48ef5e72


[Libreoffice-commits] help.git: source/text

2021-10-21 Thread Rafael Lima (via logerrit)
 source/text/shared/optionen/01070400.xhp|2 +-
 source/text/shared/optionen/detailedcalculation.xhp |2 +-
 source/text/simpress/01/0517.xhp|2 +-
 source/text/swriter/02/0614.xhp |2 +-
 source/text/swriter/guide/load_styles.xhp   |2 +-
 source/text/swriter/guide/numbering_lines.xhp   |2 +-
 source/text/swriter/guide/using_numbering.xhp   |2 +-
 source/text/swriter/main0215.xhp|9 ++---
 8 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 2aae6a437951d1029eaeb13fdeaa70ce48ef5e72
Author: Rafael Lima 
AuthorDate: Thu Oct 21 16:47:34 2021 +0200
Commit: Olivier Hallot 
CommitDate: Thu Oct 21 20:03:31 2021 +0200

Fix  tags for better l10n (Part 2)

This is Part 2 of the fixes requested by translators concerning the use of 
the .

Change-Id: I4c846632ded9a7260f86818d7a0eb6257b414b19
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124008
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/shared/optionen/01070400.xhp 
b/source/text/shared/optionen/01070400.xhp
index 8fa87a751..d58cd47ef 100644
--- a/source/text/shared/optionen/01070400.xhp
+++ b/source/text/shared/optionen/01070400.xhp
@@ -66,7 +66,7 @@
   Hidden pages
   Specifies whether to print the 
pages that are currently hidden from the presentation.
   Quality
-  See also .
+  See also Printing in Black and White.
   
   Default
   Specifies that you want to print 
in original colors.
diff --git a/source/text/shared/optionen/detailedcalculation.xhp 
b/source/text/shared/optionen/detailedcalculation.xhp
index 3955c4213..68fc24ac8 100644
--- a/source/text/shared/optionen/detailedcalculation.xhp
+++ b/source/text/shared/optionen/detailedcalculation.xhp
@@ -46,7 +46,7 @@
 How to treat text when 
encountered as operand in an arithmetic operation or as argument to a function 
that expects a number instead. Unambiguous conversion is possible for integer 
numbers including exponents and ISO 8601 dates and times in their extended 
formats with separators. Fractional numeric values with decimal separators or 
dates other than ISO 8601 are locale dependent. Note that in locale dependent 
conversions the resulting numeric value may differ between locales!
 Generate #VALUE! 
error: Text found where numeric data is expected will generate #VALUE! 
error. Example: "123.45" will generate a #VALUE! 
error, while 123.45 not.
 Treat as zero: 
Any text found where numeric data is expected will be considered as a number of 
value zero. Example: "123.45" will map to zero, while 
123.45 not.
-Convert only if 
unambiguous: If the text represents a valid and unambiguous numeric 
value, convert it. Example: "123.456" will generate a 
#VALUE! error because the text contains a separator, while "123456" will not.See  for 
details.
+Convert only if 
unambiguous: If the text represents a valid and unambiguous numeric 
value, convert it. Example: "123.456" will generate a 
#VALUE! error because the text contains a separator, while "123456" will not.See Converting 
Text to Numbers for details.
 Convert also locale 
dependent: convert values valid in the locale representation. Example: 
"123,45" is a valid number in some locales because 
the comma is the decimal separator there.
 Treat empty string as zero
 This option determines how 
an empty string is treated when used in arithmetic operations. If you have set 
"Conversion from text to number" to either "Generate #VALUE! error" or "Treat 
as zero", you cannot choose (here) if conversion of an empty string to a number 
will generate an error or if it will treat empty strings as zero. Otherwise 
this option determines how empty strings are treated.
diff --git a/source/text/simpress/01/0517.xhp 
b/source/text/simpress/01/0517.xhp
index 6aea71c01..932d22a3f 100644
--- a/source/text/simpress/01/0517.xhp
+++ b/source/text/simpress/01/0517.xhp
@@ -64,7 +64,7 @@
   Enter the amount of vertical space 
you want at the end of the connector.
   
   Reset line skew
-  Resets the line skew values to the 
default.
+  Resets the line skew values to the default. (This 
command is only accessible through the context 
menu).
 
   
 
diff --git a/source/text/swriter/02/0614.xhp 
b/source/text/swriter/02/0614.xhp
index 1690a357a..f12be81f8 100644
--- a/source/text/swriter/02/0614.xhp
+++ b/source/text/swriter/02/0614.xhp
@@ -53,7 +53,7 @@
   To remove the 
numbering restart, apply the command again in the paragraph where the numbering 
was restarted.
 
 
-  To restart 
numbering with a number greater than 1, right-click in the paragraph where you 
want to restart numbering, choose Paragraph - Paragraph - 
 tab, 
select Restart numbering at this paragraph and enter the 
start number in Start with.
+  To restart 
numbering with a number greater than 1, right-click in th

[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e2ab8341b3bb5fc174b48da6b5a3442b82e5cf13
Author: Rafael Lima 
AuthorDate: Thu Oct 21 20:01:07 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 20:01:07 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to c37c5f2131d0fe893d7de8995e7deb73262988aa
  - Related tdf#143846 Improve Arabic/Roman help pages

Change-Id: I4be244dba35f137c1b7d356aab658c5e08604e51
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123523
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index f025640e2603..c37c5f2131d0 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit f025640e2603ee252a21e935c2790627a2e95224
+Subproject commit c37c5f2131d0fe893d7de8995e7deb73262988aa


[Libreoffice-commits] help.git: AllLangHelp_scalc.mk source/text

2021-10-21 Thread Rafael Lima (via logerrit)
 AllLangHelp_scalc.mk |2 +
 source/text/scalc/01/04060110.xhp|   45 +++---
 source/text/scalc/01/func_arabic.xhp |   42 +++
 source/text/scalc/01/func_roman.xhp  |   46 +++
 4 files changed, 95 insertions(+), 40 deletions(-)

New commits:
commit c37c5f2131d0fe893d7de8995e7deb73262988aa
Author: Rafael Lima 
AuthorDate: Thu Oct 14 16:36:35 2021 +0200
Commit: Olivier Hallot 
CommitDate: Thu Oct 21 20:01:05 2021 +0200

Related tdf#143846 Improve Arabic/Roman help pages

Change-Id: I4be244dba35f137c1b7d356aab658c5e08604e51
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123523
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk
index f2e840a5a..0bc4bd0cd 100644
--- a/AllLangHelp_scalc.mk
+++ b/AllLangHelp_scalc.mk
@@ -188,6 +188,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\
 helpcontent2/source/text/scalc/01/format_graphic \
 helpcontent2/source/text/scalc/01/ful_func \
 helpcontent2/source/text/scalc/01/func_aggregate \
+helpcontent2/source/text/scalc/01/func_arabic \
 helpcontent2/source/text/scalc/01/func_averageif \
 helpcontent2/source/text/scalc/01/func_averageifs \
 helpcontent2/source/text/scalc/01/func_ceiling \
@@ -247,6 +248,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\
 helpcontent2/source/text/scalc/01/func_rawsubtract \
 helpcontent2/source/text/scalc/01/func_regex \
 helpcontent2/source/text/scalc/01/func_replaceb \
+helpcontent2/source/text/scalc/01/func_roman \
 helpcontent2/source/text/scalc/01/func_roundsig \
 helpcontent2/source/text/scalc/01/func_second \
 helpcontent2/source/text/scalc/01/func_skewp \
diff --git a/source/text/scalc/01/04060110.xhp 
b/source/text/scalc/01/04060110.xhp
index 7b33f7139..2fe9ef745 100644
--- a/source/text/scalc/01/04060110.xhp
+++ b/source/text/scalc/01/04060110.xhp
@@ -65,28 +65,13 @@
 
 
 Beware that Calc's 
AutoCorrect function may modify double quotation marks. AutoCorrect should not 
change the double quotation marks within formula cells but may change those 
used in non-formula cells containing text. For example, if you copy a string 
that is surrounded by some other form of typographical double quotation marks, 
such as the left double quotation mark (U+201C) and the right double quotation 
mark (U+201D), and then paste into a formula cell, an error may result. Open 
the Double Quotes area of the Tools - AutoCorrect 
Options - Localized Options dialog to set the characters used to 
automatically correct the start and end typographical double quotation marks. 
Uncheck the Replace toggle button to disable the 
feature.
-  
-
 
-  
-  
-
-
-  ARABIC function
-
-
-
-
-ARABIC
-Calculates the value of a Roman number. The value range 
must be between 0 and 3999.
+
 
-
-ARABIC("Text")
- 
Text is the text that represents a Roman number.
+
 
-
- =ARABIC("MXIV") returns 1014
- =ARABIC("MMII") returns 2002
+
+  
 
 
 
@@ -614,27 +599,7 @@
 
 
 
-
-  ROMAN function
-
-
-
-
-ROMAN
-Converts a number into a Roman numeral. The value range 
must be between 0 and 3999, the modes can be integers from 0 to 
4.
-
-
-ROMAN(Number [; 
Mode])
- 
Number is the number that is to be converted into a Roman 
numeral.
- 
Mode (optional) indicates the degree of simplification. The higher 
the value, the greater is the simplification of the Roman number.
-
-
- =ROMAN(999) returns CMXCIX
- =ROMAN(999;0) returns CMXCIX
- =ROMAN (999;1) returns LMVLIV
- =ROMAN(999;2) returns XMIX
- =ROMAN(999;3) returns VMIV
- =ROMAN(999;4) returns IM
+  
 
 
 
diff --git a/source/text/scalc/01/func_arabic.xhp 
b/source/text/scalc/01/func_arabic.xhp
new file mode 100644
index 0..b827428e8
--- /dev/null
+++ b/source/text/scalc/01/func_arabic.xhp
@@ -0,0 +1,42 @@
+
+
+
+
+
+  
+ARABIC Function
+/text/scalc/01/func_arabic.xhp
+  
+
+
+  
+
+
+  ARABIC function
+  text functions;convert roman numbers
+
+ARABIC
+Returns the numeric value corresponding to 
a Roman number expressed as text.
+  
+  The largest Roman number that can be 
converted is MMMCMXCIX (or one of its simplified versions), which is equivalent 
to 3999.
+  
+  ARABIC(Text)
+  Text: 
text representing a Roman number.
+  
+  =ARABIC("MXIV") returns the numeric 
value 1014.
+  =ARABIC("MMII") returns the numeric 
value 2002.
+  =ARABIC("") returns 0.
+
+  
+
+
+  
+
+
diff --git a/source/text/scalc/01/func_roman.xhp 
b/source/text/scalc/01/func_roman.xhp
new file mode 100644
index 0..4600ab3fc
--- /dev/null
+++ b/source/text/scalc/01/func_roman.xhp
@@ -0,0 +1,46 @@
+
+
+
+
+
+  
+ROMAN Function
+/text/scalc/01/func_roman.xhp
+  
+
+
+  
+
+
+  ROMAN function
+  text functions;convert to roman numbers
+
+ROMAN
+Converts a number into a Roman numeral. The 
value range must be be

[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7a2316a3d5128ceb16cd62634f110ba81d382217
Author: Rafael Lima 
AuthorDate: Thu Oct 21 20:00:23 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 20:00:23 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to f025640e2603ee252a21e935c2790627a2e95224
  - Fix  tags for better l10n (Part 1)

This is Part 1 of the fixes requested by translators concerning the use 
of the .

Change-Id: Iee5ea4289034449c33156d4e20483943eb872ae0
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123782
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 993399c7c55d..f025640e2603 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 993399c7c55d58bf084234713b07ac6ef8442b03
+Subproject commit f025640e2603ee252a21e935c2790627a2e95224


[Libreoffice-commits] help.git: source/text

2021-10-21 Thread Rafael Lima (via logerrit)
 source/text/sbasic/shared/03/lib_ScriptForge.xhp  |   53 +-
 source/text/sbasic/shared/03/sf_intro.xhp |2 
 source/text/sbasic/shared/03/sf_session.xhp   |   36 +++---
 source/text/sbasic/shared/03030303.xhp|2 
 source/text/sbasic/shared/03120102.xhp|   65 ++--
 source/text/scalc/01/func_numbervalue.xhp |   51 -
 source/text/scalc/guide/numbers_text.xhp  |   30 ++---
 source/text/scalc/guide/remove_duplicates.xhp |3 
 source/text/scalc/guide/table_cellmerge.xhp   |   70 ++---
 source/text/scalc/main0200.xhp|  100 +--
 source/text/shared/01/05030500.xhp|   48 -
 source/text/shared/01/05070200.xhp|   42 
 source/text/shared/01/05230100.xhp|   57 +-
 source/text/shared/01/0604.xhp|8 -
 source/text/shared/explorer/database/rep_main.xhp |   52 -
 source/text/shared/explorer/database/rep_prop.xhp |  115 ++
 source/text/shared/guide/protection.xhp   |6 -
 source/text/shared/guide/redlining_accept.xhp |   46 
 18 files changed, 393 insertions(+), 393 deletions(-)

New commits:
commit f025640e2603ee252a21e935c2790627a2e95224
Author: Rafael Lima 
AuthorDate: Tue Oct 19 15:52:52 2021 +0200
Commit: Olivier Hallot 
CommitDate: Thu Oct 21 20:00:22 2021 +0200

Fix  tags for better l10n (Part 1)

This is Part 1 of the fixes requested by translators concerning the use of 
the .

Change-Id: Iee5ea4289034449c33156d4e20483943eb872ae0
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123782
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp 
b/source/text/sbasic/shared/03/lib_ScriptForge.xhp
index 7e6891169..466532b1d 100644
--- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp
+++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp
@@ -1,33 +1,34 @@
 
 
-
-
-
-ScriptForge Libraries
-/text/sbasic/shared/03/lib_ScriptForge.xhp
-
-
-
-The ScriptForge 
Library
-
-BASIC ScriptForge library
-Python scriptforge module
-
-
-
-
+
+
+
+  
+ScriptForge Libraries
+/text/sbasic/shared/03/lib_ScriptForge.xhp
+  
+
+
+  The ScriptForge 
Library
+  
+BASIC ScriptForge library
+Python scriptforge module
+  
+  
+
+  
 ScriptForge 
libraries build up an extensible collection of macro scripting resources for 
%PRODUCTNAME to be invoked from Basic macros or Python scripts.
 • Basic macros 
require to load ScriptForge library using the following 
statement:   
GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")•
 Python scripts require an import from scriptforge 
module:
   from scriptforge import CreateScriptService
 
-To learn more about how to create and 
execute Python scripts using the ScriptForge library, read 
the  help page.
+  To learn more about how to create and 
execute Python scripts using the ScriptForge library, read 
the help page Creating Python Scripts with ScriptForge.
 The described 
modules and classes are invoked from user scripts as "Services". A generic 
constructor of those services has been designed for that purpose for each 
language:
 
   GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
@@ -101,7 +102,7 @@

  
Form
-   FormControl
+   FormControl
  

 
@@ -194,4 +195,4 @@
   All ScriptForge 
Basic routines or identifiers that are prefixed with an underscore character 
"_" are reserved for internal use. They are not meant be used in Basic 
macros.
 
 
-
\ No newline at end of file
+
diff --git a/source/text/sbasic/shared/03/sf_intro.xhp 
b/source/text/sbasic/shared/03/sf_intro.xhp
index 785a2e06f..98081e545 100644
--- a/source/text/sbasic/shared/03/sf_intro.xhp
+++ b/source/text/sbasic/shared/03/sf_intro.xhp
@@ -46,7 +46,7 @@
   Debugging: Whenever an error occurs in Python 
scripts that use ScriptForge, the error message provided by 
the Python execution stack displays the line of code that triggered the error. 
In Basic error messages do not display this information.
 
   
-  Visit  for more information 
on Python scripting using %PRODUCTNAME.
+  Visit %PRODUCTNAME 
Python Scripts Help for more information on Python scripting using 
%PRODUCTNAME.
   Running Python scripts on %PRODUCTNAME
   Depending on what you 
intend to achieve, you may choose one of the following approaches to running 
Python scripts in %PRODUCTNAME:
   
diff --git a/source/text/sbasic/shared/03/sf_session.xhp 
b/source/text/sbasic/shared/03/sf_session.xhp
index b2b2758ac..85ee3f949 100644
--- a/source/text/sbasic/shared/03/sf_session.xhp
+++ b/source/text/sbasic/shared/03/sf_session.xhp
@@ -16,28 +16,24 @@
   
 
 
-
-
-  
-

[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Alain Romedenne (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 79c05d3aef12a300c8d07b570f789023c107708c
Author: Alain Romedenne 
AuthorDate: Thu Oct 21 19:36:50 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 19:36:50 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 993399c7c55d58bf084234713b07ac6ef8442b03
  - Fixing L10N issues

Change-Id: I45c83f083b861fbe594cb83a82b419aa51b29526
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123786
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/helpcontent2 b/helpcontent2
index b8e91b3ca199..993399c7c55d 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit b8e91b3ca199444badbbcca1bb135f30f6e434eb
+Subproject commit 993399c7c55d58bf084234713b07ac6ef8442b03


[Libreoffice-commits] help.git: source/text

2021-10-21 Thread Alain Romedenne (via logerrit)
 source/text/sbasic/python/python_document_events.xhp |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 993399c7c55d58bf084234713b07ac6ef8442b03
Author: Alain Romedenne 
AuthorDate: Tue Oct 19 18:49:06 2021 +0200
Commit: Rafael Lima 
CommitDate: Thu Oct 21 19:36:49 2021 +0200

Fixing L10N issues

Change-Id: I45c83f083b861fbe594cb83a82b419aa51b29526
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/123786
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/source/text/sbasic/python/python_document_events.xhp 
b/source/text/sbasic/python/python_document_events.xhp
index 445d425e3..f0785b1f2 100644
--- a/source/text/sbasic/python/python_document_events.xhp
+++ b/source/text/sbasic/python/python_document_events.xhp
@@ -45,7 +45,7 @@
   Next to assigning macros to events, one can monitor events raised by 
%PRODUCTNAME documents. Application Programming Interface (API) broadcasters 
are responsible for calling event scripts. Unlike listeners that require to 
define all supported methods, even if unused, document monitors require only 
two methods next to hooked event scripts.
   
   Monitoring Document Events
-  Monitoring is illustrated 
herewith for Basic and Python languages using object-oriented programming. 
Assigning OnLoad script, to the Open Document 
event, suffices to initiate and terminate document event monitoring. 
Tools - Customize menu Events tab is 
used to assign either scripts.
+  Monitoring is illustrated 
herewith for Basic and Python languages using object-oriented programming. 
Assigning OnLoad script, to the Open 
Document event, suffices to initiate and terminate document event 
monitoring. Tools - Customize menu 
Events tab is used to assign either scripts.
   Intercepting events helps setting 
scripts pre- and post-conditions such as loading and unloading libraries or 
track script processing in the background. Access2Base.Trace 
module usage is illustrating that second context.
  With Python
   
@@ -54,7 +54,7 @@
 API;script.provider.XScript: Monitoring Document 
Event
   
   Events monitoring starts from 
object instantiation and ultimately stops when Python releases the object. 
Raised events are reported using Access2Base 
console.
-  OnLoad and 
OnUnload events can be used to respectively set and unset 
Python programs path. They are described as Open document and 
Document closed.
+  OnLoad and 
OnUnload events can be used to respectively set and unset 
Python programs path. They are described as Open document 
and Document closed.
   
  # -*- coding: 
utf-8 -*-
  from __future__ 
import unicode_literals
@@ -117,7 +117,7 @@
  
Console.show()
  
  def 
OnLoad(*args):  # 'Open Document' event
- listener = 
UiDocument()  # Initiates listening
+ listener = 
UiDocument()  # Initiates listening
  
  def 
OnUnload(*args):  # 'Document has been closed' event
  pass  # 
(optional) performed when disposed
@@ -152,7 +152,7 @@
  
@staticmethod
  def 
_a2bScript(script: str, library='Access2Base',
  
module='Trace') -> XScript:
- 
''' Grab application-based Basic script 
'''
+ 
''' Grab application-based Basic script 
'''
  sm = 
uno.getComponentContext().ServiceManager
  mspf = 
sm.createInstanceWithContext(
  
"com.sun.star.script.provider.MasterScriptProviderFactory",
@@ -163,7 +163,7 @@
  return 
xScript
   
   Mind the misspelled 
documentEventOccured method that inherits a typo from 
%PRODUCTNAME Application Programming Interface (API).
-  Start application and 
Close application events can respectively be used to set and to 
unset Python path for user scripts or %PRODUCTNAME scripts. In a similar 
fashion, document based Python libraries or modules can be loaded and released 
using Open document and Document closed events. Refer 
to Importing Python Modules for more information.
+  Start application 
and Close application events can respectively be used to 
set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a 
similar fashion, document based Python libraries or modules can be loaded and 
released using Open document and Document 
closed events. Refer to Importing Python Modules for more information.
  With %PRODUCTNAME Basic
   
 API;GlobalScope.BasicLibraries


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - 3 commits - RepositoryExternal.mk xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk

2021-10-21 Thread Michael Stahl (via logerrit)
 RepositoryExternal.mk |   26 +
 dev/null  |binary
 xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk |8 
 xmlsecurity/CppunitTest_xmlsecurity_signing.mk|8 
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   32 +
 xmlsecurity/qa/unit/signing/data/cert9.db |binary
 xmlsecurity/qa/unit/signing/data/key4.db  |binary
 xmlsecurity/qa/unit/signing/data/pkcs11.txt   |5 
 xmlsecurity/qa/unit/signing/data/test.p7b |  249 
++
 xmlsecurity/qa/unit/signing/signing.cxx   |   40 +
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   63 ++
 11 files changed, 419 insertions(+), 12 deletions(-)

New commits:
commit 874c02831fd2420b35b9719266ecec5d76707121
Author: Michael Stahl 
AuthorDate: Fri Oct 15 20:52:47 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:21:49 2021 +0200

xmlsecurity: fix test failing because NSS policy forbids SHA1

With Fedora's nss-3.71.0-1.fc34.x86_64 there is the problem that
8 tests including testODFGood in CppunitTest/xmlsecurity_signing
fail because the crypto policy disallows SHA1 for signatures.

Apparently this particular policy bit was added in NSS 3.59:
https://bugzilla.mozilla.org/show_bug.cgi?id=1670835

For signatures, maybe it's not a good idea to override system policy
for product builds, so do it locally in the tests, at least for now.

If similar problems turn up for encrypted documents in the future,
that should be fixed in product builds too of course, as encrypted
documents must always be decryptable.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123768
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 51e82016e8783a452fe5f7921d12c1bf20bfd6b5)

xmlsecurity: fix --without-system-nss usage of NSS_SetAlgorithmPolicy

The problem with commit ff572d9222ec16ffd679ae907a0bf4a8900265e1
is that it's using the wrong library; NSS_SetAlgorithmPolicy is actually
in libnssutil3.so.

This causes a linking problem when upgrading the internal NSS to a
version that has NSS_USE_ALG_IN_ANY_SIGNATURE.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123819
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 395c0c0bbaceadf909e0189af99c6358487c7978)

Change-Id: I4f634cf5da1707fb628e63cd0cdafebdf4fc903f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123841
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index a892a59452e3..0b935279e712 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3454,6 +3454,11 @@ $(call gb_LinkTarget_add_libs,$(1),\
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget__use_nss3,$(1))
+
+endef
+
 define gb_LinkTarget__use_plc4
 $(call gb_LinkTarget__use_nss3,$(1))
 
@@ -3523,6 +3528,27 @@ endif
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget_use_package,$(1),nss)
+$(call gb_LinkTarget_set_include,$(1),\
+   $$(INCLUDE) \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include \
+)
+
+ifeq ($(COM),MSC)
+$(call gb_LinkTarget_add_libs,$(1),\
+   $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/nssutil3.lib \
+)
+else
+$(call gb_LinkTarget_add_libs,$(1),\
+   -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \
+   -lnssutil3 \
+)
+endif
+
+endef
+
 define gb_ExternalProject__use_nss3
 $(call gb_ExternalProject_use_package,$(1),nss)
 
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
index 021ab8dbe99f..083edf36dbe7 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
 boost_headers \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_pdfsigning,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
index 60a21f3944e1..4b3c4787ea73 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_signing,\
 libxml2 \
 ))
 
+ifneq ($(OS),WNT)

[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - 3 commits - RepositoryExternal.mk xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk

2021-10-21 Thread Michael Stahl (via logerrit)
 RepositoryExternal.mk |   26 +
 dev/null  |binary
 xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk |8 
 xmlsecurity/CppunitTest_xmlsecurity_signing.mk|8 
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   32 +
 xmlsecurity/qa/unit/signing/data/cert9.db |binary
 xmlsecurity/qa/unit/signing/data/key4.db  |binary
 xmlsecurity/qa/unit/signing/data/pkcs11.txt   |5 
 xmlsecurity/qa/unit/signing/data/test.p7b |  249 
++
 xmlsecurity/qa/unit/signing/signing.cxx   |   40 +
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   63 ++
 11 files changed, 419 insertions(+), 12 deletions(-)

New commits:
commit 0f3431026dbff0251efeb0b92be335841a08cc5d
Author: Michael Stahl 
AuthorDate: Fri Oct 15 20:52:47 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:20:39 2021 +0200

xmlsecurity: fix test failing because NSS policy forbids SHA1

With Fedora's nss-3.71.0-1.fc34.x86_64 there is the problem that
8 tests including testODFGood in CppunitTest/xmlsecurity_signing
fail because the crypto policy disallows SHA1 for signatures.

Apparently this particular policy bit was added in NSS 3.59:
https://bugzilla.mozilla.org/show_bug.cgi?id=1670835

For signatures, maybe it's not a good idea to override system policy
for product builds, so do it locally in the tests, at least for now.

If similar problems turn up for encrypted documents in the future,
that should be fixed in product builds too of course, as encrypted
documents must always be decryptable.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123768
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 51e82016e8783a452fe5f7921d12c1bf20bfd6b5)

xmlsecurity: fix --without-system-nss usage of NSS_SetAlgorithmPolicy

The problem with commit ff572d9222ec16ffd679ae907a0bf4a8900265e1
is that it's using the wrong library; NSS_SetAlgorithmPolicy is actually
in libnssutil3.so.

This causes a linking problem when upgrading the internal NSS to a
version that has NSS_USE_ALG_IN_ANY_SIGNATURE.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123819
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 395c0c0bbaceadf909e0189af99c6358487c7978)

Change-Id: I4f634cf5da1707fb628e63cd0cdafebdf4fc903f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123838
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 9aa00cb82e33..701fc5498a92 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3376,6 +3376,11 @@ $(call gb_LinkTarget_add_libs,$(1),\
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget__use_nss3,$(1))
+
+endef
+
 define gb_LinkTarget__use_plc4
 $(call gb_LinkTarget__use_nss3,$(1))
 
@@ -3445,6 +3450,27 @@ endif
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget_use_package,$(1),nss)
+$(call gb_LinkTarget_set_include,$(1),\
+   $$(INCLUDE) \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include \
+)
+
+ifeq ($(COM),MSC)
+$(call gb_LinkTarget_add_libs,$(1),\
+   $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/nssutil3.lib \
+)
+else
+$(call gb_LinkTarget_add_libs,$(1),\
+   -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \
+   -lnssutil3 \
+)
+endif
+
+endef
+
 define gb_ExternalProject__use_nss3
 $(call gb_ExternalProject_use_package,$(1),nss)
 
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
index f2500b5d3100..f6a74a9eabd7 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
 boost_headers \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_pdfsigning,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
index 7d0c5200ff27..bdac7bda71e5 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
@@ -35,6 +35,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_signing,\
 libxml2 \
 ))
 
+ifneq ($(OS),WNT)

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

2021-10-21 Thread Szymon Kłos (via logerrit)
 sfx2/source/appl/appserv.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 5f67ef053f7543d20d80669a4b3eba15f44fbeb4
Author: Szymon Kłos 
AuthorDate: Mon Jul 26 11:59:39 2021 +0200
Commit: Szymon Kłos 
CommitDate: Thu Oct 21 19:22:05 2021 +0200

online: keep sidebar opened

when we switch mode in online keep sidebar in opened
state. For example when switching from notebookbar
to classic mode - sidebar is set to "Tabs" what makes
sidebar hidden in online. The same happened when
crash occured.

Change-Id: I5d0d1dba4c89b5e380a0bf717fabf4337016894c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119496
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit 2d9c05d615c2bf8dc494f4eec1213d27c74d24ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123975

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 47fb7a5f92c7..4f9af60cb981 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -955,6 +955,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 // Sidebar
 pViewFrame->ShowChildWindow( SID_SIDEBAR );
 
+if (comphelper::LibreOfficeKit::isActive())
+aSidebarMode = "Opened";
+
 sfx2::sidebar::SidebarController* pSidebar =
 
sfx2::sidebar::SidebarController::GetSidebarControllerForFrame( xFrame );
 if ( pSidebar )


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - RepositoryExternal.mk xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk x

2021-10-21 Thread Michael Stahl (via logerrit)
 RepositoryExternal.mk |   26 ++
 xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk |8 ++
 xmlsecurity/CppunitTest_xmlsecurity_signing.mk|8 ++
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   16 +
 xmlsecurity/qa/unit/signing/signing.cxx   |   11 +
 5 files changed, 69 insertions(+)

New commits:
commit 17911db97ebbabc59a3b844c26003a2ca87abac6
Author: Michael Stahl 
AuthorDate: Fri Oct 15 20:52:47 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:12:31 2021 +0200

xmlsecurity: fix test failing because NSS policy forbids SHA1

With Fedora's nss-3.71.0-1.fc34.x86_64 there is the problem that
8 tests including testODFGood in CppunitTest/xmlsecurity_signing
fail because the crypto policy disallows SHA1 for signatures.

Apparently this particular policy bit was added in NSS 3.59:
https://bugzilla.mozilla.org/show_bug.cgi?id=1670835

For signatures, maybe it's not a good idea to override system policy
for product builds, so do it locally in the tests, at least for now.

If similar problems turn up for encrypted documents in the future,
that should be fixed in product builds too of course, as encrypted
documents must always be decryptable.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123768
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 51e82016e8783a452fe5f7921d12c1bf20bfd6b5)

xmlsecurity: fix --without-system-nss usage of NSS_SetAlgorithmPolicy

The problem with commit ff572d9222ec16ffd679ae907a0bf4a8900265e1
is that it's using the wrong library; NSS_SetAlgorithmPolicy is actually
in libnssutil3.so.

This causes a linking problem when upgrading the internal NSS to a
version that has NSS_USE_ALG_IN_ANY_SIGNATURE.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123819
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 395c0c0bbaceadf909e0189af99c6358487c7978)

Change-Id: I4f634cf5da1707fb628e63cd0cdafebdf4fc903f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123838
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 9aa00cb82e33..701fc5498a92 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3376,6 +3376,11 @@ $(call gb_LinkTarget_add_libs,$(1),\
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget__use_nss3,$(1))
+
+endef
+
 define gb_LinkTarget__use_plc4
 $(call gb_LinkTarget__use_nss3,$(1))
 
@@ -3445,6 +3450,27 @@ endif
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget_use_package,$(1),nss)
+$(call gb_LinkTarget_set_include,$(1),\
+   $$(INCLUDE) \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include \
+)
+
+ifeq ($(COM),MSC)
+$(call gb_LinkTarget_add_libs,$(1),\
+   $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/nssutil3.lib \
+)
+else
+$(call gb_LinkTarget_add_libs,$(1),\
+   -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \
+   -lnssutil3 \
+)
+endif
+
+endef
+
 define gb_ExternalProject__use_nss3
 $(call gb_ExternalProject_use_package,$(1),nss)
 
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
index f2500b5d3100..f6a74a9eabd7 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
 boost_headers \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_pdfsigning,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
index 7d0c5200ff27..bdac7bda71e5 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
@@ -35,6 +35,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_signing,\
 libxml2 \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_signing,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_signing,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx 
b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 2894b4a2fa2d..6dd7a86cac5c 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at ht

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - xmlsecurity/qa

2021-10-21 Thread Michael Stahl (via logerrit)
 dev/null  |binary
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |7 ---
 xmlsecurity/qa/unit/signing/data/cert9.db |binary
 xmlsecurity/qa/unit/signing/data/key4.db  |binary
 xmlsecurity/qa/unit/signing/data/pkcs11.txt   |5 +
 xmlsecurity/qa/unit/signing/signing.cxx   |7 ---
 6 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 8a691d6cdb88d47e98b6d9ecd750f6877f1f9f0f
Author: Michael Stahl 
AuthorDate: Thu Oct 14 13:44:14 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:12:06 2021 +0200

test: upgrade test NSS database from dbm: to sql:

Fedora nss-3.69.0-1.fc34.x86_64 and Debian libnss3:amd64 2:3.70-1 no
longer support the old BerekelyDB databases, so convert them to the new
SQLite format for the benefit of --with-system-nss builds.

This worked to do the upgrade:

> certutil -N -d sql:test/new --empty-password
> LD_LIBRARY_PATH=instdir/program 
workdir/UnpackedTarball/nss/dist/out/bin/certutil --merge -d sql:test/new 
--source-dir dbm:test/signing-keys

Builds would fail running tests added in commit
40d70d427edddb589eda64fafc2e56536953d274

  signing.cxx:551:Assertion
  Test name: testODFX509CertificateChain::TestBody
  equality assertion failed
  - Expected: 0
  - Actual  : 1

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123586
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 907784ccce7bd8b5121888cff7f5723a55d35358)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123643
Reviewed-by: Caolán McNamara 
(cherry picked from commit 7b4b03b9cf21ecd11bc82da5f29c4ff91ad242c9)

Change-Id: I00aa20703e117ebf583c3331b84e966c2cfc78cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123837
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx 
b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 1d45d5bef16b..2894b4a2fa2d 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -79,9 +79,10 @@ void PDFSigningTest::setUp()
 OUString caVar("LIBO_TEST_CRYPTOAPI_PKCS7");
 osl_setEnvironment(caVar.pData, aTargetPath.pData);
 #else
-// Set up cert8.db and key3.db in workdir/CppunitTest/
-osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "cert8.db");
-osl::File::copy(aSourceDir + "key3.db", aTargetDir + "key3.db");
+// Set up NSS database in workdir/CppunitTest/
+osl::File::copy(aSourceDir + "cert9.db", aTargetDir + "/cert9.db");
+osl::File::copy(aSourceDir + "key4.db", aTargetDir + "/key4.db");
+osl::File::copy(aSourceDir + "pkcs11.txt", aTargetDir + "/pkcs11.txt");
 setenv("MOZILLA_CERTIFICATE_FOLDER", aTargetPath.toUtf8().getStr(), 1);
 #endif
 }
diff --git a/xmlsecurity/qa/unit/signing/data/cert8.db 
b/xmlsecurity/qa/unit/signing/data/cert9.db
similarity index 50%
rename from xmlsecurity/qa/unit/signing/data/cert8.db
rename to xmlsecurity/qa/unit/signing/data/cert9.db
index 95e58ffe5b92..c4064e419f42 100644
Binary files a/xmlsecurity/qa/unit/signing/data/cert8.db and 
b/xmlsecurity/qa/unit/signing/data/cert9.db differ
diff --git a/xmlsecurity/qa/unit/signing/data/key3.db 
b/xmlsecurity/qa/unit/signing/data/key3.db
deleted file mode 100644
index f449e60a667f..
Binary files a/xmlsecurity/qa/unit/signing/data/key3.db and /dev/null differ
diff --git a/xmlsecurity/qa/unit/signing/data/key4.db 
b/xmlsecurity/qa/unit/signing/data/key4.db
new file mode 100644
index ..34a7fa28aa32
Binary files /dev/null and b/xmlsecurity/qa/unit/signing/data/key4.db differ
diff --git a/xmlsecurity/qa/unit/signing/data/pkcs11.txt 
b/xmlsecurity/qa/unit/signing/data/pkcs11.txt
new file mode 100644
index ..22c8f8519efd
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/pkcs11.txt
@@ -0,0 +1,5 @@
+library=
+name=NSS Internal PKCS #11 Module
+parameters=configdir='sql:test/new' certPrefix='' keyPrefix='' 
secmod='secmod.db' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' 
updateid='' updateTokenDescription='' 
+NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 
slotParams=(1={slotFlags=[ECC,RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512]
 askpw=any timeout=30})
+
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 2db562f969a9..dac8c054e0ec 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -102,9 +102,10 @@ void SigningTest::setUp()
 OUString aTargetDir
 = 
m_directories.getURLFromWorkdir("CppunitTest/xmlsecurity_signing.test.user");
 
-// Set up cert8.db in workdir/CppunitTest/
-osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "/cert8.db");
-osl::File::copy(aSourceDir + "key3.db", aTargetDir + "

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - xmlsecurity/qa xmlsecurity/source

2021-10-21 Thread Michael Stahl (via logerrit)
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   15 
 xmlsecurity/qa/unit/signing/data/test.p7b |  249 
++
 xmlsecurity/qa/unit/signing/signing.cxx   |   22 
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   63 ++
 4 files changed, 340 insertions(+), 9 deletions(-)

New commits:
commit ecc2c6f98ed94ab08c1d3fc42d653d53444c54b2
Author: Michael Stahl 
AuthorDate: Fri Oct 15 16:58:07 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:11:37 2021 +0200

xmlsecurity: fix new tests on WNT

Tests added in commit 40d70d427edddb589eda64fafc2e56536953d274 don't
actually run on WNT but that wasn't obvious because commit
149df1fec6472e30582162e17e04c75aee91d26a prevented running them in
Jenkins on master, they failed only in the libreoffice-7-1 backport.

  xmlsecurity/qa/unit/signing/signing.cxx(631) : error : Assertion
  Test name: testODFDoubleX509Certificate::TestBody
  assertion failed
  - Expression: (nActual == SignatureState::NOTVALIDATED || nActual == 
SignatureState::OK)
  - 2

This is an oddity where NSS claims the signature in the document is
valid but CryptoAPI claims it is invalid; the hashes passed into the
validation functions are the same.  Just allow BROKEN as an additional
result value on WNT.

  xmlsecurity/qa/unit/signing/signing.cxx(550) : error : Assertion
  Test name: testODFX509CertificateChain::TestBody
  equality assertion failed
  - Expected: 0
  - Actual  : 1

The problem here is that with NSS the tests use a custom NSS database
in test/signing-keys so we need to make these certificates available for
CryptoAPI too.

The following one-liner converts the NSS database to a PKCS#7 that can
be loaded by CrytpAPI:

> openssl crl2pkcs7 -nocrl -certfile <(certutil -d sql:test/signing-keys -L 
| awk '/^[^ ].*,[^ ]*,/ { printf "%s", $1; for (i = 2; i < NF; i++) { printf " 
%s", $i; } printf "\n"; }' | while read name; do certutil -L -d 
sql:test/signing-keys -a -n "${name}" ; done) > test/signing-keys/test.p7b

Then one might naively assume that something like this would allow these
certificates to be added temporarily as trusted CAs:

+HCERTSTORE hRoot = CertOpenSystemStoreW( 0, L"Root" ) ;
+HCERTSTORE const hExtra = CertOpenStore(
+CERT_STORE_PROV_FILENAME_A,
+PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
+NULL,
+CERT_STORE_OPEN_EXISTING_FLAG | 
CERT_STORE_READONLY_FLAG,
+path);
+if (hExtra != NULL && hRoot != NULL)
+{
+BOOL ret = CertAddStoreToCollection(
+hRoot,
+hExtra,
+CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG,
+0);
+SAL_DEBUG("XXX hExtra done " << ret);
+}

There is no error from this, but it doesn't work.

Instead, check if CertGetCertificateChain() sets the
CERT_TRUST_IS_UNTRUSTED_ROOT flag and then look up the certificate
manually in the extra PKCS#7 store.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123667
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 7d664ec788acdc378506a7ff8b1120cea24a6770)

Change-Id: Ic9865e0b5783211c2128ce0327c4583b7784ff62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123836
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx 
b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 20241f016d52..1d45d5bef16b 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -66,15 +67,21 @@ void PDFSigningTest::setUp()
 
 
mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory()));
 
-#ifndef _WIN32
-// Set up cert8.db and key3.db in workdir/CppunitTest/
 OUString aSourceDir = m_directories.getURLFromSrc(DATA_DIRECTORY);
 OUString aTargetDir
 = 
m_directories.getURLFromWorkdir("/CppunitTest/xmlsecurity_pdfsigning.test.user/");
-osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "cert8.db");
-osl::File::copy(aSourceDir + "key3.db", aTargetDir + "key3.db");
 OUString aTargetPath;
 osl::FileBase::getSystemPathFromFileURL(aTargetDir, aTargetPath);
+
+#ifdef _WIN32
+// CryptoAPI test certificates
+osl::File::copy(aSourceDir + "test.p7b", aTargetDir + "/test.p7b");
+OUString caVar("LIBO_TEST_CRYPTOAPI_PKCS7");
+osl_setEnvironment(caVar.pData, aT

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - xmlsecurity/qa

2021-10-21 Thread Michael Stahl (via logerrit)
 
xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 |binary
 xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
   |binary
 xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
   |binary
 
xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 |binary
 xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt 
   |binary
 xmlsecurity/qa/unit/signing/signing.cxx
   |  100 ++
 6 files changed, 100 insertions(+)

New commits:
commit 956c638025e3c0bbe816f710da64769cf5874f4f
Author: Michael Stahl 
AuthorDate: Fri Feb 26 17:29:37 2021 +0100
Commit: Michael Stahl 
CommitDate: Thu Oct 21 19:11:03 2021 +0200

xmlsecurity: add tests for multiple X509Data/X509Certificate

Change-Id: If50ae8156f81c1053aa8fbfc3148da64bb8e1442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123438
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 
b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
new file mode 100644
index ..d63e4b6b7b72
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt
new file mode 100644
index ..0190abb00f23
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
new file mode 100644
index ..f4b4198f94a6
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt 
differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
new file mode 100644
index ..558bdee47e59
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt 
b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt
new file mode 100644
index ..5e519dd8b7e7
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 7d9d75a32150..e960a21d2bce 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -580,6 +581,105 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testODFUnsignedTimestamp)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(18183742), infos[0].SignatureTime);
 }
 
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFX509CertificateChain)
+{
+createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+  + "signed_with_x509certificate_chain.odt");
+SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pBaseModel);
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+CPPUNIT_ASSERT(pObjectShell);
+SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+CPPUNIT_ASSERT_MESSAGE(
+(OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+(nActual == SignatureState::NOTVALIDATED || nActual == 
SignatureState::OK));
+uno::Sequence const infos(
+pObjectShell->GetDocumentSignatureInformation(false));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+// check that the signing certificate was picked, not one of the 2 CA ones
+CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::VALID, 
infos[0].CertificateStatus);
+CPPUNIT_ASSERT(infos[0].Signer.is());
+CPPUNIT_ASSERT_EQUAL(
+OUString("CN=Xmlsecurity RSA Test example Alice,O=Xmlsecurity RSA 
Test,ST=England,C=UK"),
+infos[0].Signer->getSubjectName());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFDoubleX509Data)
+{
+createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+  + "02_doc_signed_by_attacker_manipulated.odt");
+SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pBaseModel);
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+CPPUNIT_ASSERT(pObjectShell);
+SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+CPPUNIT_ASSERT_MESSAGE(
+(OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ 

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

2021-10-21 Thread Noel Grandin (via logerrit)
 sw/inc/bparr.hxx|   22 +--
 sw/qa/core/Test-BigPtrArray.cxx |   76 
 sw/source/core/bastyp/bparr.cxx |   24 ++--
 3 files changed, 61 insertions(+), 61 deletions(-)

New commits:
commit 1fac487cfbb1d6c0bb1b3ccdfe44c4645c7e087e
Author: Noel Grandin 
AuthorDate: Thu Oct 21 15:36:20 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 21 19:04:20 2021 +0200

use sal_Int32 in BigPtrArray

now that it's only use-case is also using sal_Int32

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

diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index d28e964685d7..f4c1c47d6da1 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -41,7 +41,7 @@ public:
 virtual ~BigPtrEntry() = default;
 BigPtrEntry & operator =(BigPtrEntry const &) = default;
 
-inline sal_uLong GetPos() const;
+inline sal_Int32 GetPos() const;
 inline BigPtrArray& GetArray() const;
 };
 
@@ -59,7 +59,7 @@ struct BlockInfo final
 BigPtrArray* pBigArr;  ///< in this array the block is located
 std::array
  mvData;   ///< data block
-sal_uLongnStart, nEnd; ///< start- and end index
+sal_Int32nStart, nEnd; ///< start- and end index
 sal_uInt16   nElem;///< number of elements
 };
 
@@ -68,13 +68,13 @@ class SW_DLLPUBLIC BigPtrArray
 protected:
 std::unique_ptr
 m_ppInf;  ///< block info
-sal_uLong   m_nSize;  ///< number of elements
+sal_Int32   m_nSize;  ///< number of elements
 sal_uInt16  m_nMaxBlock;  ///< current max. number of blocks
 sal_uInt16  m_nBlock; ///< number of blocks
 mutable
 sal_uInt16  m_nCur;   ///< last used block
 
-sal_uInt16  Index2Block( sal_uLong ) const; ///< block search
+sal_uInt16  Index2Block( sal_Int32 ) const; ///< block search
 BlockInfo*  InsBlock( sal_uInt16 ); ///< insert block
 voidBlockDel( sal_uInt16 ); ///< some blocks were deleted
 voidUpdIndex( sal_uInt16 ); ///< recalculate indices
@@ -86,17 +86,17 @@ public:
 BigPtrArray();
 ~BigPtrArray();
 
-sal_uLong Count() const { return m_nSize; }
+sal_Int32 Count() const { return m_nSize; }
 
-void Insert( BigPtrEntry* p, sal_uLong pos );
-void Remove( sal_uLong pos, sal_uLong n = 1 );
-void Move( sal_uLong from, sal_uLong to );
-void Replace( sal_uLong pos, BigPtrEntry* p);
+void Insert( BigPtrEntry* p, sal_Int32 pos );
+void Remove( sal_Int32 pos, sal_Int32 n = 1 );
+void Move( sal_Int32 from, sal_Int32 to );
+void Replace( sal_Int32 pos, BigPtrEntry* p);
 
-BigPtrEntry* operator[]( sal_uLong ) const;
+BigPtrEntry* operator[]( sal_Int32 ) const;
 };
 
-inline sal_uLong BigPtrEntry::GetPos() const
+inline sal_Int32 BigPtrEntry::GetPos() const
 {
 assert(this == m_pBlock->mvData[ m_nOffset ]); // element not in the block
 return m_pBlock->nStart + m_nOffset;
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index 3234b26f17eb..6754cda04007 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -27,38 +27,38 @@
 
 namespace /* private */
 {
-const sal_uLong NUM_ENTRIES = 10;
+const sal_Int32 NUM_ENTRIES = 10;
 
 class BigPtrEntryMock : public BigPtrEntry
 {
 public:
-explicit BigPtrEntryMock(sal_uLong count) : count_(count)
+explicit BigPtrEntryMock(sal_Int32 count) : count_(count)
 {
 }
 
-sal_uLong getCount() const
+sal_Int32 getCount() const
 {
 return count_;
 }
 
-sal_uLong Position() const
+sal_Int32 Position() const
 {
 return GetPos();
 }
 
 private:
-sal_uLong count_;
+sal_Int32 count_;
 };
 
-void fillBigPtrArray(BigPtrArray& bparr, sal_uLong numEntries)
+void fillBigPtrArray(BigPtrArray& bparr, sal_Int32 numEntries)
 {
-for (sal_uLong i = 0; i < numEntries; i++)
+for (sal_Int32 i = 0; i < numEntries; i++)
 bparr.Insert(new BigPtrEntryMock(i), bparr.Count());
 }
 
 bool checkElementPositions(const BigPtrArray& bparr)
 {
-for (sal_uLong i = 0; i < bparr.Count(); i++)
+for (sal_Int32 i = 0; i < bparr.Count(); i++)
 {
 if (static_cast(bparr[i])->Position() != i)
 return false;
@@ -68,7 +68,7 @@ namespace /* private */
 
 void releaseBigPtrArrayContent(BigPtrArray const & bparr)
 {
-for (sal_uLong i = 0; i < bparr.Count(); i++)
+for (sal_Int32 i = 0; i < bparr.Count(); i++)
 delete bparr[i];
 }
 }
@@ -93,7 +9

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

2021-10-21 Thread Miklos Vajna (via logerrit)
 svx/qa/unit/data/auto-height-multi-col-shape.pptx |binary
 svx/qa/unit/svdraw.cxx|   28 ++
 svx/source/svdraw/svdoashp.cxx|   11 
 3 files changed, 39 insertions(+)

New commits:
commit ea5d4bab6c54432bf590f8650d9f5ea930a0daaa
Author: Miklos Vajna 
AuthorDate: Thu Oct 21 16:49:53 2021 +0200
Commit: Miklos Vajna 
CommitDate: Thu Oct 21 18:32:44 2021 +0200

sd: fix inteaction between multi-col shape text and automatic height

Multi-column shape text works by assuming a fixed height, then flowing
content to a next column once the current one is full.

Automatic height works by first laying out the text and then resizing
the shape to have a matching height.

When both are enabled, then we used to first calculate the automatic
height and then lay out the multi-col text using that height. PowerPoint
takes the height from the file format and lays out the multi-col text
using that fixed height, and only editing modifies the automatic height.

Fix the problem by not updating the automatic height when we have
multiple columns, this is meant to improve the stability of the layout
anyway.

Manual testing shows that editing the text on the UI still updates the
automatic height, as probably expected.

Based on Mike Kaganski's research - thanks! :-)

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

diff --git a/svx/qa/unit/data/auto-height-multi-col-shape.pptx 
b/svx/qa/unit/data/auto-height-multi-col-shape.pptx
new file mode 100644
index ..12f232b0f236
Binary files /dev/null and b/svx/qa/unit/data/auto-height-multi-col-shape.pptx 
differ
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 7ad70b9ce92d..34f3c13cfbaa 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -323,6 +323,34 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testRectangleObject)
 SdrObject* pObject(pRectangle);
 SdrObject::Free(pObject);
 }
+
+CPPUNIT_TEST_FIXTURE(SvdrawTest, testAutoHeightMultiColShape)
+{
+// Given a document containing a shape that has:
+// 1) automatic height (resize shape to fix text)
+// 2) multiple columns (2)
+OUString aURL
+= 
m_directories.getURLFromSrc(u"svx/qa/unit/data/auto-height-multi-col-shape.pptx");
+
+// When loading that document:
+getComponent().set(loadFromDesktop(aURL, 
"com.sun.star.presentation.PresentationDocument"));
+
+// Make sure the in-file shape height is kept, even if nominally the the 
shape height is
+// automatic:
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 6882
+// - Actual  : 3452
+// i.e. the shape height was smaller than expected, leading to a 2 columns 
layout instead of
+// laying out all the text in the first column.
+// 2477601 is from slide1.xml, .
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+static_cast(o3tl::convert(2477601, o3tl::Length::emu, 
o3tl::Length::mm100)),
+xShape->getSize().Height, 1);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 169f1782dd98..1b35ecd272c7 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2329,7 +2329,18 @@ bool 
SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool
 nHgt=aSiz2.Height()+1; // a little more tolerance
 }
 else
+{
 nHgt = rOutliner.GetTextHeight()+1; // a little more 
tolerance
+
+sal_Int16 nColumns = 
GetMergedItem(SDRATTR_TEXTCOLUMNS_NUMBER).GetValue();
+if (bHgtGrow && nColumns > 1)
+{
+// Both 'resize shape to fix text' and multiple 
columns are enabled. The
+// first means a dynamic height, the second 
expects a fixed height.
+// Resolve this conflict by going with the 
original height.
+nHgt = rR.getHeight();
+}
+}
 rOutliner.Clear();
 }
 }


Re: EasyHack Suggestion: Use range based for loops

2021-10-21 Thread Stephan Bergmann

On 10/21/21 17:25, Luboš Luňák wrote:

On Thursday 21 of October 2021, Hossein Nourikhah wrote:

Since C++11, range based loops are available for iterating over a known
range of values. For example, when there is a need to process elements
of a container, range based loops are usually a good choice. They are
easy to write, read and understand.

The simplest form is as below:

for(auto variable : range)
statement;


  I generally dislike the (ab)use of 'auto' to save a little typing at the
expense of readibility. Code is read much more often than written, and it's
also quite often read e.g. in gerrit where there's nothing to easily tell
what 'auto' is, so generally code should be aimed at being easy to read, not
necessarily to write. It's not black or white of course, but I disagree with
something that generically advises to use 'auto'.


Range based loops can simplify the code, but there are limitations for
them. For example, if there is a need not to iterate over certain
values, std::ranges::views::drop (C++20) should be used, so they are not
suitable for replacing every normal for loop.


  If the instructions are aimed at people who need spelling out how to use
ranged for loops, then it needs to stress more that it is basically usable
only for sequential iterating over elements of a container that does not
change. Otherwise we risk that newbies will break things by rewriting even
non-trivial loops.


Maybe cut the complete easy hack description down to just "Use range 
based for loops ...where applicable, across the source code".  Those 
easy hacks are meant for people to start getting involved in LO 
development, not to teach people about C++ in general.




[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/qa vcl/source

2021-10-21 Thread Mark Hung (via logerrit)
 vcl/qa/cppunit/pdfexport/data/tdf144222.ods |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx  |   42 
 vcl/source/gdi/pdfwriter_impl.cxx   |2 -
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 28dcd1f17a73929c26e490cec929706d3a06b042
Author: Mark Hung 
AuthorDate: Sat Oct 16 13:55:56 2021 +0800
Commit: Xisco Fauli 
CommitDate: Thu Oct 21 17:45:50 2021 +0200

tdf#144222 fix pdf export with vertical layout

Remove the offset adjustment that is no longer necessary.
That was done in every backend before, and has been
removed now.  We can trust what layout text provides us.

Regression from:

commit dd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481
Author: Mark Hung 
Date:   Sun May 2 15:12:46 2021 +0800

vcl: adjust LayoutText() for vertical writing.

Change-Id: I077f5a5f0711444086e56e4469dbcb3010ffe661
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123682
Tested-by: Jenkins
Reviewed-by: Mark Hung 
(cherry picked from commit a4244c0f05b95ded277a3a7ed217bf0451daa996)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123986
Reviewed-by: Xisco Fauli 

diff --git a/vcl/qa/cppunit/pdfexport/data/tdf144222.ods 
b/vcl/qa/cppunit/pdfexport/data/tdf144222.ods
new file mode 100644
index ..7b572d301abc
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf144222.ods differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 0da9bedd33ef..ad19395c5669 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2945,6 +2945,48 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageRotate180)
 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, aScale.getX(), 0.01);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf144222)
+{
+// Assume Windows has the font for U+4E2D
+#ifdef _WIN32
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf144222.ods";
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("calc_pdf_Export");
+auto pPdfDocument = exportAndParse(aURL, aMediaDescriptor);
+
+// The document has one page.
+CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
+std::unique_ptr pPdfPage = 
pPdfDocument->openPage(/*nIndex=*/0);
+CPPUNIT_ASSERT(pPdfPage);
+std::unique_ptr pTextPage = 
pPdfPage->getTextPage();
+CPPUNIT_ASSERT(pTextPage);
+
+int nPageObjectCount = pPdfPage->getObjectCount();
+const OUString sChar = u"\u4E2D";
+basegfx::B2DRectangle aRect1, aRect2;
+int nCount = 0;
+
+for (int i = 0; i < nPageObjectCount; ++i)
+{
+std::unique_ptr pPdfPageObject = 
pPdfPage->getObject(i);
+if (pPdfPageObject->getType() == vcl::pdf::PDFPageObjectType::Text)
+{
+++nCount;
+OUString sText = pPdfPageObject->getText(pTextPage);
+if (sText == sChar)
+aRect1 = pPdfPageObject->getBounds();
+else
+aRect2 = pPdfPageObject->getBounds();
+}
+}
+
+CPPUNIT_ASSERT_EQUAL(2, nCount);
+CPPUNIT_ASSERT(!aRect1.isEmpty());
+CPPUNIT_ASSERT(!aRect2.isEmpty());
+CPPUNIT_ASSERT(!aRect1.overlaps(aRect2));
+#endif
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 5ca3dfd4cf25..80542ac41dfa 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5827,8 +5827,6 @@ void PDFWriterImpl::drawVerticalGlyphs(
 if (rGlyphs[i].m_pGlyph->IsVertical())
 {
 fDeltaAngle = M_PI/2.0;
-aDeltaPos.setX( GetFontMetric().GetAscent() );
-aDeltaPos.setY( 
static_cast(static_cast(GetFontMetric().GetDescent()) * fXScale) );
 fYScale = fXScale;
 fTempXScale = 1.0;
 fSkewA = -fSkewB;


Re: EasyHack Suggestion: Use range based for loops

2021-10-21 Thread Luboš Luňák
On Thursday 21 of October 2021, Hossein Nourikhah wrote:
> Since C++11, range based loops are available for iterating over a known
> range of values. For example, when there is a need to process elements
> of a container, range based loops are usually a good choice. They are
> easy to write, read and understand.
>
> The simplest form is as below:
>
> for(auto variable : range)
>   statement;

 I generally dislike the (ab)use of 'auto' to save a little typing at the 
expense of readibility. Code is read much more often than written, and it's 
also quite often read e.g. in gerrit where there's nothing to easily tell 
what 'auto' is, so generally code should be aimed at being easy to read, not 
necessarily to write. It's not black or white of course, but I disagree with 
something that generically advises to use 'auto'.

> Range based loops can simplify the code, but there are limitations for
> them. For example, if there is a need not to iterate over certain
> values, std::ranges::views::drop (C++20) should be used, so they are not
> suitable for replacing every normal for loop.

 If the instructions are aimed at people who need spelling out how to use 
ranged for loops, then it needs to stress more that it is basically usable 
only for sequential iterating over elements of a container that does not 
change. Otherwise we risk that newbies will break things by rewriting even 
non-trivial loops.

 And that std::ranges::views::drop part does not belong there at all. C++20 
makes it useless for now, and even without that it would only confuse people.

-- 
 Luboš Luňák
 l.lu...@collabora.com


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

2021-10-21 Thread Julien Nabet (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx   |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx   |2 +-
 sw/source/uibase/uiview/formatclipboard.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 086dc69449fdeb33551f65dd1c3c1c989c4a67f7
Author: Julien Nabet 
AuthorDate: Thu Oct 21 17:21:46 2021 +0200
Commit: Julien Nabet 
CommitDate: Thu Oct 21 17:22:44 2021 +0200

Typo: pragraph->paragraph

Change-Id: I8363b3f9f4f11e3f7447e8bc0853fa4928f8550c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124030
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index f98bb13a4787..1b90c37a9a6f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -788,7 +788,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093.docx")
 // The problem was that the alignment are not exchange when the paragraph 
are RTL.
 uno::Reference xParaRtlLeft(getParagraph( 1, "RTL Left"));
 sal_Int32 nRtlLeft = getProperty< sal_Int32 >( xParaRtlLeft, "ParaAdjust" 
);
-// test the text Direction value for the pragraph
+// test the text Direction value for the paragraph
 sal_Int16 nRLDir  = getProperty< sal_Int32 >( xParaRtlLeft, "WritingMode" 
);
 
 uno::Reference xParaRtlRight(getParagraph( 3, "RTL 
Right"));
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 5d67ff57170f..f5a5c3a8f80b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -717,7 +717,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx")
 // The problem was after save file created by MS the direction changed to 
RTL.
 uno::Reference xParaLTRLeft(getParagraph( 1, "LTR LEFT"));
 sal_Int32 nLTRLeft = getProperty< sal_Int32 >( xParaLTRLeft, "ParaAdjust" 
);
-// test the text Direction value for the pragraph
+// test the text Direction value for the paragraph
 sal_Int16 nLRDir  = getProperty< sal_Int32 >( xParaLTRLeft, "WritingMode" 
);
 
 // this will test the both the text direction and alignment for paragraph
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index b71733a6e4ea..2bf4dd036fef 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -484,7 +484,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 // if there is a named paragraph format recorded and the user 
wants to apply it
 if(!m_aParaStyle.isEmpty() && !bNoParagraphFormats )
 {
-// look for the named pragraph format in the pool
+// look for the named paragraph format in the pool
 SwDocStyleSheet* pStyle = 
static_cast(pPool->Find(m_aParaStyle, SfxStyleFamily::Para));
 if( pStyle )
 {


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

2021-10-21 Thread Tünde Tóth (via logerrit)
 sw/source/core/doc/DocumentRedlineManager.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 65b0510e285e1afb4bccc04521073e7e2f21995f
Author: Tünde Tóth 
AuthorDate: Thu Oct 21 17:10:47 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 17:12:27 2021 +0200

clean up: sw/source/core/doc/DocumentRedlineManager.cxx

Change-Id: Idf4b478fd20e8114808d10dae06a5fe1ddd38369
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124029
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 81747f22246a..4e2925baac2f 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2223,21 +2223,23 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
 bCompress = true;
 
 // split redline to store ExtraData per 
paragraphs
-SwRangeRedline* pPar = new SwRangeRedline( 
*pNewRedl );
-pPar->SetStart( aPos );
-pNewRedl->SetEnd( aPos );
+SwRangeRedline* pPar = new 
SwRangeRedline(*pNewRedl);
+pPar->SetStart(aPos);
+pNewRedl->SetEnd(aPos);
 
 // get extradata for reset formatting of 
the modified paragraph
-SwRedlineExtraData_FormatColl* pExtraData 
= lcl_CopyStyle(aPos, *pStt, false);
+SwRedlineExtraData_FormatColl* pExtraData
+= lcl_CopyStyle(aPos, *pStt, false);
 if (pExtraData)
 {
-
std::unique_ptr xRedlineExtraData;
+
std::unique_ptr
+xRedlineExtraData;
 if (!bFirst)
 pExtraData->SetFormatAll(false);
 xRedlineExtraData.reset(pExtraData);
-pPar->SetExtraData( 
xRedlineExtraData.get() );
+
pPar->SetExtraData(xRedlineExtraData.get());
 }
-
+}
 // skip empty redlines without ExtraData
 // FIXME: maybe checking pExtraData is 
redundant here
 if ( pExtraData || *pPar->Start() != 
*pPar->End() )


[Libreoffice-commits] core.git: helpcontent2

2021-10-21 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b576cf4260f0c2999f8ef0fbc4bd5755256f2e12
Author: Rafael Lima 
AuthorDate: Thu Oct 21 16:45:16 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Thu Oct 21 16:45:16 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to b8e91b3ca199444badbbcca1bb135f30f6e434eb
  - Refactor XHP help files prior to patch

This patch only refactors indentation and headings. No changes are made 
to help contents.

Change-Id: I7cf71ab26381859d92791d95246e0bb88d8b88a6
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124007
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/helpcontent2 b/helpcontent2
index e9bbd8047b2f..b8e91b3ca199 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit e9bbd8047b2f9e5b4a0ae8fdc1dab298b38c50e2
+Subproject commit b8e91b3ca199444badbbcca1bb135f30f6e434eb


[Libreoffice-commits] help.git: source/text

2021-10-21 Thread Rafael Lima (via logerrit)
 source/text/shared/optionen/01070400.xhp|  156 +---
 source/text/shared/optionen/detailedcalculation.xhp |  124 ++---
 source/text/simpress/01/0517.xhp|  102 +-
 source/text/swriter/02/0614.xhp |   73 +++
 source/text/swriter/guide/load_styles.xhp   |  104 +--
 source/text/swriter/guide/numbering_lines.xhp   |  189 +---
 source/text/swriter/guide/using_numbering.xhp   |  143 +++
 source/text/swriter/main0215.xhp|  117 ++--
 8 files changed, 509 insertions(+), 499 deletions(-)

New commits:
commit b8e91b3ca199444badbbcca1bb135f30f6e434eb
Author: Rafael Lima 
AuthorDate: Thu Oct 21 15:53:35 2021 +0200
Commit: Rafael Lima 
CommitDate: Thu Oct 21 16:45:15 2021 +0200

Refactor XHP help files prior to patch

This patch only refactors indentation and headings. No changes are made to 
help contents.

Change-Id: I7cf71ab26381859d92791d95246e0bb88d8b88a6
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124007
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/source/text/shared/optionen/01070400.xhp 
b/source/text/shared/optionen/01070400.xhp
index 05c0e9037..8fa87a751 100644
--- a/source/text/shared/optionen/01070400.xhp
+++ b/source/text/shared/optionen/01070400.xhp
@@ -1,4 +1,5 @@
 
+
 
-
+
 
-
-Print
-/text/shared/optionen/01070400.xhp
-
+  
+Print
+/text/shared/optionen/01070400.xhp
+  
 
+
 
-
-printing; drawings defaults
-drawings; printing defaults
-pages;printing page names in presentations
-printing; dates in presentations
-dates; printing in presentations
-times; inserting when printing presentations
-printing; hidden pages of presentations
-hidden pages; printing in presentations
-printing; without scaling in presentations
-scaling; when printing presentations
-printing; fitting to pages in presentations
-fitting to pages; print settings in 
presentations
-printing; tiling pages in presentations
-MW made "page name printing..." a two level entry
-
-
-Print
-Specifies print settings within a 
drawing or presentation document.
-
-
-
-removed contents-to-print section for impress, 
i85723
-
-Print
-Defines 
additional elements to be printed on the page margin.
-Page name
-Specifies whether to print the page 
name.
-Date
-Specifies whether to print the 
current date.
-Time
-Specifies whether to print the 
current time.
-Hidden pages
-Specifies whether to print the 
pages that are currently hidden from the presentation.
-Quality
-See also 
.
-Default
-Specifies that you want to print 
in original colors.
-Grayscale
-Specifies that you want to print 
colors as grayscale.
-Black & white
-Specifies that you want to 
print the document in black and white.
-Page options
-Define 
additional options for printing the pages.
-Default
-Specifies that you do not want 
to further scale pages when printing.
-Fit to page
-
-Specifies whether to scale down 
objects that are beyond the margins of the current printer, so that they fit on 
the paper in the printer.
-
+  
+
+  printing; drawings defaults
+  drawings; printing defaults
+  pages;printing page names in 
presentations
+  printing; dates in presentations
+  dates; printing in presentations
+  times; inserting when printing 
presentations
+  printing; hidden pages of presentations
+  hidden pages; printing in presentations
+  printing; without scaling in 
presentations
+  scaling; when printing presentations
+  printing; fitting to pages in 
presentations
+  fitting to pages; print settings in 
presentations
+  printing; tiling pages in presentations
+
+
+
+Print
+Specifies print settings within a 
drawing or presentation document.
+  
+  
+
+  
+  
+  Print
+  Defines additional elements 
to be printed on the page margin.
+  
+  Page name
+  Specifies whether to print the page 
name.
+  
+  Date
+  Specifies whether to print the 
current date.
+  
+  Time
+  Specifies whether to print the 
current time.
+  
+  Hidden pages
+  Specifies whether to print the 
pages that are currently hidden from the presentation.
+  Quality
+  See also .
+  
+  Default
+  Specifies that you want to print 
in original colors.
+  
+  Grayscale
+  Specifies that you want to print 
colors as grayscale.
+  
+  Black & white
+  Specifies that you want to 
print the document in black and white.
+  Page options
+  Define additional options for 
printing the pages.
+  
+  Default
+  Specifies that you do not want 
to further scale pages when printing.
+  
+  Fit to page
+  
+Specifies whether to scale down 
objects that are beyond the margins of the current printer, so that they fit on 
the paper in the printer.
+  
 
-Tile pages
-Specifies that pages are to be 
printed in tiled format. If the pages or slides are smaller than the paper, 
several pages or slides will be printed on one page o

ESC meeting minutes: 2021-10-21

2021-10-21 Thread Miklos Vajna
* Present:
+ Heiko, Caolan, Eike, Gabriel, Hossein, Michael W, Michael S, Stephan, 
Xisco, Miklos, Cloph, Kendy

* Completed Action Items:
+ Create https://wiki.documentfoundation.org/ReleasePlan/7.3 (Cloph)

* Pending Action Items:
+ None

* Release Engineering update (Cloph)
+ 7.2 status: 7.2.3 rc1 in 2 weeks
+ 7.1 status: 7.1.7 rc2 next week
+ 7.3 alpha1: next week, rc1 around Christmas
+ Remotes: Android (has new translations, though), iOS
+ Android viewer

* Documentation (Olivier)
  + Missing Olivier

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
256(256) (topicUI) bugs open, 155(155) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  4(-7) 15(-5) 35(-8)  90(-5)
 commented 43(-28)   202(-17)   646(-90)   3216(-58)
   removed  2(2)   2(1)   6(0)   37(1)
  resolved  8(1)  26(1)  87(-3) 468(-3)
+ top 10 contributors:
  Heiko Tietze made 140 changes in 1 month, and 2254 changes in 1 year
  Foote, V Stuart made 56 changes in 1 month, and 587 changes in 1 year
  Telesto made 36 changes in 1 month, and 651 changes in 1 year
  Dieter made 20 changes in 1 month, and 287 changes in 1 year
  Ross Johnson made 17 changes in 1 month, and 25 changes in 1 year
  Kaganski, Mike made 16 changes in 1 month, and 171 changes in 1 year
  Roman Kuznetsov made 14 changes in 1 month, and 222 changes in 1 year
  Xisco Fauli made 14 changes in 1 month, and 181 changes in 1 year
  Ilmari Lauhakangas made 11 changes in 1 month, and 381 changes in 1 
year
  Timur made 9 changes in 1 month, and 124 changes in 1 year

   + Zarro new boogs with needUXEval Oct/15-21
 + discussion is ongoing, though

* Crash Testing (Caolan)
+ 7(+0) import failure, 3(+0) export failures
+ 0 coverity issues (up and down a bit)
+ 4 ossfuzz issues (all timeouts)
 + turning msan into non-experimental, in progress

* Crash Reporting (Xisco)
   + https://crashreport.libreoffice.org/stats/version/7.1.6.2
 + (+86) 1016 930 906 650 210 0
   + https://crashreport.libreoffice.org/stats/version/7.2.1.2
 + (+141) 2068 2209 2042 1450 0
   + https://crashreport.libreoffice.org/stats/version/7.2.2.2
 + (+752) 752 0

   + Fixes in 7.2.2.2
- SvTreeListEntry::NextSibling()
- Thanks to Caolán
  - lcl_appendLineData
- Thanks to Stephan B.
- 
sw::GetZOrderLayer::operator()(com::sun::star::uno::Reference
 const &)
- Thanks to Michael S.
+ which mean half of the crashes

* Mentoring/EasyHack update (Hossein)
  committer...   1 week 1 month 3 months12 months
  open  53(-82)171(6)  223(6)   270(7)
   reviews 382(-54)   1304(64)3632(-80)8276(264)
merged 279(-6)1196(29)3632(-46)9730(275)
 abandoned  11(-4)  40(-1) 177(-5)  499(11)
   own commits 218(-39)987(-6)3034(-43)   12685(30)
review commits  49(-13)247(-20)891(-52)4302(7)
contributor...   1 week 1 month 3 months 12 months
  open  35(-7)  72(9)  135(3)172(12)
   reviews 758(-18)   2864(96)8318(-116)   21524(630)
merged  30(2)  132(8)  344(-1)   882(30)
 abandoned   4(-1)  50(-10)131(1)321(4)
   own commits  14(2)   84(-6) 305(-30) 1956(-2)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)
   total 326(326)   assigned 26(26)   open 273(273)
+ top 10 contributors:
  Johnny_M made 30 patches in 1 month, and 763 patches in 1 year
  Ross Johnson made 18 patches in 1 month, and 24 patches in 1 year
  Kevin Suo made 4 patches in 1 month, and 25 patches in 1 year
  Nagy Tibor made 3 patches in 1 month, and 38 patches in 1 year
  Dániel Arató made 3 patches in 1 month, and 20 patches in 1 year
  Steve Fanning made 2 patches in 1 month, and 60 patches in 1 year
  Tomoyuki Kubota made 2 patches in 1 month, and 7 patches in 1 year
  Aleś Bułojčyk made 2 patches in 1 month, and 2 patches in 1 year
  Natalia Gavrilova made 2 patches in 1 month, and 2 patches in 1 year
  Ismael Luceno made 2 patches in 1 month, and 2 patches in 1 year
+ top 10 reviewers:
  Kaganski, Mike made 140 review comments in 1 month, and 570 in 1 year
  Michael Stahl made 140 review comments in 1 month, and 702 in 1 year
  Castagno, Giuseppe made 98 review comments in 1 month, and 98 in 1 
year
  Adolfo Jayme Barrientos made 80 review comments in 1 month, and 566 
in 1

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/inc sc/source

2021-10-21 Thread Balazs Varga (via logerrit)
 sc/inc/queryentry.hxx   |1 -
 sc/source/core/data/column3.cxx |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 2e4e18b4727c6c299f1bb64f1c3c8948334f4282
Author: Balazs Varga 
AuthorDate: Thu Oct 21 16:15:21 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 16:18:31 2021 +0200

Clean up: tdf#144740 Fix broken compareByValue() query, tdf#142910 
tdf#144253

clean up

Change-Id: I0be022743f6ecc9801b088136ccf3646ddc6556f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123998
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index c107b438a1c2..272111a09354 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -39,7 +39,6 @@ struct SC_DLLPUBLIC ScQueryEntry
 QueryType meType;
 doublemfVal;
 svl::SharedString maString;
-Color maColor;
 bool  mbMatchEmpty;
 bool  mbRoundForFilter;
 
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index fad939b9dcf6..6b40bc95da4b 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2484,7 +2484,7 @@ class FilterEntriesHandler
 // store the formatted/rounded value for filtering
 
 if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
-mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
+mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
mrColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
 else
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, fVal, 
ScTypedStrData::Value, bDate));
 }


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/inc sc/source

2021-10-21 Thread Eike Rathke (via logerrit)
 sc/inc/queryentry.hxx  |9 +-
 sc/source/core/data/column3.cxx|5 -
 sc/source/core/data/table3.cxx |  121 ++---
 sc/source/core/tool/queryentry.cxx |3 
 4 files changed, 96 insertions(+), 42 deletions(-)

New commits:
commit 49a741fb2a5112d8d6b7df87fd807bcd853dcf67
Author: Eike Rathke 
AuthorDate: Tue Sep 28 00:19:47 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 15:57:37 2021 +0200

Resolves: tdf#144740 Fix broken compareByValue() query, tdf#142910 
tdf#144253

Fix regression of a series of commits that, intended for filter
queries, unconditionally round numeric values as shown under
ScTable::ValidQuery() and compareByValue() without having taken
into account that the same query and compare functions are used by
the interpreter for all functions that use query criteria,
possibly delivering completely wrong results including in
backports to 7.2.0.0

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

commit 51375b48378915b6e95c1ac26b2ccf8e39880f7e
CommitDate: Tue Sep 21 11:06:35 2021 +0200

tdf#144253 tdf#144324 sc filter: use formatted values in filters

Several related and intertwined commits in filter context make
assumptions about these queries always being executed rounded, so
the only clean solution is to make that depend on the
ScQueryEntry::Item being passed. Its mbRoundForFilter value is set
to true for all items of all queries executed via ScTable::Query()
and ScTable::GetFilteredFilterEntries(). It might be not all are
necessary (or some even still harmful?) and unnecessarily
obtaining number formats and calling RoundValueAsShown() is still
a bottle neck for those, but that should be addressed and reworked
independently. The important part is calculations work as before.

Also, moved obtaining number formats for calling RoundValueAsShown()
into logic that calls them only if necessary.

Note the TODO in compareByValue() about suspicious rounding of
rItem.mfVal in filter context that is to be addressed.

Change-Id: Ieb178ad1ea15a635caeb1ba698c2f4b7ad676d57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122729
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123996
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index 9e219dfe2216..c107b438a1c2 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -36,13 +36,14 @@ struct SC_DLLPUBLIC ScQueryEntry
 
 struct SAL_DLLPRIVATE Item
 {
-QueryType meType;
-doublemfVal;
+QueryType meType;
+doublemfVal;
 svl::SharedString maString;
+Color maColor;
 bool  mbMatchEmpty;
-bool  mbFormattedValue;
+bool  mbRoundForFilter;
 
-Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false) {}
+Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false), 
mbRoundForFilter(false) {}
 
 bool operator== (const Item& r) const;
 };
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 092c2ffee7b3..fad939b9dcf6 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2482,8 +2482,9 @@ class FilterEntriesHandler
 pFormatter->GetInputLineString(fVal, nIndex, aStr);
 }
 // store the formatted/rounded value for filtering
-if (nFormat && !bDate)
-mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
mrColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
+
+if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
+mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
 else
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, fVal, 
ScTypedStrData::Value, bDate));
 }
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 5a63055016df..3316dae944da 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2328,6 +2328,17 @@ public:
 return mrTab.HasStringData(nCol, nRow);
 }
 
+sal_uInt32 getNumFmt( SCCOL nCol, SCROW nRow, const ScInterpreterContext* 
pContext )
+{
+sal_uInt32 nNumFmt = (pContext ?
+mrTab.GetNumberFormat(*pContext, ScAddress(nCol, nRow, 
mrTab.GetTab())) :
+mrTab.GetNumberFormat(nCol, nRow));
+if (nNumFmt && (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+// Any General of any locale

EasyHack Suggestion: Use range based for loops

2021-10-21 Thread Hossein Nourikhah

Hello,

This is a suggestion for adding an EasyHack with the difficulty 
"Beginner". I have asked one of the newbies to do a submission regarding 
this. Please tell me your opinion. I welcome any suggestions.


Regards,
Hossein


**Use range based for loops**

Since C++11, range based loops are available for iterating over a known 
range of values. For example, when there is a need to process elements 
of a container, range based loops are usually a good choice. They are 
easy to write, read and understand.


The simplest form is as below:

for(auto variable : range)
statement;

In this way, a temporary variable is created to iterate over the range 
of values. But this is usually undesirable because the variable is 
copied.


When a change in the values of the elements is needed, a reference is 
used:


for(auto &variable : range)
statement;

It is possible to use the reference, but use const to prevent 
modification. This is useful for working on big elements.


for(const auto &variable : range)
statement;

Range based loops can simplify the code, but there are limitations for 
them. For example, if there is a need not to iterate over certain 
values, std::ranges::views::drop (C++20) should be used, so they are not 
suitable for replacing every normal for loop.


This is an example:
123758: Use range based for loops | 
https://gerrit.libreoffice.org/c/core/+/123758


This is changed:

for(size_t a(0); a < aMatrices.size(); a++)
{
rContainer.push_back(new TransformPrimitive2D(
getTransformation() * aMatrices[a],
Primitive2DContainer(xSeq)));
}

into this:

for(const auto &a : aMatrices)
{
rContainer.push_back(new TransformPrimitive2D(
getTransformation() * a, Primitive2DContainer(xSeq)));
}

References:
+ Range-based for loop
https://en.cppreference.com/w/cpp/language/range-for
+Range-based for Statement (C++)
https://docs.microsoft.com/en-us/cpp/cpp/range-based-for-statement-cpp


--
Hossein Nourikhah, Ph.D.
Developer Community Architect
The Document Foundation (TDF)
Email: hoss...@libreoffice.org
Wiki:  https://wiki.documentfoundation.org/User:Hossein
IRC:   hossein at libreoffice-dev room in LiberaChat Network
   irc://irc.libera.chat/#libreoffice-dev


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

2021-10-21 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 66b0a84eae89c7fe02a4cdc4d314f4203025774e
Author: Miklos Vajna 
AuthorDate: Thu Oct 21 08:25:55 2021 +0200
Commit: Mike Kaganski 
CommitDate: Thu Oct 21 15:28:48 2021 +0200

sw: fix crash in SwXTextDocument::postMouseEvent()

From crashreport:

SIG   Fatal signal received: SIGSEGV

SwXTextDocument::postMouseEvent(int, int, int, int, int, int)
sw/source/uibase/uno/unotxdoc.cxx:3559
doc_postMouseEvent
desktop/source/lib/init.cxx:4245

Make sure we don't crash when a mouse event is posted on a disposed
document.

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

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 0a5fec9a18d5..bec5f57762eb 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3556,6 +3556,11 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, 
int nY, int nCount, int
 SolarMutexGuard aGuard;
 
 SwViewShell* pWrtViewShell = pDocShell->GetWrtShell();
+if (!pWrtViewShell)
+{
+return;
+}
+
 SwViewOption aOption(*(pWrtViewShell->GetViewOptions()));
 double fScale = aOption.GetZoom() / (TWIPS_PER_PIXEL * 100.0);
 


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

2021-10-21 Thread Noel Grandin (via logerrit)
 sw/inc/IDocumentFieldsAccess.hxx|5 
 sw/inc/SwUndoField.hxx  |2 
 sw/inc/ToxTabStopTokenHandler.hxx   |5 
 sw/inc/crsrsh.hxx   |2 
 sw/inc/ddefld.hxx   |4 
 sw/inc/doc.hxx  |8 
 sw/inc/edglbldc.hxx |6 
 sw/inc/edimp.hxx|4 
 sw/inc/editsh.hxx   |2 
 sw/inc/fldbas.hxx   |3 
 sw/inc/fmtfld.hxx   |5 
 sw/inc/ndarr.hxx|   21 -
 sw/inc/ndindex.hxx  |   96 +++--
 sw/inc/ndtxt.hxx|2 
 sw/inc/node.hxx |   23 -
 sw/inc/nodeoffset.hxx   |   39 ++
 sw/inc/pam.hxx  |5 
 sw/inc/postithelper.hxx |3 
 sw/inc/redline.hxx  |2 
 sw/inc/shellio.hxx  |2 
 sw/inc/swbaslnk.hxx |2 
 sw/inc/swcrsr.hxx   |6 
 sw/inc/swtable.hxx  |9 
 sw/inc/undobj.hxx   |   37 +-
 sw/qa/core/frmedt/frmedt.cxx|4 
 sw/qa/core/uwriter.cxx  |2 
 sw/qa/extras/globalfilter/globalfilter.cxx  |   12 
 sw/qa/extras/htmlimport/htmlimport.cxx  |2 
 sw/qa/extras/indexing/SearchResultLocatorTest.cxx   |4 
 sw/qa/extras/layout/layout.cxx  |4 
 sw/qa/extras/mailmerge/mailmerge.cxx|   34 +-
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |6 
 sw/qa/extras/rtfexport/rtfexport4.cxx   |6 
 sw/qa/extras/tiledrendering/tiledrendering.cxx  |4 
 sw/qa/extras/uiwriter/uiwriter.cxx  |   26 -
 sw/qa/extras/uiwriter/uiwriter2.cxx |   14 
 sw/qa/extras/uiwriter/uiwriter4.cxx |   89 ++---
 sw/qa/extras/ww8export/ww8export.cxx|2 
 sw/qa/extras/ww8import/ww8import.cxx|4 
 sw/source/core/access/AccessibilityCheck.cxx|2 
 sw/source/core/access/accframebase.cxx  |6 
 sw/source/core/access/accmap.cxx|   10 
 sw/source/core/access/accpara.cxx   |   24 -
 sw/source/core/attr/hints.cxx   |2 
 sw/source/core/bastyp/index.cxx |5 
 sw/source/core/crsr/bookmark.cxx|   12 
 sw/source/core/crsr/callnk.cxx  |4 
 sw/source/core/crsr/callnk.hxx  |3 
 sw/source/core/crsr/crsrsh.cxx  |   10 
 sw/source/core/crsr/crstrvl.cxx |   12 
 sw/source/core/crsr/findtxt.cxx |4 
 sw/source/core/crsr/pam.cxx |   28 -
 sw/source/core/crsr/swcrsr.cxx  |   34 +-
 sw/source/core/crsr/trvlfnfl.cxx|   12 
 sw/source/core/crsr/trvlreg.cxx |8 
 sw/source/core/crsr/trvltbl.cxx |   14 
 sw/source/core/doc/CntntIdxStore.cxx|   34 +-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |  134 
 sw/source/core/doc/DocumentFieldsManager.cxx|   10 
 sw/source/core/doc/DocumentLayoutManager.cxx|   10 
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx   |   10 
 sw/source/core/doc/DocumentOutlineNodesManager.cxx  |2 
 sw/source/core/doc/DocumentRedlineManager.cxx   |   20 -
 sw/source/core/doc/DocumentStatisticsManager.cxx|2 
 sw/source/core/doc/dbgoutsw.cxx |6 
 sw/source/core/doc/doc.cxx  |   24 -
 sw/source/core/doc/docbm.cxx|   12 
 sw/source/core/doc/doccomp.cxx  |   36 +-
 sw/source/core/doc/docdesc.cxx  |6 
 sw/source/core/doc/docedt.cxx   |   12 
 sw/source/core/doc/docfld.cxx   |   10 
 sw/source/core/doc/docfly.cxx   | 

[Libreoffice-commits] core.git: jvmfwk/distributions jvmfwk/Package_rcfiles.mk jvmfwk/source

2021-10-21 Thread Stephan Bergmann (via logerrit)
 jvmfwk/Package_rcfiles.mk |4 +++
 jvmfwk/distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml |   11 
++
 jvmfwk/source/fwkbase.cxx |9 
+++-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 81debfba86b1d67d1c2e0ecd9c10ca35c3e7de5e
Author: Stephan Bergmann 
AuthorDate: Thu Oct 21 13:06:25 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 21 15:13:42 2021 +0200

Restrict macOS ARM64 to Java >= 17

The commit message of e529461bcb126e0975ffa3f86e1fd5a630551de2 "Enable JVM 
also
on macOS ARM64" had identified


"to work reliably now" while other (older Zulu) JVMs "have always crashed 
with
SIGBUS that smelled like our uses of pthread_jit_write_protect_np in
bridges/source/cpp_uno/shared/vtablefactory.cxx colided with corresponding 
calls
in the in-process JVM".  Those observations would be in line with
 "JEP 391: macOS/AArch64 Port" only
implemented for Java 17 now (see


"8253795: Implementation of JEP 391: macOS/AArch64 Port").

So for macOS ARM64 assume that all OpenJDK variants (i.e., providing an 
empty
jvmfwk/distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml) of at 
least
Java 17 (i.e., building on recent 3460c16d7f749d8d2a59d8b927df5ec31f64a083
"Make getVersionInformation always return a VersionInfo" and "change the
hardcoded '1.8.0' to '17' for just that one platform") work.

Change-Id: I11e8ba232cee066a25a49edebd0cc50e24e84124
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123989
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/Package_rcfiles.mk b/jvmfwk/Package_rcfiles.mk
index 7864d628b276..e7010b970da5 100644
--- a/jvmfwk/Package_rcfiles.mk
+++ b/jvmfwk/Package_rcfiles.mk
@@ -14,7 +14,11 @@ $(eval $(call 
gb_Package_add_file,jvmfwk_javavendors,$(LIBO_URE_MISC_FOLDER)/jav
 else ifeq ($(OS),FREEBSD)
 $(eval $(call 
gb_Package_add_file,jvmfwk_javavendors,$(LIBO_URE_MISC_FOLDER)/javavendors.xml,distributions/OpenOfficeorg/javavendors_freebsd.xml))
 else ifeq ($(OS),MACOSX)
+ifeq ($(CPUNAME),AARCH64)
+$(eval $(call 
gb_Package_add_file,jvmfwk_javavendors,$(LIBO_URE_MISC_FOLDER)/javavendors.xml,distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml))
+else
 $(eval $(call 
gb_Package_add_file,jvmfwk_javavendors,$(LIBO_URE_MISC_FOLDER)/javavendors.xml,distributions/OpenOfficeorg/javavendors_macosx.xml))
+endif
 else ifeq ($(OS),LINUX)
 $(eval $(call 
gb_Package_add_file,jvmfwk_javavendors,$(LIBO_URE_MISC_FOLDER)/javavendors.xml,distributions/OpenOfficeorg/javavendors_linux.xml))
 else ifeq ($(OS),AIX)
diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml 
b/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml
new file mode 100644
index ..329030ccb1c0
--- /dev/null
+++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_macosx_aarch64.xml
@@ -0,0 +1,11 @@
+
+
+http://openoffice.org/2004/java/framework/1.0";>
+  2021-10-19
+
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index 8de3f0c4d00c..fc2223fd842e 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -131,7 +131,14 @@ VersionInfo 
VendorSettings::getVersionInformation(std::u16string_view sVendor) c
 m_xmlPathContextVendorSettings);
 if (xmlXPathNodeSetIsEmpty(pathObject->nodesetval))
 {
-return {{}, "1.8.0", ""};
+return {
+{},
+#if defined MACOSX && defined __aarch64__
+"17",
+#else
+"1.8.0",
+#endif
+""};
 }
 
 VersionInfo aVersionInfo;


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   45 
 sw/source/core/doc/tblrwcl.cxx  |   23 --
 2 files changed, 65 insertions(+), 3 deletions(-)

New commits:
commit 9b762a82ffb09c55a00343d1202c64f35f17f147
Author: László Németh 
AuthorDate: Wed Sep 22 16:26:18 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 15:11:08 2021 +0200

tdf#143358 sw: track insertion of empty table rows

Insertion of empty table rows wasn't tracked, and
inserting also text in the new rows and rejecting
everything didn't reject the row insertion.

Follow-up to commit 99059a1ececa3621c2fe46fabdd79eed9d626c42
"tdf#143359 sw: track deletion of empty table rows".

Note: as a workaround for tracking of the empty rows,
i.e. rows without text content, add a redline with
invisible text CH_TXT_TRACKED_DUMMY_CHAR in the first
cell of the empty row.

See also commit a483a44ca00f43a64ae51d62b8fbb4129a413f6d
"tdf#143215 DOCX import: fix tracked empty row insertion/deletion",
commit b50d386dfa70f7c1d4eb1a49091ec9dd782b767b
"tdf#142701 track changes: fix layout regression of image deletion"
and commit 05366b8e6683363688de8708a3d88cf144c7a2bf
"tdf#60382 sw offapi: add change tracking of table/row deletion".

Change-Id: I237d566a468f61f31fa19dd1d6d9bb559be99158
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122460
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit dbc82c02eb24ec1c97c6ee32069771d8deb394f9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123985
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 2a0d66bab23e..daef23db226d 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -4016,6 +4016,51 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testRedlineTableRowDeletionWithReject)
 assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineTableRowInsertionWithReject)
+{
+// load a 1-row table, and insert a row with enabled change tracking
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118311.fodt");
+
+// turn on red-lining and show changes
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// check table and its single row
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+
+// insert rows before and after with enabled change tracking
+// (HasTextChangesOnly property of the row will be false, and
+// add dummy characters CH_TXT_TRACKED_DUMMY_CHAR)
+dispatchCommand(mxComponent, ".uno:InsertRowsBefore", {});
+dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
+
+SwEditShell* const pEditShell(pDoc->GetEditShell());
+// This was 0 (not tracked row insertion)
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
pEditShell->GetRedlineCount());
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 3);
+
+// reject redlines
+pEditShell->RejectRedline(0);
+pEditShell->RejectRedline(0);
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+// This was 3 (not rejected row insertion)
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf128603)
 {
 // Load the bugdoc, which has 3 textboxes.
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 76474bba91b6..e6c97a71139a 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -242,7 +242,7 @@ struct CpyPara
 
 }
 
-static void lcl_CopyRow(FndLine_ & rFndLine, CpyPara *const pCpyPara);
+static SwTableLine* lcl_CopyRow(FndLine_ & rFndLine, CpyPara *const pCpyPara);
 
 static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
 {
@@ -377,7 +377,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const 
pCpyPara)
 }
 }
 
-static void lcl_CopyRow(FndLine_& rFndLine, CpyPara *const pCpyPara)
+static SwTableLine* lcl_CopyRow(FndLine_& rFndLine, CpyPara *const pCpyPara)
 {
 SwTableLine* pNewLine = new SwTableLine(
 
static_cast(rFndLine.GetLine()->GetFrameFormat()),
@@ -400,6 +400,8 @@ static 

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/inc sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/inc/doc.hxx|3 -
 sw/qa/extras/layout/layout.cxx|   56 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |   23 ++
 sw/source/core/docnode/ndtbl1.cxx |   11 -
 4 files changed, 90 insertions(+), 3 deletions(-)

New commits:
commit 0d9b0bf2999f32590a0e726775ee959bf9a8ec36
Author: László Németh 
AuthorDate: Mon Sep 20 13:11:24 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 15:09:40 2021 +0200

tdf#144347 sw: fix tracked deletion of table with tracked content

When a table contained tracked content already, its tracked
deletion (or cut) didn't work correctly, if the deletion
contained also the text before or after the table: accepting
the deletion left an empty table in the text, also Hide Changes
showed an empty table before that in the place of the deleted
text.

Follow-up of commit f481c2c8e74bded11fac754e493560391229dbcd
"df#144057 sw track changes: hide deleted table rows".

Change-Id: If3294fe0316df7c065e7ff63290c1723386ec7ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122382
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123994
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index fed4d61f8cb9..53eb82f739c3 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1486,7 +1486,8 @@ public:
 void SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew );
 static bool GetRowBackground( const SwCursor& rCursor, 
std::unique_ptr& rToFill );
 /// rNotTracked = false means that the row was deleted or inserted with 
its tracked cell content
-void SetRowNotTracked( const SwCursor& rCursor, const SvxPrintItem 
&rNotTracked );
+/// bAll: delete all table rows without selection
+void SetRowNotTracked( const SwCursor& rCursor, const SvxPrintItem 
&rNotTracked, bool bAll = false );
 void SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet );
 void SetTabLineStyle( const SwCursor& rCursor,
   const Color* pColor, bool bSetLine,
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 3d4809dd6dcc..899bd15dfa79 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -42,6 +42,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -2345,6 +2347,60 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
 assertXPath(pXmlDoc, "/root/page[4]/body/tab/row[6]/cell/txt/Text", 
"Portion", "B12");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
+{
+createSwDoc(DATA_DIRECTORY, "tdf144057.fodt");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+SwDoc* pDoc(pTextDoc->GetDocShell()->GetDoc());
+SwRootFrame* pLayout(pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
+
+// enable redlining
+dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
+
+// remove first table
+SwEditShell* const pEditShell(pDoc->GetEditShell());
+for (int i = 0; i < 12; ++i)
+pEditShell->AcceptRedline(0);
+
+pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
+discardDumpedLayout();
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// show tracked row deletions
+assertXPath(pXmlDoc, "/root/page", 2);
+assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
+
+// select all the text, including the texts before and after the table
+// Note: this table contains tracked changes, which was a
+// problem for the original OOo implementation of track changes,
+// resulting empty tables after accepting the deletion of these tables.
+dispatchCommand(mxComponent, ".uno:SelectAll", {});
+dispatchCommand(mxComponent, ".uno:SelectAll", {});
+dispatchCommand(mxComponent, ".uno:Delete", {});
+pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+
+// table is deleted with change tracking: it still exists
+assertXPath(pXmlDoc, "/root/page", 2);
+assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
+
+// accept all deletions, removing the table completely
+while (pEditShell->GetRedlineCount() > 0)
+pEditShell->AcceptRedline(0);
+
+pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+
+assertXPath(pXmlDoc, "/root/page", 1);
+// This was 1 (bad empty table)
+assertXPath(pXmlDoc, "/root/page[1]/body/tab", 0);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 sof

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - include/svx svx/source

2021-10-21 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdedxv.hxx   |   54 +++--
 svx/source/svdraw/svdedxv.cxx |  418 +-
 svx/source/svdraw/svdview.cxx |   22 +-
 3 files changed, 258 insertions(+), 236 deletions(-)

New commits:
commit e467baad666142efa251da814f5223b9d7898d76
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 28 19:12:40 2021 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Oct 21 15:08:23 2021 +0200

svx: add "m" prefix to some member variables in SdrObjEditView

Change-Id: I2877f63d97ff6d15f08bd2dbaee6128b8a689cc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123219
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 93115d2c54d645bcf2f80fde325e3ede39dee4d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123950
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index b8dac5397098..8befc36dfb7c 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -74,16 +74,16 @@ class SVXCORE_DLLPUBLIC SdrObjEditView : public 
SdrGlueEditView, public EditView
 
 // The OverlayObjects used for visualizing active TextEdit (currently
 // using TextEditOverlayObject, but not limited to it
-sdr::overlay::OverlayObjectList   maTEOverlayGroup;
+sdr::overlay::OverlayObjectList maTEOverlayGroup;
 
 protected:
 // TextEdit
-tools::WeakReference
-mxTextEditObj; // current object in 
TextEdit
-SdrPageView*pTextEditPV;
-std::unique_ptr pTextEditOutliner; // outliner for the 
TextEdit
-OutlinerView*   pTextEditOutlinerView; // current view of the 
outliners
-VclPtr pTextEditWin;  // matching window to 
pTextEditOutlinerView
+tools::WeakReference mxTextEditObj; // current object in 
TextEdit
+SdrPageView* mpTextEditPV;
+std::unique_ptr mpTextEditOutliner; // outliner for the 
TextEdit
+OutlinerView* mpTextEditOutlinerView; // current view of the outliners
+VclPtr mpTextEditWin; // matching window to 
pTextEditOutlinerView
+
 vcl::Cursor*pTextEditCursorBuffer; // to restore the 
cursor in each window
 SdrObject*  pMacroObj;
 SdrPageView*pMacroPV;
@@ -96,11 +96,11 @@ protected:
 
 sal_uInt16  nMacroTol;
 
-boolbTextEditDontDelete : 1;   // do not delete 
outliner and view of SdrEndTextEdit (f. spellchecking)
-boolbTextEditOnlyOneView : 1;  // a single 
OutlinerView (f. spellchecking)
-boolbTextEditNewObj : 1;   // current edited 
object was just recreated
-boolbQuickTextEditMode : 1;// 
persistent(->CrtV). Default=TRUE
-boolbMacroDown : 1;
+bool mbTextEditDontDelete : 1;  // do not delete outliner and view of 
SdrEndTextEdit (f. spellchecking)
+bool mbTextEditOnlyOneView : 1; // a single OutlinerView (f. spellchecking)
+bool mbTextEditNewObj : 1;  // current edited object was just recreated
+bool mbQuickTextEditMode : 1;   // persistent(->CrtV). Default=TRUE
+bool mbMacroDown : 1;
 
 rtl::Reference< sdr::SelectionController > mxSelectionController;
 rtl::Reference< sdr::SelectionController > mxLastSelectionController;
@@ -182,8 +182,14 @@ public:
 // TextEdit over an outliner
 
 // QuickTextEditMode = edit the text straight after selection. 
Default=TRUE. Persistent.
-void SetQuickTextEditMode(bool bOn) { bQuickTextEditMode=bOn; }
-bool IsQuickTextEditMode() const { return bQuickTextEditMode; }
+void SetQuickTextEditMode(bool bOn)
+{
+mbQuickTextEditMode = bOn;
+}
+bool IsQuickTextEditMode() const
+{
+return mbQuickTextEditMode;
+}
 
 // Start the TextEditMode. If pWin==NULL, use the first window, which is 
logged at the View.
 // The cursor of the currently edited window is stored with 
SdrBeginTextEdit()
@@ -231,10 +237,22 @@ public:
 
 // Now at this outliner, events can be send, attributes can be set,
 // call Cut/Copy/Paste, call Undo/Redo, and so on...
-const SdrOutliner* GetTextEditOutliner() const { return 
pTextEditOutliner.get(); }
-SdrOutliner* GetTextEditOutliner() { return pTextEditOutliner.get(); }
-const OutlinerView* GetTextEditOutlinerView() const { return 
pTextEditOutlinerView; }
-OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; }
+const SdrOutliner* GetTextEditOutliner() const
+{
+return mpTextEditOutliner.get();
+}
+SdrOutliner* GetTextEditOutliner()
+{
+return mpTextEditOutliner.get();
+}
+const OutlinerView* GetTextEditOutlinerView() const
+{
+return mpTextEditOutlinerView;
+}
+OutlinerView* GetTextEditOutlinerView()
+{
+return mpTextEditOutlinerView;
+}
 
 vir

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - 2 commits - RepositoryExternal.mk xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_

2021-10-21 Thread Michael Stahl (via logerrit)
 RepositoryExternal.mk |   26 ++
 dev/null  |binary
 xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk |8 ++
 xmlsecurity/CppunitTest_xmlsecurity_signing.mk|8 ++
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   23 ---
 xmlsecurity/qa/unit/signing/data/cert9.db |binary
 xmlsecurity/qa/unit/signing/data/key4.db  |binary
 xmlsecurity/qa/unit/signing/data/pkcs11.txt   |5 
 xmlsecurity/qa/unit/signing/signing.cxx   |   18 ---
 9 files changed, 82 insertions(+), 6 deletions(-)

New commits:
commit 9de1a497bfb0ac1c759a9e8e2eed65998fef7860
Author: Michael Stahl 
AuthorDate: Fri Oct 15 20:52:47 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 15:04:32 2021 +0200

xmlsecurity: fix test failing because NSS policy forbids SHA1

With Fedora's nss-3.71.0-1.fc34.x86_64 there is the problem that
8 tests including testODFGood in CppunitTest/xmlsecurity_signing
fail because the crypto policy disallows SHA1 for signatures.

Apparently this particular policy bit was added in NSS 3.59:
https://bugzilla.mozilla.org/show_bug.cgi?id=1670835

For signatures, maybe it's not a good idea to override system policy
for product builds, so do it locally in the tests, at least for now.

If similar problems turn up for encrypted documents in the future,
that should be fixed in product builds too of course, as encrypted
documents must always be decryptable.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123768
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 51e82016e8783a452fe5f7921d12c1bf20bfd6b5)

xmlsecurity: fix --without-system-nss usage of NSS_SetAlgorithmPolicy

The problem with commit ff572d9222ec16ffd679ae907a0bf4a8900265e1
is that it's using the wrong library; NSS_SetAlgorithmPolicy is actually
in libnssutil3.so.

This causes a linking problem when upgrading the internal NSS to a
version that has NSS_USE_ALG_IN_ANY_SIGNATURE.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123819
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 395c0c0bbaceadf909e0189af99c6358487c7978)

Change-Id: I4f634cf5da1707fb628e63cd0cdafebdf4fc903f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123841
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index a892a59452e3..0b935279e712 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3454,6 +3454,11 @@ $(call gb_LinkTarget_add_libs,$(1),\
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget__use_nss3,$(1))
+
+endef
+
 define gb_LinkTarget__use_plc4
 $(call gb_LinkTarget__use_nss3,$(1))
 
@@ -3523,6 +3528,27 @@ endif
 
 endef
 
+define gb_LinkTarget__use_nssutil3
+$(call gb_LinkTarget_use_package,$(1),nss)
+$(call gb_LinkTarget_set_include,$(1),\
+   $$(INCLUDE) \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss \
+   -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include \
+)
+
+ifeq ($(COM),MSC)
+$(call gb_LinkTarget_add_libs,$(1),\
+   $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/nssutil3.lib \
+)
+else
+$(call gb_LinkTarget_add_libs,$(1),\
+   -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \
+   -lnssutil3 \
+)
+endif
+
+endef
+
 define gb_ExternalProject__use_nss3
 $(call gb_ExternalProject_use_package,$(1),nss)
 
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
index 021ab8dbe99f..083edf36dbe7 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
 boost_headers \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_pdfsigning,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk 
b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
index 60a21f3944e1..4b3c4787ea73 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
@@ -34,6 +34,14 @@ $(eval $(call 
gb_CppunitTest_use_externals,xmlsecurity_signing,\
 libxml2 \
 ))
 
+ifneq ($(OS),WNT)
+ifneq (,$(ENABLE_NSS))
+$(eval $(call gb_CppunitTest_use_externals,xmlsecurity_signing,\
+nssutil3 \
+))
+endif
+endif
+
 $(eval $(call gb_CppunitTest_set_include,xmlsecurity_signing,\
-I$(SRCDIR)/xmlsecurity/inc \
$$(INCLUDE) \
diff --git a/xmlsecurity/qa/unit/pd

[Libreoffice-commits] core.git: cui/source extensions/source framework/source i18npool/source oox/source salhelper/source sc/source sd/source sfx2/source starmath/source svx/source sw/source unoidl/so

2021-10-21 Thread Noel Grandin (via logerrit)
 cui/source/options/dbregister.cxx   |   26 
 extensions/source/bibliography/general.cxx  |   23 
 framework/source/uielement/toolbarmanager.cxx   |   60 -
 i18npool/source/calendar/calendar_gregorian.cxx |   23 
 oox/source/export/drawingml.cxx |   36 
 oox/source/vml/vmlshapecontext.cxx  |   74 -
 salhelper/source/timer.cxx  |   36 
 sc/source/core/data/column2.cxx |   28 
 sc/source/filter/oox/autofilterbuffer.cxx   |   42 
 sc/source/ui/app/inputhdl.cxx   |   50 
 sc/source/ui/app/inputwin.cxx   |   32 
 sc/source/ui/dbgui/filtdlg.cxx  |   26 
 sc/source/ui/view/gridwin.cxx   |   30 
 sc/source/ui/view/gridwin4.cxx  |   74 -
 sc/source/ui/view/output2.cxx   |   52 
 sc/source/ui/view/viewdata.cxx  |   30 
 sd/source/filter/eppt/pptx-epptooxml.cxx|  182 +--
 sd/source/ui/unoidl/UnoDocumentSettings.cxx |5 
 sfx2/source/appl/workwin.cxx|   36 
 sfx2/source/commandpopup/CommandPopup.cxx   |   46 
 sfx2/source/dialog/StyleList.cxx|  130 +-
 sfx2/source/doc/templatedlg.cxx |   68 -
 sfx2/source/view/ipclient.cxx   |   24 
 sfx2/source/view/viewfrm.cxx|   27 
 starmath/source/mathml/import.cxx   |   30 
 svx/source/sdr/properties/defaultproperties.cxx |   48 
 svx/source/unodraw/SvxXTextColumns.cxx  |   38 
 sw/source/core/crsr/swcrsr.cxx  |   62 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   74 -
 sw/source/core/doc/DocumentRedlineManager.cxx   |   48 
 sw/source/core/doc/docnum.cxx   |   52 
 sw/source/core/doc/textboxhelper.cxx|   20 
 sw/source/core/layout/atrfrm.cxx|   30 
 sw/source/core/text/porlay.cxx  |   98 -
 sw/source/core/text/porrst.cxx  |   42 
 sw/source/core/txtnode/atrfld.cxx   |   46 
 sw/source/core/unocore/unoframe.cxx |5 
 sw/source/filter/html/htmlflywriter.cxx |   52 
 sw/source/filter/indexing/IndexingExport.cxx|   34 
 sw/source/filter/ww8/ww8par3.cxx|   38 
 sw/source/uibase/dbui/mmconfigitem.cxx  |   24 
 sw/source/uibase/docvw/SidebarTxtControl.cxx|   34 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx   |   47 
 sw/source/uibase/utlui/content.cxx  |  136 +-
 sw/source/uibase/utlui/gotodlg.cxx  |   22 
 unoidl/source/unoidl-read.cxx   |  858 
 unotools/source/config/historyoptions.cxx   |   26 
 unotools/source/config/moduleoptions.cxx|   20 
 unotools/source/ucbhelper/tempfile.cxx  |   26 
 vcl/jsdialog/jsdialogbuilder.cxx|   64 -
 vcl/skia/gdiimpl.cxx|   62 -
 vcl/source/app/scheduler.cxx|  164 +--
 vcl/source/bitmap/impvect.cxx   |  116 +-
 vcl/source/control/wizardmachine.cxx|   38 
 vcl/source/filter/ipdf/pdfdocument.cxx  |   28 
 vcl/source/outdev/background.cxx|   48 
 vcl/source/outdev/bitmap.cxx|   30 
 vcl/source/treelist/svimpbox.cxx|   68 -
 vcl/source/window/bubblewindow.cxx  |   26 
 vcl/source/window/layout.cxx|   34 
 vcl/source/window/toolbox2.cxx  |   70 -
 vcl/source/window/window2.cxx   |   38 
 vcl/unx/gtk3/gtkframe.cxx   |  140 +-
 vcl/unx/gtk3/gtkinst.cxx|   94 -
 vcl/unx/gtk3/gtkobject.cxx  |   56 -
 vcl/unx/gtk3/gtksalmenu.cxx |   62 -
 vcl/unx/gtk3/salnativewidgets-gtk.cxx   |   38 
 writerfilter/source/dmapper/GraphicImport.cxx   |   28 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx   |   29 
 xmloff/source/core/xmlexp.cxx   |   48 
 xmloff/source/style/PageMasterImportPropMapper.cxx  |   94 -
 xmloff/source/style/XMLPageExport.cxx   |   34 
 xmloff/source/style/xmlnumfi.cxx|  104 -
 xmloff/source/text/XMLIndexTOCContext.cxx   |   34 
 xmloff/source/text/txtimp.cxx   |  228 ++--
 xmlsecurity/source/helper/ooxmlsecparser.cxx|   40 
 xmlsecur

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/inc sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/inc/swtable.hxx  |   10 
 sw/qa/extras/layout/data/tdf144057.fodt |  387 
 sw/qa/extras/layout/layout.cxx  |   43 +++
 sw/source/core/docnode/ndtbl.cxx|3 
 sw/source/core/layout/frmtool.cxx   |   11 
 sw/source/core/layout/tabfrm.cxx|8 
 sw/source/core/layout/wsfrm.cxx |   30 ++
 sw/source/core/table/swtable.cxx|   90 +++
 8 files changed, 576 insertions(+), 6 deletions(-)

New commits:
commit 09e313704dea1298173c85b692370c4a4911e597
Author: László Németh 
AuthorDate: Mon Sep 13 15:21:14 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 14:51:01 2021 +0200

tdf#144057 sw track changes: hide deleted table rows

and tables in Hide Changes mode. Previously it was
possible to "hide" them only by accepting all the
deletions, because Hide Changes mode hid only the
cell content, but not the deleted rows and tables,
leaving empty rows and tables in the document.

Follow-up of commit 05366b8e6683363688de8708a3d88cf144c7a2bf
"tdf#60382 sw offapi: add change tracking of table/row deletion".

Change-Id: Ib0424f5a17f2213fc7466e966d8ce6812ffde5e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122079
Tested-by: Jenkins
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123993
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 94d33eaa6914..e1c7bdaf6383 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -26,6 +26,7 @@
 #include "calbck.hxx"
 #include "swrect.hxx"
 #include "swtblfmt.hxx"
+#include "docary.hxx"
 
 #include 
 #include 
@@ -345,6 +346,11 @@ public:
 
 bool CanConvertSubtables() const;
 void ConvertSubtables();
+
+// is it a table deleted completely with change tracking
+bool IsDeleted() const;
+// is it a table with deleted row(s)
+bool HasDeletedRow() const;
 };
 
 /// SwTableLine is one table row in the document model.
@@ -390,6 +396,10 @@ public:
 
 // it doesn't contain box content
 bool IsEmpty() const;
+
+// is it a tracked deleted row
+// (search its first redline from rRedlinePos to speed up 
SwTable::IsDeleted())
+bool IsDeleted(SwRedlineTable::size_type& rRedlinePos) const;
 };
 
 /// SwTableBox is one table cell in the document model.
diff --git a/sw/qa/extras/layout/data/tdf144057.fodt 
b/sw/qa/extras/layout/data/tdf144057.fodt
new file mode 100644
index ..66deaa9c27d8
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf144057.fodt
@@ -0,0 +1,387 @@
+
+
+http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:ooow="http://openoffice.org/200
 4/writer" 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:table="urn:oasis:names:tc:open
 document:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
2021-09-13T16:07:05.2216994282021-09-13T16:10:52.148997944PT3M46S3LibreOfficeDev/7.3.0.0.alpha0$Linux_X86_64
 
LibreOffice_project/ba346227f1c4f896b

Minutes from the UX/design meeting 2021-Oct-21

2021-10-21 Thread Heiko Tietze

Present: Heiko
Comments: David, Sascha, Rafael

Tickets/Topics

 * Sentence case not undone when cycling case
   + https://bugs.documentfoundation.org/show_bug.cgi?id=144853
   + a) no sentence case formatting if there is no selection
   + b) select the whole sentence before applying case cycling
   + c) store each case format operation in the undo stack
 + WFM and should be the fact anyway
   + an automatic selection would be contra-productive because is force
 to adapt users to the behavior of the application (Sascha)
   + the ideal behavior would be as OP suggest, only change current word
 if no selection is done (Sascha)
   => cycle the word without selection

 * direct formatting of "character locale" cannot be cleared
   + https://bugs.documentfoundation.org/show_bug.cgi?id=145118
   + have the choice of what is affected by clear DF
 or just purge everything with the alternative command
   + prefer an alternative command to clear all DF as it would be
 an endless subject of discussions of what or what not has
 to be cleared (Sascha)
   + better keep shortcuts simple without adding dialogs (Sascha)
   => w/o a complete list of attributes it makes no sense to
  ponder over a dialog; better hard-clean the formatting

 * Remove option "Word justify" from FontWork toolbar
   + https://bugs.documentfoundation.org/show_bug.cgi?id=145092
   + blocks bug 144190
   => no further opinion, do it
 * _Left Align and _Right Align should be Align _Left and Align _Right
   + https://bugs.documentfoundation.org/show_bug.cgi?id=144190
   => request from l10n, go ahead with renaming

 * Writer Navigator: Add a toggle button to Expand entries / Show only
   top-level items
   + https://bugs.documentfoundation.org/show_bug.cgi?id=144999
   + introduce an action to collapse all? the opposite to expand all
 makes not much sense, so the function would be somehow half-cooked
   + prefer individual persistent toggles per category (David)
   + many other applications do similar and offer expend/collapse all
for long lists (Sascha)
   + collapse on each root node; patch submitted by Jim and
 accepted by OP (Rafael)
   => submit


OpenPGP_signature
Description: OpenPGP digital signature


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - include/formula

2021-10-21 Thread Eike Rathke (via logerrit)
 include/formula/grammar.hxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit aa804a272af40c785bcb0e6739400fed1cb9cdbe
Author: Eike Rathke 
AuthorDate: Mon Jul 26 16:05:22 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 14:30:22 2021 +0200

Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML()

... to prepare detailed compiler scanner handling.

Change-Id: I4a50491b4fa95516773adbd7b86e91ab121b1820
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119517
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 
(cherry picked from commit 3c766512984feff739377d0f0af46558ee7139fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123984
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
index 5d7933dee24a..b5b499d5aab4 100644
--- a/include/formula/grammar.hxx
+++ b/include/formula/grammar.hxx
@@ -209,6 +209,19 @@ public:
 css::sheet::FormulaLanguage::OOXML;
 }
 
+/** If reference convention is OOXML.
+
+Note this is not equivalent to isOOXML() as it does not have to be
+FormulaLanguage::OOXML but can be Grammar::GRAM_EXTERNAL merged with
+AddressConvention::CONV_XL_OOX, which is used by various parts of OOXML
+import through the API FormulaParser.
+ */
+static bool isRefConventionOOXML( const Grammar eGrammar )
+{
+return extractRefConvention( eGrammar) ==
+FormulaGrammar::AddressConvention::CONV_XL_OOX;
+}
+
 /// If grammar has an Excel syntax, determined by address convention.
 static bool isExcelSyntax( const Grammar eGrammar )
 {


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/inc sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/inc/hintids.hxx   |4 
 sw/qa/extras/uiwriter/uiwriter3.cxx  |7 +++
 sw/source/core/docnode/ndtbl1.cxx|   19 +++
 sw/source/core/frmedt/fetab.cxx  |6 +++---
 sw/source/core/unocore/unocrsrhelper.cxx |6 --
 sw/source/uibase/wrtsh/delete.cxx|9 ++---
 6 files changed, 43 insertions(+), 8 deletions(-)

New commits:
commit 8b60bf5c880c5059b9658e06df6f0929c5d58810
Author: László Németh 
AuthorDate: Tue Sep 7 15:57:35 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 14:27:42 2021 +0200

tdf#143359 sw: track deletion of empty table rows

Empty table rows were deleted immediately during
change tracking, or in the case of a deleted table
also with non-empty rows, accepting table deletion
kept empty rows.

Note: as a workaround for tracking of the empty rows,
i.e. rows without text content, add a redline with
invisible text ZWJ in the first cell of the empty row.

See also commit a483a44ca00f43a64ae51d62b8fbb4129a413f6d
"tdf#143215 DOCX import: fix tracked empty row insertion/deletion",
commit b50d386dfa70f7c1d4eb1a49091ec9dd782b767b
"tdf#142701 track changes: fix layout regression of image deletion"
and commit 05366b8e6683363688de8708a3d88cf144c7a2bf
"tdf#60382 sw offapi: add change tracking of table/row deletion".

Note: switch off unnecessary redlining of tdf#132744 unit test
to keep the sake of that test (i.e. cut of the selected table
with empty rows).

Change-Id: Ief59008e8714fb88afdfce867598e3dda21bfba5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121784
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 99059a1ececa3621c2fe46fabdd79eed9d626c42)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123983
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 3971619e27e1..88282fe163c5 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -181,6 +181,10 @@ class SfxVoidItem;
 #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
 #define CH_TXT_ATR_SUBST_FIELDEND ("]")
 
+// a non-visible dummy character to track deleted tables,
+// table rows, and images anchored to characters
+#define CH_TXT_TRACKED_DUMMY_CHAR u'\x200D'
+
 /*
  * Enums for the hints
  */
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 8ecfea76adbf..7e8b004fe43b 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1393,6 +1393,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132744)
 SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pTextDoc);
 
+// disable change tracking to cut the table
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+
+CPPUNIT_ASSERT_MESSAGE("redlining should be off",
+   !pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 
 dispatchCommand(mxComponent, ".uno:SelectAll", {});
diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 228b4cde0267..37b9339cae6c 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -556,7 +558,24 @@ void SwDoc::SetRowNotTracked( const SwCursor& rCursor, 
const SvxPrintItem &rNew
 aFormatCmp.reserve( std::max( 255, static_cast(aRowArr.size()) ) );
 
 for( auto pLn : aRowArr )
+{
 ::lcl_ProcessRowAttr( aFormatCmp, pLn, rNew );
+// as a workaround for the rows without text content,
+// add a redline with invisible text CH_TXT_TRACKED_DUMMY_CHAR
+if (pLn->IsEmpty())
+{
+SwNodeIndex aInsPos( *(pLn->GetTabBoxes()[0]->GetSttNd()), 1 );
+RedlineFlags eOld = getIDocumentRedlineAccess().GetRedlineFlags();
+
getIDocumentRedlineAccess().SetRedlineFlags_intern(RedlineFlags::NONE);
+SwPaM aPaM(aInsPos);
+getIDocumentContentOperations().InsertString( aPaM,
+OUStringChar(CH_TXT_TRACKED_DUMMY_CHAR) );
+aPaM.SetMark();
+aPaM.GetMark()->nContent.Assign(aPaM.GetContentNode(), 0);
+getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
+getIDocumentContentOperations().DeleteAndJoin( aPaM );
+}
+}
 
 getIDocumentState().SetModified();
 }
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index aaa4351b023c..b912789c7dfd 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -332,6 +332,8 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
 // and set IsNoTracke

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/data/tdf144058.fodt |  134 ++
 sw/qa/extras/uiwriter/uiwriter2.cxx   |   36 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |   43 ++--
 3 files changed, 206 insertions(+), 7 deletions(-)

New commits:
commit bca2f9a833be05ec9cb725ad762dd5fb8be8cbdc
Author: László Németh 
AuthorDate: Thu Sep 2 14:21:22 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 14:26:59 2021 +0200

tdf144058 sw track changes: fix table deletion at paragraph join

Tracked paragraph join by table deletion left empty
table in the text after accepting the changes, caused
by the non-continuous redline range over the table,
related to the copying of the formatting of the first
paragraph to the (wholly or partially) removed paragraphs.
Fixed by skipping paragraph format copying in the case
of table paragraphs.

Note: this is not enough for tables with inner redlines,
where tracked paragraph join with deletion of such a table
still leaves an empty table at the place of the table
(a problem inherited from OOo).

Regression from commit 1bbbe57dfc0b43d6b5444798d77dcdf5e4e76e49
"tdf#119571 change tracking: show layout changes at paragraph join".

Change-Id: Ib3ff79c766b5e6faced796b9546d332bab4e0d94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121510
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit f3bec764ddbf3fd3ae986f034c89626bf22940e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123982
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/uiwriter/data/tdf144058.fodt 
b/sw/qa/extras/uiwriter/data/tdf144058.fodt
new file mode 100644
index ..6c311cbbc84f
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf144058.fodt
@@ -0,0 +1,134 @@
+
+http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0" 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+
+   
+   
+   
+  
+  
+   
+  
+ 
+ 
+  
+   Lorem ipsum
+   dolor sit amet, consectetur adipiscing 
elit.
+   
+
+
+
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+
+
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+ 
+  x
+  x
+  x
+ 
+
+   
+   
+
+
+ 
+  x
+  x
+  x
+ 
+
+
+ 
+  x
+  x
+  x
+ 
+
+   
+   Integer sodales tincidunt tristique.
+   Aliquam velit massa, laoreet vel leo nec, 
volutpat facilisis eros.
+   
+  
+ 
+
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 2cc759b8a121..2a0d66bab23e 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1200,6 +1200,42 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571)
  getProperty(getParagraph(2), 
"ParaStyleName"));

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

2021-10-21 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/DocumentRedlineManager.cxx | 1620 +-
 1 file changed, 820 insertions(+), 800 deletions(-)

New commits:
commit e965617c003fba3c4f2b804baa9eb0dce6c3eb0b
Author: Noel Grandin 
AuthorDate: Sun Aug 29 18:41:44 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 14:23:13 2021 +0200

flatten DocumentRedlineManager::AppendRedline a little

Change-Id: I2801aad45f11bd9b8a97fc63c2f005f946a02bf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121233
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123992
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 9982415b4a3e..3010317613bd 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1222,340 +1222,464 @@ Behaviour of Delete-Redline:
 IDocumentRedlineAccess::AppendResult
 DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const 
bCallDelete)
 {
-bool bMerged = false;
 CHECK_REDLINE( *this )
 
-if (IsRedlineOn() && !IsShowOriginal(meRedlineFlags))
+if (!IsRedlineOn() || IsShowOriginal(meRedlineFlags))
 {
-pNewRedl->InvalidateRange(SwRangeRedline::Invalidation::Add);
+if( bCallDelete && RedlineType::Delete == pNewRedl->GetType() )
+{
+RedlineFlags eOld = meRedlineFlags;
+// Set to NONE, so that the Delete::Redo merges the Redline data 
correctly!
+// The ShowMode needs to be retained!
+meRedlineFlags = eOld & ~RedlineFlags(RedlineFlags::On | 
RedlineFlags::Ignore);
+m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pNewRedl );
+meRedlineFlags = eOld;
+}
+delete pNewRedl;
+pNewRedl = nullptr;
+CHECK_REDLINE( *this )
+return AppendResult::IGNORED;
+}
+
+
+bool bMerged = false;
 
-if( m_rDoc.IsAutoFormatRedline() )
+pNewRedl->InvalidateRange(SwRangeRedline::Invalidation::Add);
+
+if( m_rDoc.IsAutoFormatRedline() )
+{
+pNewRedl->SetAutoFormat();
+if( mpAutoFormatRedlnComment && !mpAutoFormatRedlnComment->isEmpty() )
 {
-pNewRedl->SetAutoFormat();
-if( mpAutoFormatRedlnComment && 
!mpAutoFormatRedlnComment->isEmpty() )
-{
-pNewRedl->SetComment( *mpAutoFormatRedlnComment );
-pNewRedl->SetSeqNo( mnAutoFormatRedlnCommentNo );
-}
+pNewRedl->SetComment( *mpAutoFormatRedlnComment );
+pNewRedl->SetSeqNo( mnAutoFormatRedlnCommentNo );
 }
+}
 
-SwPosition* pStt = pNewRedl->Start(),
-  * pEnd = pStt == pNewRedl->GetPoint() ? pNewRedl->GetMark()
-: pNewRedl->GetPoint();
+SwPosition* pStt = pNewRedl->Start(),
+  * pEnd = pStt == pNewRedl->GetPoint() ? pNewRedl->GetMark()
+: pNewRedl->GetPoint();
+{
+SwTextNode* pTextNode = pStt->nNode.GetNode().GetTextNode();
+if( pTextNode == nullptr )
 {
-SwTextNode* pTextNode = pStt->nNode.GetNode().GetTextNode();
-if( pTextNode == nullptr )
+if( pStt->nContent > 0 )
 {
-if( pStt->nContent > 0 )
-{
-OSL_ENSURE( false, "Redline start: non-text-node with 
content" );
-pStt->nContent = 0;
-}
+OSL_ENSURE( false, "Redline start: non-text-node with content" 
);
+pStt->nContent = 0;
 }
-else
+}
+else
+{
+if( pStt->nContent > pTextNode->Len() )
 {
-if( pStt->nContent > pTextNode->Len() )
-{
-OSL_ENSURE( false, "Redline start: index after text" );
-pStt->nContent = pTextNode->Len();
-}
+OSL_ENSURE( false, "Redline start: index after text" );
+pStt->nContent = pTextNode->Len();
 }
-pTextNode = pEnd->nNode.GetNode().GetTextNode();
-if( pTextNode == nullptr )
+}
+pTextNode = pEnd->nNode.GetNode().GetTextNode();
+if( pTextNode == nullptr )
+{
+if( pEnd->nContent > 0 )
 {
-if( pEnd->nContent > 0 )
-{
-OSL_ENSURE( false, "Redline end: non-text-node with 
content" );
-pEnd->nContent = 0;
-}
+OSL_ENSURE( false, "Redline end: non-text-node with content" );
+pEnd->nContent = 0;
 }
-else
+}
+else
+{
+if( pEnd->nContent > pTe

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

2021-10-21 Thread Mark Hung (via logerrit)
 vcl/qa/cppunit/pdfexport/data/tdf144222.ods |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx  |   42 
 vcl/source/gdi/pdfwriter_impl.cxx   |2 -
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit a4244c0f05b95ded277a3a7ed217bf0451daa996
Author: Mark Hung 
AuthorDate: Sat Oct 16 13:55:56 2021 +0800
Commit: Mark Hung 
CommitDate: Thu Oct 21 14:13:30 2021 +0200

tdf#144222 fix pdf export with vertical layout

Remove the offset adjustment that is no longer necessary.
That was done in every backend before, and has been
removed now.  We can trust what layout text provides us.

Regression from:

commit dd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481
Author: Mark Hung 
Date:   Sun May 2 15:12:46 2021 +0800

vcl: adjust LayoutText() for vertical writing.

Change-Id: I077f5a5f0711444086e56e4469dbcb3010ffe661
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123682
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/vcl/qa/cppunit/pdfexport/data/tdf144222.ods 
b/vcl/qa/cppunit/pdfexport/data/tdf144222.ods
new file mode 100644
index ..7b572d301abc
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf144222.ods differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 0da9bedd33ef..ad19395c5669 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2945,6 +2945,48 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageRotate180)
 CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, aScale.getX(), 0.01);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf144222)
+{
+// Assume Windows has the font for U+4E2D
+#ifdef _WIN32
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf144222.ods";
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("calc_pdf_Export");
+auto pPdfDocument = exportAndParse(aURL, aMediaDescriptor);
+
+// The document has one page.
+CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
+std::unique_ptr pPdfPage = 
pPdfDocument->openPage(/*nIndex=*/0);
+CPPUNIT_ASSERT(pPdfPage);
+std::unique_ptr pTextPage = 
pPdfPage->getTextPage();
+CPPUNIT_ASSERT(pTextPage);
+
+int nPageObjectCount = pPdfPage->getObjectCount();
+const OUString sChar = u"\u4E2D";
+basegfx::B2DRectangle aRect1, aRect2;
+int nCount = 0;
+
+for (int i = 0; i < nPageObjectCount; ++i)
+{
+std::unique_ptr pPdfPageObject = 
pPdfPage->getObject(i);
+if (pPdfPageObject->getType() == vcl::pdf::PDFPageObjectType::Text)
+{
+++nCount;
+OUString sText = pPdfPageObject->getText(pTextPage);
+if (sText == sChar)
+aRect1 = pPdfPageObject->getBounds();
+else
+aRect2 = pPdfPageObject->getBounds();
+}
+}
+
+CPPUNIT_ASSERT_EQUAL(2, nCount);
+CPPUNIT_ASSERT(!aRect1.isEmpty());
+CPPUNIT_ASSERT(!aRect2.isEmpty());
+CPPUNIT_ASSERT(!aRect1.overlaps(aRect2));
+#endif
+}
+
 } // end anonymous namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 7718cbd39f9c..b987c948bd6d 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5841,8 +5841,6 @@ void PDFWriterImpl::drawVerticalGlyphs(
 if (rGlyphs[i].m_pGlyph->IsVertical())
 {
 fDeltaAngle = M_PI/2.0;
-aDeltaPos.setX( GetFontMetric().GetAscent() );
-aDeltaPos.setY( 
static_cast(static_cast(GetFontMetric().GetDescent()) * fXScale) );
 fYScale = fXScale;
 fTempXScale = 1.0;
 fSkewA = -fSkewB;


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf126206.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx   |9 ++
 sw/source/filter/ww8/docxattributeoutput.cxx |   35 ++-
 3 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit b82cf004e3ccc41c54d40379009bd4f4f7411c43
Author: László Németh 
AuthorDate: Mon Aug 16 14:42:01 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 13:26:23 2021 +0200

tdf#143911 DOCX: export character formatting changes

of text portions (instead of losing them completely,
resulting missing rejection of tracked formatting changes
later).

Follow-up to commit 0115a77eb84afb0d820d8e23f45e49b30b82a8d3
"tdf#50447 sw: track changes of character formatting" and
commit 5322663f8234836a6a4aaaed025c158fd7e8b67a%5E%21
"tdf#126206 DOCX: add rejection of character formatting changes".

Change-Id: I7f00774875fe06d21865d9468fc1a63bd11d91ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120568
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 15f340f35cd9dc635d0507ca7de9d11227ae9922)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123860
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf126206.docx 
b/sw/qa/extras/ooxmlexport/data/tdf126206.docx
new file mode 100644
index ..166125e7a738
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf126206.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index dadb213a625b..a729642e05b5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1036,6 +1036,15 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf124491, 
"tdf124491.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/*/w:rPrChange", 0);
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143911, "tdf126206.docx")
+{
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// export format change of text portions
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange");
+// This was without tracked bold formatting
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange/w:rPr/w:b");
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105485, "tdf105485.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index be5c99f7f1c3..b8b2e13f3043 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -179,7 +179,7 @@ const sal_Int32 Tag_EndRun_1 = 9;
 const sal_Int32 Tag_EndRun_2 = 10;
 const sal_Int32 Tag_StartRunProperties = 11;
 const sal_Int32 Tag_InitCollectedRunProperties = 12;
-//static const sal_Int32 Tag_Redline_1 = 13;
+const sal_Int32 Tag_Redline_1 = 13;
 const sal_Int32 Tag_Redline_2 = 14;
 const sal_Int32 Tag_TableDefinition = 15;
 const sal_Int32 Tag_OutputFlyFrame = 16;
@@ -2721,6 +2721,11 @@ void DocxAttributeOutput::EndRunProperties( const 
SwRedlineData* pRedlineData )
 {
 // Call the 'Redline' function. This will add redline (change-tracking) 
information that regards to run properties.
 // This includes changes like 'Bold', 'Underline', 'Strikethrough' etc.
+
+// If there is RedlineData present, call WriteCollectedRunProperties() for 
writing rPr before calling Redline().
+// As there will be another rPr for redline and LO might mix both.
+if(pRedlineData)
+WriteCollectedRunProperties();
 Redline( pRedlineData );
 
 WriteCollectedRunProperties();
@@ -3121,6 +3126,34 @@ void DocxAttributeOutput::Redline( const SwRedlineData* 
pRedlineData)
 FSNS( XML_w, XML_author ), rAuthor,
 FSNS( XML_w, XML_date ), aDate );
 
+// Check if there is any extra data stored in the redline object
+if (pRedlineData->GetExtraData())
+{
+const SwRedlineExtraData* pExtraData = 
pRedlineData->GetExtraData();
+const SwRedlineExtraData_FormatColl* pFormattingChanges = 
dynamic_cast(pExtraData);
+
+// Check if the extra data is of type 'formatting changes'
+if (pFormattingChanges)
+{
+ // Get the item set that holds all the changes properties
+const SfxItemSet *pChangesSet = 
pFormattingChanges->GetItemSet();
+if (pChangesSet)
+{
+m_pSerializer->mark(Tag_Redline_1);
+
+m_pSerializer->startElementNS(XML_w, XML_rPr);
+
+// Output the redline item set
+if (pChangesSet)
+m_rExport.OutputItemSet( *pChangesSet, false, true, 
i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF );
+
+m_pSerializer->endElementNS(

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |5 
 sw/source/uibase/wrtsh/delete.cxx   |   37 
 2 files changed, 34 insertions(+), 8 deletions(-)

New commits:
commit 3c2a759b001600529d1fd64c08421b6592f5c905
Author: László Németh 
AuthorDate: Sun Jul 11 13:04:54 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 13:24:52 2021 +0200

tdf#142701 track changes: fix layout regression of image deletion

Commit d6322bcedc197a654abc7d64bfea8cf570f123bf
(tdf#59463 track changes: record deletion of images) converted
image anchors to AS_CHAR, which resulted loss of the original
layout during rejecting the tracked image deletion.

Now keep the original AT_CHAR (also AS_CHAR) anchorings, also convert
the AT_PARA and other anchoring types to AT_CHAR using the following
workaround: add an invisible text-based anchoring point with ZWJs.

Follow-up to commit 8726cf692299ea262a7455adcf6ec25451c7869d
(tdf#142700 DOCX: fix lost track changes of images).

Change-Id: I29d1e161b5f24c0fed51d40c9a8db82085918d0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118747
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit b50d386dfa70f7c1d4eb1a49091ec9dd782b767b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123980
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 9cccb6f0081f..2cc759b8a121 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -3174,6 +3174,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testTrackImageDeletion)
 const SwRedlineTable& rTable = rIDRA.GetRedlineTable();
 // this was 0 (missing recording of deletion of images)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
rTable.size());
+
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+// tdf#142701 this was AS_CHARACTER (convert AT_PARA to AT_CHAR to keep 
the layout)
+CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,
+ getProperty(xShape, 
"AnchorType"));
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTrackImageInsertion)
diff --git a/sw/source/uibase/wrtsh/delete.cxx 
b/sw/source/uibase/wrtsh/delete.cxx
index f9a5772a603a..ab7dd3fe63ba 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 inline void SwWrtShell::OpenMark()
 {
@@ -428,18 +429,20 @@ bool SwWrtShell::DelRight()
 std::unique_ptr pAnchor;
 RndStdIds eAnchorId = RndStdIds::FLY_AT_PARA;
 SwFlyFrame* pFly = GetSelectedFlyFrame();
+SwFrameFormat* pFormat = nullptr;
 if (pFly)
 {
-SwFrameFormat* pFormat = pFly->GetFormat();
+pFormat = pFly->GetFormat();
 if (pFormat)
 {
 eAnchorId = pFormat->GetAnchor().GetAnchorId();
-// as-character anchor conversion at track changes
-if ( IsRedlineOn() && eAnchorId != RndStdIds::FLY_AS_CHAR )
+// to-character anchor conversion at track changes
+if ( IsRedlineOn() && (eAnchorId != RndStdIds::FLY_AS_CHAR 
&&
+   eAnchorId != 
RndStdIds::FLY_AT_CHAR) )
 {
 SfxItemSet aSet(GetAttrPool(), svl::Items{});
 GetFlyFrameAttr(aSet);
-SwFormatAnchor aAnch(RndStdIds::FLY_AS_CHAR);
+SwFormatAnchor aAnch(RndStdIds::FLY_AT_CHAR);
 aSet.Put(aAnch);
 SetFlyFrameAttr(aSet);
 eAnchorId = pFormat->GetAnchor().GetAnchorId();
@@ -455,12 +458,30 @@ bool SwWrtShell::DelRight()
 }
 }
 
-// track changes: delete the anchor point of the image to record 
the deletion
-if ( IsRedlineOn() && pAnchor && SelectionType::Graphic & 
nSelection
-&& eAnchorId == RndStdIds::FLY_AS_CHAR )
+// track changes: create redline at anchor point of the image to 
record the deletion
+if ( IsRedlineOn() && pAnchor && SelectionType::Graphic & 
nSelection && pFormat &&
+( eAnchorId == RndStdIds::FLY_AT_CHAR || eAnchorId == 
RndStdIds::FLY_AS_CHAR ) )
 {
+sal_Int32 nRedlineLength = 1;
+// create a double ZWJ anchor point of the image to record the 
deletion, if needed
+// (otherwise use the existing anchor point of the image 
anchored *as* character)
+if ( eAnchorId == RndStdIds::FLY_AT_CHAR )
+{
+nRedlineLength = 2;
+LeaveSelFrameMode();
+UnSelectFrame();
+  

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa writerfilter/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf142700.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|8 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   66 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |5 +
 4 files changed, 78 insertions(+), 1 deletion(-)

New commits:
commit 621df39a4eb297c09eecf34a51466a99a2810b87
Author: László Németh 
AuthorDate: Wed Jul 7 12:18:42 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 13:20:07 2021 +0200

tdf#142700 DOCX: fix lost track changes of images

anchored to characters or paragraphs.

Tracked deletions and insertions weren't imported,
if they contain only images anchored to character,
resulting loss of the document content: i.e. deleted
images were reappeared, as not deleted images.

Note: because change tracking of the OpenDocument
and Writer supports only text range based changes,
the fix is a workaround using zero width spaces
to create an invisible text around the anchoring point
of the images. This workaround is not used, if it's not
necessary, i.e. if the image is part of a bigger
deletion or insertion, which contains also text, not
only an image.

Change-Id: Iaae6aae2c01191512c71117a0c788a4147c4cae0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118557
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 8726cf692299ea262a7455adcf6ec25451c7869d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118612
(cherry picked from commit 474e16bbb613c2ca61b8d41d1562d9b86f689851)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123979
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf142700.docx 
b/sw/qa/extras/ooxmlexport/data/tdf142700.docx
new file mode 100644
index ..393e2ff4771b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf142700.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index bece2a74e229..dadb213a625b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1415,6 +1415,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128913, 
"tdf128913.docx")
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142700, "tdf142700.docx")
+{
+xmlDocUniquePtr pXmlDoc = parseExport();
+// w:ins and w:del are imported correctly, if they contain only images 
anchored to character
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic");
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:anchor/a:graphic");
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142387, "tdf142387.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b040dbbaa040..59e8782fbc4d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -310,6 +310,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bLineNumberingSet( false ),
 m_bIsInFootnoteProperties( false ),
 m_bIsParaMarkerChange( false ),
+m_bRedlineImageInPreviousRun( false ),
 m_bParaChanged( false ),
 m_bIsFirstParaInSection( true ),
 m_bIsFirstParaInSectionAfterRedline( true ),
@@ -2183,6 +2184,40 @@ void DomainMapper_Impl::appendTextPortion( const 
OUString& rString, const Proper
 rValue.Value <<= false;
 }
 
+// remove workaround for change tracked images, if they are part of a 
redline,
+// i.e. if the next run is a tracked change with the same type, author 
and date,
+// as in the change tracking of the image.
+if ( m_bRedlineImageInPreviousRun )
+{
+auto pCurrentRedline = m_aRedlines.top().size() > 0
+? m_aRedlines.top().back()
+: GetTopContextOfType(CONTEXT_CHARACTER) &&
+
GetTopContextOfType(CONTEXT_CHARACTER)->Redlines().size() > 0
+? 
GetTopContextOfType(CONTEXT_CHARACTER)->Redlines().back()
+: nullptr;
+if ( m_previousRedline && pCurrentRedline &&
+   // same redline
+   (m_previousRedline->m_nToken & 0x) == 
(pCurrentRedline->m_nToken & 0x) &&
+m_previousRedline->m_sAuthor == pCurrentRedline->m_sAuthor 
&&
+m_previousRedline->m_sDate == pCurrentRedline->m_sDate )
+{
+uno::Reference< text::XTextCursor > xCursor = 
xTextAppend->getEnd()->getText( )->createTextCursor( );
+assert(xCursor.is());
+

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/data/tdf142700.fodt |   40 +++
 sw/qa/extras/uiwriter/uiwriter2.cxx   |   44 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |4 ++
 sw/source/core/inc/frame.hxx  |1 
 sw/source/core/layout/paintfrm.cxx|   15 
 5 files changed, 104 insertions(+)

New commits:
commit 7482a31565ab2e25a68de2de85e56f6843c2bc4f
Author: László Németh 
AuthorDate: Mon Jun 28 15:49:37 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 13:17:04 2021 +0200

tdf#142698 sw: fix reject of deleted images anchored to-char

Strikethrough of deleted images wasn't removed by reject
of the tracked deletion, if the image anchored to character
wasn't in same text line as the deleted text.

Follow-up to commit 1610eeef6f2312616fe5d3535475f27f7896bef8
"tdf#142196 sw: crossing out images anchored to character".

Change-Id: I9c7f742942bec90d4c5c65f1bc40a7923353560b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118030
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit ad16387653f8e0d310a5eb44bce9fa8df27253c8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118061
Tested-by: Jenkins
(cherry picked from commit 001acaa0534d586c12da5d9ba7adfcf01a11fcf8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123978
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/data/tdf142700.fodt 
b/sw/qa/extras/uiwriter/data/tdf142700.fodt
new file mode 100644
index ..16064a644f52
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf142700.fodt
@@ -0,0 +1,40 @@
+
+http://openoffice.org/2010/draw"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+
+  
+   
+  
+ 
+ 
+  
+   
+  
+  
+   
+  
+ 
+ 
+  
+ 
+ 
+  
+   
+
+ 
+  
+   X
+   2021-05-07T17:32:23
+  
+ 
+
+   
+   Lorem 
+  
iVBORw0KGgoNSUhEUgEBCAA6fptVAmJLR0QA/4ePzL8JcEhZ
+   cwAACxMAAAsTAQCanBgHdElNRQflBQYKGR4LTuGQCklEQVQI12M4DwAA0QDQfVbA
+   HQBJRU5ErkJggg==
+  
+ 
+ipsum dolor sit amet, consectetuer adipiscing 
elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar 
ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis 
urna.
+  
+ 
+
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 6ed013bd02f4..9cccb6f0081f 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2227,6 +2227,50 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196)
 assertXPath(pXmlDoc2, "//line", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf142700.fodt");
+
+//turn on red-lining and show changes
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// Dump the rendering of the first page as an XML file.
+SwDocShell* pShell = pDoc->GetDocShell();
+std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// (2 lines = crossing out of the deleted image + 1 line for the
+// vertical "changed line" indicator before the paragraph line)
+assertXPath(pXmlDoc, "//line", 3);
+
+// check line color
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor", 1);
+// tdf#142128 This was NON_PRINTING_CHARACTER_COLOR (#268bd2)
+assertXPath(
+pXmlDoc,
+
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor[@color='#268bd2']",
 0);
+
+// reject deletion of the image
+IDocumentRedline

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/data/tdf142196.fodt |   30 +++
 sw/qa/extras/uiwriter/uiwriter2.cxx   |   47 --
 sw/source/core/inc/flyfrm.hxx |3 +
 sw/source/core/layout/fly.cxx |1 
 sw/source/core/layout/paintfrm.cxx|   10 ++
 sw/source/core/text/porlay.cxx|   44 
 6 files changed, 127 insertions(+), 8 deletions(-)

New commits:
commit f41a4eb5bbd861f2132167863720e11e48f4b474
Author: László Németh 
AuthorDate: Tue May 11 18:40:18 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 13:13:59 2021 +0200

tdf#142196 sw: crossing out images anchored to character

Follow-up to commit d845b91bcc6eb885c55494d4d4fab4ec09577e1d
(tdf#78864 sw track changes: cross out deleted images).

Change-Id: I3daa772ac80f777e1badc58a424f98b1d655acba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115442
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 1610eeef6f2312616fe5d3535475f27f7896bef8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123974
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/data/tdf142196.fodt 
b/sw/qa/extras/uiwriter/data/tdf142196.fodt
new file mode 100644
index ..b184ba22e67f
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf142196.fodt
@@ -0,0 +1,30 @@
+
+http://purl.org/dc/elements/1.1/"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+  
+   
+  
+ 
+ 
+  
+   
+
+ 
+  
+   X
+   2021-05-07T17:32:23
+  
+ 
+
+   
+   Lorem 
+  
iVBORw0KGgoNSUhEUgEBCAA6fptVAmJLR0QA/4ePzL8JcEhZ
+   cwAACxMAAAsTAQCanBgHdElNRQflBQYKGR4LTuGQCklEQVQI12M4DwAA0QDQfVbA
+   HQBJRU5ErkJggg==
+  
+ 
+ipsum dolor sit amet.
+  
+ 
+
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 0559d52612cf..6ed013bd02f4 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2166,9 +2166,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
 xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
 CPPUNIT_ASSERT(pXmlDoc);
 
-// This was 6 (crossing out of the first, not deleted image)
-// (4 lines = 2 lines for crossing out of the second image, 2 lines for the
-// vertical lines before the two lines)
+// This was 6 (bad crossing out of the first, not deleted image)
+// (4 lines = 2 lines for crossing out of the second image + 2 lines =
+// vertical "changed line" indicator before the two paragraph lines)
 assertXPath(pXmlDoc, "/metafile/push/push/push/line", 4);
 
 // check line color
@@ -2186,6 +2186,47 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
 assertXPath(pXmlDoc2, "/metafile/push/push/push/line", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196)
+{
+load(DATA_DIRECTORY, "tdf142196.fodt");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+
+//turn on red-lining and show changes
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// Dump the rendering of the first page as an XML file.
+SwDocShell* pShell = pTextDoc->GetDocShell();
+std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// This was 1 (missing crossing out of the deleted image)
+// (2 lines = crossing out of the deleted image + 1 line for the
+// vertical "changed line" indicator before the paragraph line)
+assertXPath(pXmlDoc, "//line", 3);
+
+// reject deletion of the image
+IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+rIDRA.AcceptAllRedline(false);
+
+xMetaFile = pShell->GetPreviewMetaFile();
+xmlDocUniquePtr pXmlDoc2 = dumpAndParse(dumper, *xMetaFile);
+
+// no crossing out and vertical "changed line" indicator
+assertXPath(pXmlDoc2, "//line", 0);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120)
 {
 SwDoc* pDoc = createDoc("tdf54819.fodt");
diff --git a/sw/

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

2021-10-21 Thread Noel Grandin (via logerrit)
 sfx2/source/doc/docfile.cxx |   60 +++-
 1 file changed, 27 insertions(+), 33 deletions(-)

New commits:
commit 6772ed1dcd0a3f89f65375e10cba06544c46226a
Author: Noel Grandin 
AuthorDate: Thu Oct 21 09:07:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 21 13:11:37 2021 +0200

tdf#144650 crash after opening of read-only file

Change-Id: Ia888ae79940cbc618b2e693d0e658c152346e926
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123948
Reviewed-by: Kevin Suo 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 43730796eb3e..fde26ee2911a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4733,10 +4733,11 @@ void CheckReadOnlyTask::doWork()
 // must have timed-out
 termLock.unlock();
 std::unique_lock globalLock(g_chkReadOnlyGlobalMutex);
-for (const auto& [pMed, roEntry] : g_newReadOnlyDocs)
+for (auto it = g_newReadOnlyDocs.begin(); it != 
g_newReadOnlyDocs.end(); )
 {
+auto [pMed, roEntry] = *it;
 g_existingReadOnlyDocs[pMed] = roEntry;
-g_newReadOnlyDocs.erase(pMed);
+it = g_newReadOnlyDocs.erase(it);
 }
 if (g_existingReadOnlyDocs.size() == 0)
 {
@@ -4745,47 +4746,40 @@ void CheckReadOnlyTask::doWork()
 }
 globalLock.unlock();
 
-bool bErase = false;
-for (const auto& [pMed, roEntry] : g_existingReadOnlyDocs)
+auto checkForErase = [](SfxMedium* pMed, const 
std::shared_ptr& roEntry) -> bool
 {
-bErase = false;
-comphelper::ScopeGuard g([&bErase, pMed = pMed]() {
-if (bErase)
-g_existingReadOnlyDocs.erase(pMed);
-});
-
 if (pMed == nullptr || roEntry == nullptr || roEntry->_pMutex == 
nullptr
 || roEntry->_pIsDestructed == nullptr)
-{
-bErase = true;
-continue;
-}
+return true;
 
 std::unique_lock 
medLock(*(roEntry->_pMutex));
 if (*(roEntry->_pIsDestructed) || pMed->GetWorkerReloadEvent() != 
nullptr)
-{
-bErase = true;
-}
-else
-{
-osl::File aFile(
-
pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset));
-if (aFile.open(osl_File_OpenFlag_Write) != 
osl::FileBase::E_None)
-continue;
+return true;
 
-if (!pMed->CheckCanGetLockfile())
-continue;
+osl::File aFile(
+
pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset));
+if (aFile.open(osl_File_OpenFlag_Write) != osl::FileBase::E_None)
+return false;
 
-bErase = true;
+if (!pMed->CheckCanGetLockfile())
+return false;
 
-if (aFile.close() != osl::FileBase::E_None)
-continue;
+if (aFile.close() != osl::FileBase::E_None)
+return true;
 
-// we can load, ask user
-ImplSVEvent* pEvent = Application::PostUserEvent(
-LINK(nullptr, SfxMedium, ShowReloadEditableDialog), pMed);
-pMed->SetWorkerReloadEvent(pEvent);
-}
+// we can load, ask user
+ImplSVEvent* pEvent = Application::PostUserEvent(
+LINK(nullptr, SfxMedium, ShowReloadEditableDialog), pMed);
+pMed->SetWorkerReloadEvent(pEvent);
+return true;
+};
+
+for (auto it = g_existingReadOnlyDocs.begin(); it != 
g_existingReadOnlyDocs.end(); )
+{
+if (checkForErase(it->first, it->second))
+it = g_existingReadOnlyDocs.erase(it);
+else
+++it;
 }
 }
 }


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

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/core/doc/docdesc.cxx |3 ---
 sw/source/uibase/shells/basesh.cxx |6 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit c3a0f570ece7799166d8b21dc7c7417fa6b19ec6
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 13:11:15 2021 +0200

tdf#141613 sw: avoid possible crash when undoing header creation

Move the ClearRedo() call to the very end of the undo process in order to 
avoid heap use after free.

We still need to call ClearRedo() because there's no mechanism in place to 
Redo a header/footer change.

Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104
"tdf#141613 sw: fix crash at header/footer undo".

Change-Id: Ibd4604379c9791e85aef3d4dc6c29c9e3ecd5a28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115275
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 0cd000bb83719982c1fd2265ea040c82af5bf98e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123977
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 164404ce3016..d94f23b87fcb 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -498,9 +498,6 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged 
)
 lDelHFFormat(&rDescLeftFooterFormat, 
rDescLeftFooterFormat.GetFooterFormat());
 else if (rDescFirstLeftFooterFormat.GetFooterFormat() && 
rDescFirstLeftFooterFormat != rChgedFirstLeftFooterFormat)
 lDelHFFormat(&rDescFirstLeftFooterFormat, 
rDescFirstLeftFooterFormat.GetFooterFormat());
-
-// FIXME: Disable redoing this change until we figure out how
-GetIDocumentUndoRedo().ClearRedo();
 }
 }
 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 359dea043183..8d774615522e 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -557,6 +557,12 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
 rWrtShell.Do( SwWrtShell::UNDO, nCnt );
 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
 rShell.UnlockPaint();
+
+// tdf#141613 FIXME: Disable redoing header/footer changes for 
now.
+// The proper solution would be to write a SwUndoHeaderFooter 
class
+// to represent the addition of a header or footer to the 
current page.
+if (nUndoId == SwUndoId::HEADER_FOOTER)
+rUndoRedo.ClearRedo();
 }
 break;
 


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/uitest/writer_tests7/tdf46561.py |   13 +
 sw/source/core/doc/docdesc.cxx |   84 +
 2 files changed, 97 insertions(+)

New commits:
commit a456306df9d66e109a807a4245256b341e81040b
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 13:06:43 2021 +0200

tdf#141613 sw: fix crash at header/footer undo

Undoing the creation of a header/footer used to leave their
corresponding document nodes intact, causing the node index
of a previous undo entry to point to the wrong node.

We now force the destruction of the header/footer nodes manually.
We also cut the redo chain which loses the redo history, but solves
another crash for now (when redoing the creation of the header).

The proper solution would be to create a new SwUndo* derived class
from scratch to represent the creation of a new header/footer section
in the document.

Regression from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e
(tdf#46561 sw: fix lost undo stack setting header/footer)

Change-Id: I97188aa8ded802bc6b6fa88ddd83a95c40de8bc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114667
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123976
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
index 235136524903..02760cf76d96 100644
--- a/sw/qa/uitest/writer_tests7/tdf46561.py
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -102,4 +102,17 @@ class tdf46561(UITestCase):
 
 self.ui_test.close_doc()
 
+# Check that former crash has been fixed
+def test_tdf141613(self):
+self.ui_test.create_doc_in_start_center("writer")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+xArgs = mkPropertyValues({"Text": "something"})
+self.xUITest.executeCommandWithParameters(".uno:InsertText", xArgs)
+self.xUITest.executeCommand(".uno:InsertPageHeader")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Undo")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index a85975eac359..164404ce3016 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -419,6 +419,90 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
&rChged )
 
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(rDesc, 
rChged, this));
 }
+else
+{
+SwUndoId nBeingUndone;
+GetIDocumentUndoRedo().GetFirstRedoInfo(nullptr, &nBeingUndone);
+if (SwUndoId::HEADER_FOOTER == nBeingUndone)
+{
+// The last format change is currently being undone. Remove 
header/footer and corresponding nodes.
+auto rDescMasterHeaderFormat = 
rDesc.GetMaster().GetFormatAttr(RES_HEADER);
+auto rDescLeftHeaderFormat = 
rDesc.GetLeft().GetFormatAttr(RES_HEADER);
+auto rDescFirstLeftHeaderFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rDescMasterFooterFormat = 
rDesc.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rDescLeftFooterFormat = 
rDesc.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rDescFirstLeftFooterFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+auto rChgedMasterHeaderFormat = 
rChged.GetMaster().GetFormatAttr(RES_HEADER);
+auto rChgedLeftHeaderFormat = 
rChged.GetLeft().GetFormatAttr(RES_HEADER);
+auto rChgedFirstLeftHeaderFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rChgedMasterFooterFormat = 
rChged.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rChgedLeftFooterFormat = 
rChged.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rChgedFirstLeftFooterFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+rDesc.GetMaster().ResetFormatAttr(RES_HEADER);
+rDesc.GetLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetMaster().ResetFormatAttr(RES_FOOTER);
+rDesc.GetLeft().ResetFormatAttr(RES_FOOTER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_FOOTER);
+
+auto lDelHFFormat = [this](SwClient* pToRemove, SwFrameFormat* 
pFormat)
+{
+// Code taken from lcl_DelHFFormat
+pFormat->Remove(pToRemove);
+SwFormatContent& rCnt = 
const_cast(pFormat->GetContent());
+if (rCnt.GetContentIdx())
+{
+SwNode* pNode = nullptr;
+{
+  

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - xmlsecurity/qa xmlsecurity/source

2021-10-21 Thread Michael Stahl (via logerrit)
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx |   15 
 xmlsecurity/qa/unit/signing/data/test.p7b |  249 
++
 xmlsecurity/qa/unit/signing/signing.cxx   |   22 
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   63 ++
 4 files changed, 340 insertions(+), 9 deletions(-)

New commits:
commit 49b823e2946c68bfd2f623800424a9049a2f14eb
Author: Michael Stahl 
AuthorDate: Fri Oct 15 16:58:07 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 21 13:06:04 2021 +0200

xmlsecurity: fix new tests on WNT

Tests added in commit 40d70d427edddb589eda64fafc2e56536953d274 don't
actually run on WNT but that wasn't obvious because commit
149df1fec6472e30582162e17e04c75aee91d26a prevented running them in
Jenkins on master, they failed only in the libreoffice-7-1 backport.

  xmlsecurity/qa/unit/signing/signing.cxx(631) : error : Assertion
  Test name: testODFDoubleX509Certificate::TestBody
  assertion failed
  - Expression: (nActual == SignatureState::NOTVALIDATED || nActual == 
SignatureState::OK)
  - 2

This is an oddity where NSS claims the signature in the document is
valid but CryptoAPI claims it is invalid; the hashes passed into the
validation functions are the same.  Just allow BROKEN as an additional
result value on WNT.

  xmlsecurity/qa/unit/signing/signing.cxx(550) : error : Assertion
  Test name: testODFX509CertificateChain::TestBody
  equality assertion failed
  - Expected: 0
  - Actual  : 1

The problem here is that with NSS the tests use a custom NSS database
in test/signing-keys so we need to make these certificates available for
CryptoAPI too.

The following one-liner converts the NSS database to a PKCS#7 that can
be loaded by CrytpAPI:

> openssl crl2pkcs7 -nocrl -certfile <(certutil -d sql:test/signing-keys -L 
| awk '/^[^ ].*,[^ ]*,/ { printf "%s", $1; for (i = 2; i < NF; i++) { printf " 
%s", $i; } printf "\n"; }' | while read name; do certutil -L -d 
sql:test/signing-keys -a -n "${name}" ; done) > test/signing-keys/test.p7b

Then one might naively assume that something like this would allow these
certificates to be added temporarily as trusted CAs:

+HCERTSTORE hRoot = CertOpenSystemStoreW( 0, L"Root" ) ;
+HCERTSTORE const hExtra = CertOpenStore(
+CERT_STORE_PROV_FILENAME_A,
+PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
+NULL,
+CERT_STORE_OPEN_EXISTING_FLAG | 
CERT_STORE_READONLY_FLAG,
+path);
+if (hExtra != NULL && hRoot != NULL)
+{
+BOOL ret = CertAddStoreToCollection(
+hRoot,
+hExtra,
+CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG,
+0);
+SAL_DEBUG("XXX hExtra done " << ret);
+}

There is no error from this, but it doesn't work.

Instead, check if CertGetCertificateChain() sets the
CERT_TRUST_IS_UNTRUSTED_ROOT flag and then look up the certificate
manually in the extra PKCS#7 store.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123667
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 7d664ec788acdc378506a7ff8b1120cea24a6770)

Change-Id: Ic9865e0b5783211c2128ce0327c4583b7784ff62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123839
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx 
b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index 63990fb36225..77757228be1c 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -118,15 +119,21 @@ void PDFSigningTest::setUp()
 
 
mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory()));
 
-#ifndef _WIN32
-// Set up cert8.db and key3.db in workdir/CppunitTest/
 OUString aSourceDir = m_directories.getURLFromSrc(DATA_DIRECTORY);
 OUString aTargetDir
 = 
m_directories.getURLFromWorkdir("/CppunitTest/xmlsecurity_pdfsigning.test.user/");
-osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "cert8.db");
-osl::File::copy(aSourceDir + "key3.db", aTargetDir + "key3.db");
 OUString aTargetPath;
 osl::FileBase::getSystemPathFromFileURL(aTargetDir, aTargetPath);
+
+#ifdef _WIN32
+// CryptoAPI test certificates
+osl::File::copy(aSourceDir + "test.p7b", aTargetDir + "test.p7b");
+OUString caVar("LIBO_TEST_CRYPTOAPI_PKCS7");
+osl_setEnvironment(caVar.pData, a

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - xmlsecurity/qa

2021-10-21 Thread Michael Stahl (via logerrit)
 
xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 |binary
 xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
   |binary
 xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
   |binary
 
xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 |binary
 xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt 
   |binary
 xmlsecurity/qa/unit/signing/signing.cxx
   |  110 ++
 6 files changed, 110 insertions(+)

New commits:
commit 908f9f429cbeae6ed660ca41679af4d9378051aa
Author: Michael Stahl 
AuthorDate: Fri Feb 26 17:29:37 2021 +0100
Commit: Michael Stahl 
CommitDate: Thu Oct 21 13:04:57 2021 +0200

xmlsecurity: add tests for multiple X509Data/X509Certificate

Change-Id: If50ae8156f81c1053aa8fbfc3148da64bb8e1442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113183
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 
b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
new file mode 100644
index ..d63e4b6b7b72
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
 differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt
new file mode 100644
index ..0190abb00f23
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt 
differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
new file mode 100644
index ..f4b4198f94a6
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt 
differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
new file mode 100644
index ..558bdee47e59
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
 differ
diff --git 
a/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt 
b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt
new file mode 100644
index ..5e519dd8b7e7
Binary files /dev/null and 
b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 732b76e34c04..af4150cd6355 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -81,6 +82,11 @@ public:
 /// Document has a signature stream, but no actual signatures.
 void testODFNo();
 void testODFUnsignedTimestamp();
+void testODFX509CertificateChain();
+void testODFDoubleX509Data();
+void testODFTripleX509Data();
+void testODFMacroDoubleX509Data();
+void testODFDoubleX509Certificate();
 /// Test a typical OOXML where a number of (but not all) streams are 
signed.
 void testOOXMLPartial();
 /// Test a typical broken OOXML signature where one stream is corrupted.
@@ -139,6 +145,11 @@ public:
 CPPUNIT_TEST(testODFNo);
 CPPUNIT_TEST(testODFBroken);
 CPPUNIT_TEST(testODFUnsignedTimestamp);
+CPPUNIT_TEST(testODFX509CertificateChain);
+CPPUNIT_TEST(testODFDoubleX509Data);
+CPPUNIT_TEST(testODFTripleX509Data);
+CPPUNIT_TEST(testODFMacroDoubleX509Data);
+CPPUNIT_TEST(testODFDoubleX509Certificate);
 CPPUNIT_TEST(testOOXMLPartial);
 CPPUNIT_TEST(testOOXMLBroken);
 CPPUNIT_TEST(testOOXMLDescription);
@@ -616,6 +627,105 @@ void SigningTest::testODFUnsignedTimestamp()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(18183742), infos[0].SignatureTime);
 }
 
+void SigningTest::testODFX509CertificateChain()
+{
+createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+  + "signed_with_x509certificate_chain.odt");
+SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pBaseModel);
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+CPPUNIT_ASSERT(pObjectShell);
+SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+CPPUNIT_ASSERT_MESSAGE(
+
(OString::number(/*o3tl::underlyingEnumValue(*/(int)nActual/*)*/).getStr()),
+(nActual == SignatureState::NOTVALIDATED || nActual == 
SignatureState::OK));
+uno::Sequence const infos(
+pObjectShell->ImplAnalyzeSignature(false));
+CPPUNIT_ASSERT_E

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

2021-10-21 Thread Tor Lillqvist (via logerrit)
 fpicker/source/aqua/SalAquaPicker.mm |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 4a7b8a981d3155427dd669e5409b7f107c5f3554
Author: Tor Lillqvist 
AuthorDate: Thu Oct 21 12:18:47 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 21 12:54:53 2021 +0200

Use NSModalResponseOK instead of deprecated NSFileHandlingPanelOKButton

NSFileHandlingPanelOKButton is defined as NSModalResponseOK in
NSSavePanel.h:

NSFileHandlingPanelOKButton 
API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseOK", macos(10.0,10.13)) = 
NSModalResponseOK,

For some reason, when as a test I just removed the
SAL_WNODEPRECATED_DECLARATIONS_PUSH and _POP lines, I still did not
get any depreation warning about NSFileHandlingPanelOKButton. I wonder
if there is some problem in latest Xcode or in our build system that
means we don't get any deprecation warnings at all any more on macOS.

Change-Id: Ia61dd9f800eb7d251508dbd491a9c48c8e6118f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123964
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/fpicker/source/aqua/SalAquaPicker.mm 
b/fpicker/source/aqua/SalAquaPicker.mm
index 713d6d2ade13..5011c194db15 100644
--- a/fpicker/source/aqua/SalAquaPicker.mm
+++ b/fpicker/source/aqua/SalAquaPicker.mm
@@ -163,10 +163,7 @@ int SalAquaPicker::run()
 break;
 }
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-//TODO: 10.13 NSFileHandlingPanelOKButton
-if (retVal == NSFileHandlingPanelOKButton) {
-SAL_WNODEPRECATED_DECLARATIONS_POP
+if (retVal == NSModalResponseOK) {
 NSURL* pDir = [m_pDialog directoryURL];
 if (pDir) {
 implsetDisplayDirectory([pDir OUString]);


[Libreoffice-commits] core.git: external/cppunit

2021-10-21 Thread Stephan Bergmann (via logerrit)
 external/cppunit/UnpackedTarball_cppunit.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 538ba91535c9f13101c25e49a67e56559f389288
Author: Stephan Bergmann 
AuthorDate: Thu Oct 21 11:27:42 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 21 12:42:44 2021 +0200

Mark external/cppunit/order.patch.0 as upstreamed

Change-Id: Ic0bfacd74e007c979d574e65767cbfb0d40c9ef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123965
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/cppunit/UnpackedTarball_cppunit.mk 
b/external/cppunit/UnpackedTarball_cppunit.mk
index 10063d2aa104..5dc750bbdd9b 100644
--- a/external/cppunit/UnpackedTarball_cppunit.mk
+++ b/external/cppunit/UnpackedTarball_cppunit.mk
@@ -13,6 +13,8 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,cppunit))
 
+# * external/cppunit/order.patch.0 upstreamed at 

+#   "Run tests in deterministic order":
 $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
external/cppunit/windows.patch \
external/cppunit/unix.patch \


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

2021-10-21 Thread Stephan Bergmann (via logerrit)
 jvmfwk/inc/fwkbase.hxx  |3 -
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   46 
 jvmfwk/source/fwkbase.cxx   |4 -
 3 files changed, 23 insertions(+), 30 deletions(-)

New commits:
commit 3460c16d7f749d8d2a59d8b927df5ec31f64a083
Author: Stephan Bergmann 
AuthorDate: Thu Oct 21 10:14:38 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 21 12:42:03 2021 +0200

Make getVersionInformation always return a VersionInfo

...even for JREs not listed in javavendors.xml, making it default to a
VersionInfo with sMinVersion = "1.8.0".

3d27b2fa9c5a03f78e5145377402f8a88e3da1be "tdf#124503: Support JRE 
installations
with unknown java.vendor property", which had changed getVersionInformation 
to
return an optional,  said in the commit message:  "For 
simplicity,
assume that any versions of such JREs are supported.  Our baseline is Java 
6,
and there are unlikely any older versions of JREs from unknown vendors out
there."  Our baseline is Java 8 by now, and there are still unlikely any 
older
JREs out there, but for macOS ARM64 we may want to restrict to at least 
Java 17
implementing  "JEP 391: macOS/AArch64 
Port",
and this commit is a prerequisite for such a change (where we would then 
e.g.
change the hardcoded "1.8.0" to "17" for just that one platform).

(OtherInfo::compareVersions in 
jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
unconditionally returns 0, meaning "versions compare equal", so introducing 
a
default version of "1.8.0" should have no negative effect on any JREs that 
use
OtherInfo.)

Change-Id: I34dc5f2b755c2254a91d42c262786ceec70c746e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123958
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/jvmfwk/inc/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx
index 5f989cc08cee..61c3fa500138 100644
--- a/jvmfwk/inc/fwkbase.hxx
+++ b/jvmfwk/inc/fwkbase.hxx
@@ -21,7 +21,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
@@ -40,7 +39,7 @@ class VendorSettings
 public:
 VendorSettings();
 
-std::optional getVersionInformation(std::u16string_view 
sVendor) const;
+VersionInfo getVersionInformation(std::u16string_view sVendor) const;
 };
 
 /* The class offers functions to retrieve verified bootstrap parameters.
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index d3b9b92a5b5e..70d6e7888097 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -348,16 +348,14 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 
 for (auto const& vecInfo : vecInfos)
 {
-if (auto const versionInfo = 
vendorSettings.getVersionInformation(vecInfo->getVendor()))
-{
-javaPluginError err = checkJavaVersionRequirements(
-vecInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, 
versionInfo->vecExcludeVersions);
+auto const versionInfo = 
vendorSettings.getVersionInformation(vecInfo->getVendor());
+javaPluginError err = checkJavaVersionRequirements(
+vecInfo, versionInfo.sMinVersion, versionInfo.sMaxVersion, 
versionInfo.vecExcludeVersions);
 
-if (err == javaPluginError::FailedVersion || err == 
javaPluginError::WrongArch)
-continue;
-else if (err == javaPluginError::WrongVersionFormat)
-return err;
-}
+if (err == javaPluginError::FailedVersion || err == 
javaPluginError::WrongArch)
+continue;
+else if (err == javaPluginError::WrongVersionFormat)
+return err;
 
 vecVerifiedInfos.push_back(vecInfo);
 }
@@ -388,11 +386,9 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 
 //Check if the detected JRE matches the version requirements
 javaPluginError errorcode = javaPluginError::NONE;
-if (auto const versionInfo = 
vendorSettings.getVersionInformation(aVendorInfo->getVendor()))
-{
-errorcode = checkJavaVersionRequirements(
-aVendorInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, 
versionInfo->vecExcludeVersions);
-}
+auto const versionInfo = 
vendorSettings.getVersionInformation(aVendorInfo->getVendor());
+errorcode = checkJavaVersionRequirements(
+aVendorInfo, versionInfo.sMinVersion, versionInfo.sMaxVersion, 
versionInfo.vecExcludeVersions);
 
 if (errorcode == javaPluginError::NONE)
 *ppInfo = createJavaInfo(aVendorInfo);
@@ -416,13 +412,12 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
 
 //Check if the detected JRE matches the version requirements
 auto const versionInfo = 
vendorSettings.getVersionInformation(infoJavaHome[0]->getVendor());
-if (!versionInfo
-|| (checkJavaVersionRequirements(
+  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/source

2021-10-21 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr8.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 8cb5d166b6ad92adc7a8ef310a18dc7127d1fbcf
Author: Eike Rathke 
AuthorDate: Wed Oct 20 13:41:03 2021 +0200
Commit: Andras Timar 
CommitDate: Thu Oct 21 12:33:58 2021 +0200

Resolves: tdf#145235 TEXTJOIN() clear last string also for referenced empty

Change-Id: If6d20a1629e001708c700c5c25bef8a75fa34e25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123889
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit f4f2c94513e7d06691a73d9f12707c33d131d537)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123865
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 19cdd7eac3cb..6cc239d9f7ec 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1740,17 +1740,14 @@ void ScInterpreter::ScTextJoin_MS()
 aAdr.SetRow( nRow );
 aAdr.SetCol( nCol );
 ScRefCellValue aCell( mrDoc, aAdr );
-if ( !aCell.isEmpty() )
+if (aCell.hasEmptyValue())
+aStr.clear();
+else
 {
-if ( !aCell.hasEmptyValue() )
-{
-svl::SharedString aSS;
-GetCellString( aSS, aCell);
-aStr = aSS.getString();
-}
+svl::SharedString aSS;
+GetCellString( aSS, aCell);
+aStr = aSS.getString();
 }
-else
-aStr.clear();
 if ( !aStr.isEmpty() || !bSkipEmpty )
 {
 if ( !bFirst )


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

2021-10-21 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/png/PngImageReader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9bf469e6e458473f6432d80b31ef76526b5aaa39
Author: Caolán McNamara 
AuthorDate: Wed Oct 20 21:29:05 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 21 12:27:01 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index e3b3703c1cab..13c19feaf1ad 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -398,7 +398,7 @@ std::unique_ptr getMsGifChunk(SvStream& 
rStream, sal_Int32* chunkSi
 bool ignoreCrc = utl::ConfigManager::IsFuzzing();
 for (;;)
 {
-sal_uInt32 length, type, crc;
+sal_uInt32 length(0), type(0), crc(0);
 rStream.ReadUInt32(length);
 rStream.ReadUInt32(type);
 if (!rStream.good())


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/data/ole2.png |binary
 sw/qa/extras/uiwriter/uiwriter2.cxx |   29 +
 sw/source/core/frmedt/fefly1.cxx|   12 
 sw/source/uibase/wrtsh/wrtsh1.cxx   |5 +
 4 files changed, 46 insertions(+)

New commits:
commit 4430201e39e4d352aaa547db0d0d7b5b7b3cbcef
Author: László Németh 
AuthorDate: Wed Jun 9 15:56:09 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 12:12:43 2021 +0200

tdf#141994 track changes: record insertion of images

by adding a SwRangeRedline to the anchoring point of
the image inserted with Insert->Image... or
"Insert Image" of the Standard toolbar.

Note: Only images anchored as characters can be
recorded this way, so change the default to-character
anchoring at enabled change tracking. (In other office
suites, as-character insertion is the default anchoring
for inserted images with disabled change tracking, too.)

Follow-up to commit d6322bcedc197a654abc7d64bfea8cf570f123bf
"tdf#59463 track changes: record deletion of images".

Change-Id: I593abbdb6f9f2b1a5265f112103479c1833166af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116924
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 68b6004fe9df184bcbaf46dd53abfec228219df6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123969
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/data/ole2.png 
b/sw/qa/extras/uiwriter/data/ole2.png
new file mode 100644
index ..fdad35484e7c
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/ole2.png differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 1a6d455abfb3..0559d52612cf 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3090,6 +3091,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testTrackImageDeletion)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
rTable.size());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTrackImageInsertion)
+{
+loadURL("private:factory/swriter", nullptr);
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+
+// turn on red-lining and show changes
+IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+
+rIDRA.SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// Insert an image with change tracking
+OUString aImageURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"ole2.png";
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FileName", aImageURL),
+};
+dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
+
+const SwRedlineTable& rTable = rIDRA.GetRedlineTable();
+// this was 0 (missing recording of insertion of images)
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
rTable.size());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120338)
 {
 load(DATA_DIRECTORY, "tdf120338.docx");
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 7afe6ee04afa..173c98a97d14 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -48,6 +48,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -890,6 +892,16 @@ void SwFEShell::Insert( const OUString& rGrfName, const 
OUString& rFltName,
 
 if( pFrame )
 {
+// add a redline to the anchor point at tracked insertion of picture
+if ( IsRedlineOn() )
+{
+SwPosition aPos(*pFormat->GetAnchor().GetContentAnchor());
+SwPaM aPaM(aPos.nNode.GetNode(), aPos.nContent.GetIndex(),
+aPos.nNode.GetNode(), aPos.nContent.GetIndex() + 1);
+GetDoc()->getIDocumentRedlineAccess().AppendRedline(
+new SwRangeRedline( RedlineType::Insert, aPaM ), true);
+}
+
 // fdo#36681: Invalidate the content and layout to refresh
 // the picture anchoring properly
 SwPageFrame* pPageFrame = pFrame->FindPageFrameOfAnchor();
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 8251a9978142..7816800d99b7 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -315,6 +315,11 @@ void SwWrtShell::Insert( const OUString &rPath, const 
OUString &rFilter,
 pFrameMgr->SetHeightSizeType(SwFrameSize::Fixed);
 }
 
+// during change trackin

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/uiwriter/uiwriter.cxx |4 -
 sw/qa/uitest/data/tdf46561.odt |binary
 sw/qa/uitest/writer_tests7/tdf46561.py |  105 +
 sw/source/core/doc/docdesc.cxx |   87 +--
 sw/source/core/layout/pagedesc.cxx |   27 +---
 5 files changed, 156 insertions(+), 67 deletions(-)

New commits:
commit 9b4b8c8cf0b17d8f217db3a8af56db192789bbd3
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Feb 22 16:59:38 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 12:03:31 2021 +0200

tdf#46561 sw: fix lost undo stack setting header/footer

Changing 'shared' setting of left vs right or
first vs non-first page headers or footers removed
the whole undo stack.

Note: style changes before a 'shared' change
can still not be undone.

Co-authored-by: Attila Bakos (NISZ)

Change-Id: I6875bd0581869ffeb853911347dbc9f8c666214b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111635
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Balazs Varga 
(cherry picked from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123973
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 702dc90636fd..f876e993db1f 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -2215,7 +2215,9 @@ void SwUiWriterTest::testTextCursorInvalidation()
 // this does not actually delete the header:
xPageStyle->setPropertyValue("HeaderIsOn", uno::makeAny(false));
 pWrtShell->ChangeHeaderOrFooter("Default Page Style", true, false, false);
 // must be disposed after deleting header
-CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
+// cursor ends up in body
+// UPDATE: this behaviour has been corrected as a side effect of the fix 
to tdf#46561:
+//CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
 }
 
 void SwUiWriterTest::testTdf68183()
diff --git a/sw/qa/uitest/data/tdf46561.odt b/sw/qa/uitest/data/tdf46561.odt
new file mode 100644
index ..c9f9942521d0
Binary files /dev/null and b/sw/qa/uitest/data/tdf46561.odt differ
diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
new file mode 100644
index ..235136524903
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -0,0 +1,105 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import type_text
+import importlib
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf46561(UITestCase):
+def check_header_texts(self, master="", first="", left="", right=""):
+# Get the current header style and its text contents
+xPageStyle = self.document.getStyleFamilies().getByIndex(2)
+xHeaderText = xPageStyle.getByIndex(0).HeaderText.String
+xHeaderTextFirst = xPageStyle.getByIndex(0).HeaderTextFirst.String
+xHeaderTextLeft = xPageStyle.getByIndex(0).HeaderTextLeft.String
+xHeaderTextRight = xPageStyle.getByIndex(0).HeaderTextRight.String
+
+# Check the current values
+self.assertEqual(master, xHeaderText)
+self.assertEqual(first, xHeaderTextFirst)
+self.assertEqual(left, xHeaderTextLeft)
+self.assertEqual(right, xHeaderTextRight)
+
+def test_tdf46561(self):
+self.ui_test.load_file(get_url_for_data_file("tdf46561.odt"))
+self.document = self.ui_test.get_component()
+self.check_header_texts(master="right", first="1st", left="left", 
right="right")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "2"}))
+self.xUITest.executeCommand(".uno:JumpToHeader")
+
+# Switch "same left and right page headers" on and off a few times
+for _ in range(4):
+self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+PageDialog = self.xUITest.getTopFocusWindow();
+
+xTabs = PageDialog.getChild("tabcontrol")
+select_pos(xTabs, "4")
+
+Button = xTabs.getChild('checkSameLR')
+Button.executeAction("CLICK",tuple())
+ok = PageDialog.getChild("ok")
+se

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

2021-10-21 Thread Caolán McNamara (via logerrit)
 sw/source/core/doc/docdesc.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4ada4bc29bb51dec1852a11f0064538a53d6a8c9
Author: Caolán McNamara 
AuthorDate: Thu Mar 4 15:50:08 2021 +
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 12:02:07 2021 +0200

ofz#31672 Bad-cast

==3484068== Invalid read of size 8
==3484068==at 0x226E9EDC: SwClient::GetRegisteredIn() const 
(calbck.hxx:159)
==3484068==by 0x22A09E30: SwDoc::ChgPageDesc(unsigned long, SwPageDesc 
const&) (docdesc.cxx:465)
==3484068==by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) 
(fltshell.cxx:1094)
==3484068==by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) 
(ww8par.cxx:5482)
==3484068==by 0x1CDD90A1: 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939)
==3484068==by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) 
(ww8par.cxx:6243)

==3484068==  Address 0x28c215c8 is 40 bytes inside a block of size 56 free'd
==3484068==at 0x483AEDD: operator delete(void*) 
(vg_replace_malloc.c:584)
==3484068==by 0x23009F47: SwFormatHeader::~SwFormatHeader() 
(atrfrm.cxx:503)
==3484068==by 0x9DDC3F3: SfxItemPool::Remove(SfxPoolItem const&) 
(itempool.cxx:741)
==3484068==by 0x9E17BD6: SfxItemSet::~SfxItemSet() (itemset.cxx:252)
==3484068==by 0x227FE847: SwAttrSet::~SwAttrSet() (swatrset.hxx:161)
==3484068==by 0x227FD139: SwFormat::SetFormatAttr(SfxPoolItem const&) 
(format.cxx:524)
==3484068==by 0x22A07AA6: SwDoc::CopyMasterHeader(SwPageDesc const&, 
SwFormatHeader const&, SwPageDesc&, bool, bool) (docdesc.cxx:248)
==3484068==by 0x22A09B4D: SwDoc::ChgPageDesc(unsigned long, SwPageDesc 
const&) (docdesc.cxx:457)
==3484068==by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) 
(fltshell.cxx:1094)
==3484068==by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) 
(ww8par.cxx:5482)
==3484068==by 0x1CDD90A1: 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939)
==3484068==by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) 
(ww8par.cxx:6243)

since...

commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3
Date:   Tue Jan 26 13:11:42 2021 +0100

tdf#140117 sw UI: keep headers/footers when inactive

Change-Id: I14787d4203c457393e8b5d0222df67d394a4c9ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111970
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 61ff5e8126c64ff521a148c5003e15a86d50c4cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123972
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 5da2c32f90be..341dfaaafb14 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -463,11 +463,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
&rChged )
 const bool bStashLeftHead = !rDesc.IsHeaderShared() && 
rChged.IsHeaderShared();
 const bool bStashFirstMasterHead = !rDesc.IsFirstShared() && 
rChged.IsFirstShared();
 const bool bStashFirstLeftHead = (!rDesc.IsHeaderShared() && 
rChged.IsHeaderShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
-if (rLeftHead.GetRegisteredIn() && bStashLeftHead)
+if (bStashLeftHead && rLeftHead.GetRegisteredIn())
 rDesc.StashFrameFormat(rChged.GetLeft(), true, true, false);
-if (rFirstMasterHead.GetRegisteredIn() && bStashFirstMasterHead)
+if (bStashFirstMasterHead && rFirstMasterHead.GetRegisteredIn())
 rDesc.StashFrameFormat(rChged.GetFirstMaster(), true, false, true);
-if (rFirstLeftHead.GetRegisteredIn() && bStashFirstLeftHead)
+if (bStashFirstLeftHead && rFirstLeftHead.GetRegisteredIn())
 rDesc.StashFrameFormat(rChged.GetFirstLeft(), true, true, true);
 
 rDesc.ChgHeaderShare( rChged.IsHeaderShared() );
@@ -501,11 +501,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
&rChged )
 const bool bStashLeftFoot = !rDesc.IsFooterShared() && 
rChged.IsFooterShared();
 const bool bStashFirstMasterFoot = !rDesc.IsFirstShared() && 
rChged.IsFirstShared();
 const bool bStashFirstLeftFoot = (!rDesc.IsFooterShared() && 
rChged.IsFooterShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
-if (rLeftFoot.GetRegisteredIn() && bStashLeftFoot)
+if (bStashLeftFoot && rLeftFoot.GetRegisteredIn())
 rDesc.StashFrameFormat(rChged.GetLeft(), false, true, false);
-if (rFirstMasterFoot.GetRegisteredIn() && bStashFirstMasterFoot)
+if (bStashFirstMasterFoot && rFirstMasterFoot.GetRegisteredIn())
 rDesc.StashFrameFormat(rChged.GetFirstMaster(), false, false, true);
-if (rFirstLeftFoot.GetRegisteredIn() && bStashFirstLeftFoot)
+if (bStashFirstLeftFoot && rFirstLeftFoot.GetRegisteredIn())
 rDesc.StashFrameFormat(rCh

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/inc sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/inc/pagedesc.hxx |   17 +
 sw/qa/uitest/data/tdf140117.fodt|   95 
 sw/qa/uitest/writer_tests7/tdf140117.py |   70 +++
 sw/source/core/doc/docdesc.cxx  |   70 ++-
 sw/source/core/layout/pagedesc.cxx  |   73 
 5 files changed, 311 insertions(+), 14 deletions(-)

New commits:
commit 2ede6c34ad39569570521ac2fdbae6c722ba096b
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Jan 26 13:11:42 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 11:52:46 2021 +0200

tdf#140117 sw UI: keep headers/footers when inactive

Custom left page and first headers (and footers) used to disappear
forever if hidden temporarily by checking the "Same content on left
and right pages" or "Same content on first page" options, respectively.
This commit stashes the endangered headers (footers) in SwPageDesc
and restores them on demand.

Change-Id: I1f6b605e2bd19af18726de1b825721487d29b4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110398
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123971
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 44bb7ee33b52..5e561623da69 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -148,6 +148,17 @@ class SW_DLLPUBLIC SwPageDesc
 // FIXME epicycles growing here - page margins need to be stored 
differently
 SwFrameFormatm_FirstMaster;
 SwFrameFormatm_FirstLeft;
+
+struct StashedPageDesc
+{
+std::shared_ptr m_pStashedFirst;
+std::shared_ptr m_pStashedLeft;
+std::shared_ptr m_pStashedFirstLeft;
+};
+
+mutable StashedPageDesc m_aStashedHeader;
+mutable StashedPageDesc m_aStashedFooter;
+
 sw::WriterMultiListener m_aDepends; ///< Because of grid alignment 
(Registerhaltigkeit).
 mutable const SwTextFormatColl* m_pTextFormatColl;
 SwPageDesc *m_pFollow;
@@ -206,6 +217,12 @@ public:
 bool IsHidden() const { return m_IsHidden; }
 void SetHidden(bool const bValue) { m_IsHidden = bValue; }
 
+/// Remember original header/footer formats even when they are hidden by 
"sharing".
+void StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, bool 
bLeft, bool bFirst);
+
+/// Used to restore hidden header/footer formats.
+const SwFrameFormat* GetStashedFrameFormat(bool bHeader, bool bLeft, bool 
bFirst) const;
+
 /// Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is 
not modified.
 inline void  SetUseOn( UseOnPage eNew );
 inline UseOnPage GetUseOn() const;
diff --git a/sw/qa/uitest/data/tdf140117.fodt b/sw/qa/uitest/data/tdf140117.fodt
new file mode 100644
index ..8487346d1d5c
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140117.fodt
@@ -0,0 +1,95 @@
+
+http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:ooow="http://openoffice.org/200
 4/writer" 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendo

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf69635.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|5 +
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|   56 +++
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   22 +++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |6 -
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   12 +--
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |2 
 sw/source/filter/ww8/docxexport.cxx   |9 +-
 sw/source/filter/ww8/docxexport.hxx   |3 
 sw/source/filter/ww8/rtfexport.cxx|   10 +-
 sw/source/filter/ww8/rtfexport.hxx|6 +
 sw/source/filter/ww8/wrtw8sty.cxx |   95 +++---
 sw/source/filter/ww8/wrtww8.hxx   |8 +-
 14 files changed, 189 insertions(+), 47 deletions(-)

New commits:
commit d9caf9814696c747e4b0277bc7377ba09aead334
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Feb 5 12:07:48 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 11:42:19 2021 +0200

tdf#69635 DOCX: export hidden (shared) headers/footers

Exporting to .docx used to lose all header and footer
content that was not visible in the document at the
moment of saving. This commit forces the DocxExport
class to output all headers and footers even when
the "Same content on left and right pages" option
is turned on.

Change-Id: I6a52f216f1e1b386d887ec614198766670b5bce3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113158
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123970
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf69635.docx 
b/sw/qa/extras/ooxmlexport/data/tdf69635.docx
new file mode 100644
index ..94cced4d2ae4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf69635.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index a740b6295999..2ee47d611adf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -671,7 +671,12 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf130167_spilloverHeaderShape, "testTdf130167_spil
 uno::Reference xNameAccess(
 xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
 // graphics from discarded headers were being added to the text body. 
Reduced from 5 to 2 shapes overall.
+<<< HEAD   (7b6bf0 tdf#142128 sw: set author-color strikethrough for 
AS_CHAR im)
 CPPUNIT_ASSERT(xNameAccess->getCount() < 4);
+===
+// CPPUNIT_ASSERT(xNameAccess->getCount() <= 4); -> What about hidden 
headers?
+CPPUNIT_ASSERT_LESS(sal_Int32(9), xNameAccess->getCount());
+>>> CHANGE (88e6a1 tdf#69635 DOCX: export hidden (shared) headers/footers)
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf124986, "tdf124986.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 7e890145210d..a20c8bfb9fe3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -50,6 +50,62 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, 
"tdf138892_noNumbering.docx"
 CPPUNIT_ASSERT_MESSAGE("Para3: ", 
getProperty(getParagraph(3), "NumberingStyleName").isEmpty());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf141231_arabicHebrewNumbering, 
"tdf141231_arabicHebrewNumbering.docx")
+{
+// The page's numbering type: instead of Hebrew, this was default 
style::NumberingType::ARABIC (4).
+auto nActual = 
getProperty(getStyles("PageStyles")->getByName("Standard"), 
"NumberingType");
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HEBREW, nActual);
+
+// The footnote numbering type: instead of arabicAbjad, this was the 
default style::NumberingType::ARABIC.
+uno::Reference xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xFootnoteSettings = 
xFootnotesSupplier->getFootnoteSettings();
+nActual = 
getProperty(xFootnotesSupplier->getFootnoteSettings(), 
"NumberingType");
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_ARABIC_ABJAD, nActual);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")
+{
+uno::Reference xPageStyle;
+getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+sal_Int32 nGutterMargin{};
+xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1270
+// - Actual  : 0
+// i.e. gutter margin was lost.
+CPPUNIT_ASSERT_EQUAL(static_cast(1270), nGutterMargin);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
+{
+load(mpTestDocumentPath, "gutter-top.docx");
+save("Office Open XML Text", maTempFile);
+mbExp

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |5 +
 sw/source/core/text/porfly.cxx  |7 +--
 sw/source/core/text/porfly.hxx  |3 +++
 sw/source/core/text/porlay.cxx  |4 +++-
 sw/source/core/text/redlnitr.cxx|6 --
 sw/source/core/text/redlnitr.hxx|2 +-
 6 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 7b6bf0525c4a4122ad813a9b7b1558832b772d93
Author: László Németh 
AuthorDate: Mon Jun 7 17:56:42 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 11:30:00 2021 +0200

tdf#142128 sw: set author-color strikethrough for AS_CHAR images

(anchored as character) during change tracking instead of
using always the same NON_PRINTING_CHARACTER_COLOR blue one.

Follow-up to commit 76dc21860ce185bd5495adde8858d2f23284c78e
"tdf#142128 sw: set author-color strikethrough for deleted images".

Change-Id: I3fa02f6ec6cd1f71ae3b3c06644dd24f6c684f6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116795
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123962
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 259687baf470..1a6d455abfb3 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2170,6 +2170,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
 // vertical lines before the two lines)
 assertXPath(pXmlDoc, "/metafile/push/push/push/line", 4);
 
+// check line color
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/linecolor", 5);
+// tdf#142128 This was 3 (NON_PRINTING_CHARACTER_COLOR = #268bd2)
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/linecolor[@color='#268bd2']", 0);
+
 // reject deletion of the second image
 IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
 rIDRA.AcceptAllRedline(false);
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 11659a1ebc0e..5709cbee23e2 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -40,6 +40,7 @@
 
 #include 
 #include 
+#include 
 
 /**
  * class SwFlyPortion => we expect a frame-locale SwRect!
@@ -227,7 +228,7 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& 
rInf) const
 
 // track changes: cross out the image, if it is deleted
 const SwFrame *pFrame = m_pFly->Lower();
-if ( IsDeleted() && pFrame )
+if ( GetAuthor() != std::string::npos && IsDeleted() && pFrame )
 {
 SwRect aPaintRect( pFrame->GetPaintArea() );
 
@@ -237,7 +238,8 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& 
rInf) const
 
const_cast(*rInf.GetOut()).SetAntialiasing(AntialiasingFlags::Enable);
 tools::Long startX = aPaintRect.Left(  ), endX = 
aPaintRect.Right();
 tools::Long startY = aPaintRect.Top(  ),  endY = 
aPaintRect.Bottom();
-
const_cast(*rInf.GetOut()).SetLineColor(NON_PRINTING_CHARACTER_COLOR);
+const_cast(*rInf.GetOut()).SetLineColor(
+SwPostItMgr::GetColorAnchor(GetAuthor()) );
 
const_cast(*rInf.GetOut()).DrawLine(Point(startX, startY), 
Point(endX, endY));
 
const_cast(*rInf.GetOut()).DrawLine(Point(startX, endY), 
Point(endX, startY));
 if ( bIsAntiAliasing )
@@ -271,6 +273,7 @@ void sw::DrawFlyCntPortion::Paint(const SwTextPaintInfo&) 
const
 SwFlyCntPortion::SwFlyCntPortion()
 : m_bMax(false)
 , m_bDeleted(false)
+, m_nAuthor(std::string::npos)
 , m_eAlign(sw::LineAlign::NONE)
 {
 nLineLength = TextFrameIndex(1);
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index b83aab4a4c88..7c00db94a840 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -46,6 +46,7 @@ class SwFlyCntPortion : public SwLinePortion
 Point m_aRef; // Relatively to this point we calculate the AbsPos
 bool m_bMax;  // Line adjustment and height == line height
 bool m_bDeleted;  // Part of tracked deletion: it needs strikethrough
+size_t m_nAuthor; // Redline author for color of the strikethrough
 sw::LineAlign m_eAlign;
 
 virtual SdrObject* GetSdrObj(const SwTextFrame&) =0;
@@ -55,6 +56,8 @@ public:
 const Point& GetRefPoint() const { return m_aRef; }
 bool IsMax() const { return m_bMax; }
 bool IsDeleted() const { return m_bDeleted; }
+void SetAuthor(size_t nAuthor) { m_nAuthor = nAuthor; }
+size_t GetAuthor() const { return m_nAuthor; }
 sw::LineAlign GetAlign() const { return m_eAlign; }
 void SetAlign(sw::LineAlign eAlign) { m_eAlign = eAlign; }
 void SetMax(bool bMax) { m_bMax = bMax; }
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 74cd12b372a6..1d200d0a061d 100644
--- a/sw/source

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

2021-10-21 Thread Caolán McNamara (via logerrit)
 sw/source/core/text/porfly.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d382d6af859e4d7507a43a603461f9fe90033e09
Author: Caolán McNamara 
AuthorDate: Mon May 3 19:51:15 2021 +0100
Commit: Balazs Varga 
CommitDate: Thu Oct 21 11:28:20 2021 +0200

cid#1478174 Uninitialized scalar field

Change-Id: Ib17e55b600012ef5f6a26d01e9d54aa7be9c590d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115052
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123961
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 77062850dc3f..11659a1ebc0e 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -270,6 +270,7 @@ void sw::DrawFlyCntPortion::Paint(const SwTextPaintInfo&) 
const
  */
 SwFlyCntPortion::SwFlyCntPortion()
 : m_bMax(false)
+, m_bDeleted(false)
 , m_eAlign(sw::LineAlign::NONE)
 {
 nLineLength = TextFrameIndex(1);


[Libreoffice-commits] core.git: fpicker/Library_fps_aqua.mk fpicker/source

2021-10-21 Thread Tor Lillqvist (via logerrit)
 fpicker/Library_fps_aqua.mk  |1 
 fpicker/source/aqua/CFStringUtilities.hxx|   41 --
 fpicker/source/aqua/CFStringUtilities.mm |  107 ---
 fpicker/source/aqua/ControlHelper.mm |1 
 fpicker/source/aqua/FilterHelper.mm  |1 
 fpicker/source/aqua/NSString_OOoAdditions.mm |1 
 fpicker/source/aqua/NSURL_OOoAdditions.hxx   |3 
 fpicker/source/aqua/NSURL_OOoAdditions.mm|   42 +-
 fpicker/source/aqua/SalAquaFilePicker.mm |3 
 fpicker/source/aqua/SalAquaFolderPicker.mm   |3 
 fpicker/source/aqua/SalAquaPicker.mm |3 
 11 files changed, 8 insertions(+), 198 deletions(-)

New commits:
commit 33d5c0248039c0b24a2adb4c2d4c1606f05e6278
Author: Tor Lillqvist 
AuthorDate: Thu Oct 21 10:47:36 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 21 11:16:53 2021 +0200

Bin dead code

Change-Id: I2098172d065a195a15b7fd81a34dab25b1f38e57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123956
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/fpicker/Library_fps_aqua.mk b/fpicker/Library_fps_aqua.mk
index 1c382e9638f5..4c033a838bc5 100644
--- a/fpicker/Library_fps_aqua.mk
+++ b/fpicker/Library_fps_aqua.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_Library_use_libraries,fps_aqua,\
 
 $(eval $(call gb_Library_add_objcxxobjects,fps_aqua,\
fpicker/source/aqua/AquaFilePickerDelegate \
-   fpicker/source/aqua/CFStringUtilities \
fpicker/source/aqua/ControlHelper \
fpicker/source/aqua/FilterHelper \
fpicker/source/aqua/NSString_OOoAdditions \
diff --git a/fpicker/source/aqua/CFStringUtilities.hxx 
b/fpicker/source/aqua/CFStringUtilities.hxx
deleted file mode 100644
index b881081e29cf..
--- a/fpicker/source/aqua/CFStringUtilities.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-enum InfoType
-{
-FULLPATH,
-FILENAME,
-PATHWITHOUTLASTCOMPONENT
-};
-
-OUString CFStringToOUString(const CFStringRef sOrig);
-OUString FSRefToOUString(FSRef const& fsRef, InfoType info = FULLPATH);
-OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info);
-CFStringRef CFStringCreateWithOUString(const OUString& aString);
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/CFStringUtilities.mm 
b/fpicker/source/aqua/CFStringUtilities.mm
deleted file mode 100644
index b56f5d38242c..
--- a/fpicker/source/aqua/CFStringUtilities.mm
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include 
-#include "CFStringUtilities.hxx"
-
-OUString CFStringToOUString(const CFStringRef sOrig)
-{
-if (nullptr == sOrig) {
-return OUString();
-}
-
-CFRetain(sOrig);
-CFIndex nFileNameLength = CFStringGetLength(sOrig);
-//SAL_INFO("fpicker.aqua","FH: string length: " << (int)(nFileNameLength));
-UniChar unichars[nFileNameLength+1];
-//'close' the string buffer correctly
-unichars[nFileNameLength] = '\0';
-
-CFStringGetCharacters (sOrig, CFRangeMake(0,nFileNameLength), unichars);
-
-//we no longer need the origina

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - svx/qa svx/source

2021-10-21 Thread Regényi Balázs (via logerrit)
 svx/qa/unit/customshapes.cxx  |   24 +++---
 svx/source/customshapes/EnhancedCustomShape2d.cxx |3 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

New commits:
commit 404d12e9f71efbabf6cd8f5488d8dabf9f086af7
Author: Regényi Balázs 
AuthorDate: Sat Jan 16 13:48:44 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:53:53 2021 +0200

tdf#139549 DOCX import: document got modified at import time

Regression of bda05ba1736b74727872579b65b3fa14e3d8
"tdf#41466 DOCX import: fix VML v:shape/v:textbox".

Co-authored-by: Tünde Tóth

Change-Id: I8762aa8a710c3a37290e1db854b8cc86db6757b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109436
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 2ffdd37067926ddb841c6055205f267b96706945)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123967
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 791588f1984d..dd1b79f4bc60 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -607,9 +607,9 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf127785_Mirror)
 const sal_Int32 nWidthV = aBoundRectV.Width;
 const sal_Int32 nLeftV = aBoundRectV.X;
 const sal_Int32 nTopV = aBoundRectV.Y;
-if (abs(nHeightV - 4149) > 5 || abs(nWidthV - 3819) > 5)
+if (abs(nHeightV - 8000) > 10 || abs(nWidthV - 8000) > 10)
 sErrors += "Flip vertical wrong size.";
-if (abs(nLeftV - 3155) > 5 || abs(nTopV - 3736) > 5)
+if (abs(nLeftV - 1000) > 10 || abs(nTopV - 2000) > 10)
 sErrors += " Flip vertical wrong position.";
 
 uno::Reference xShapeH(getShape(1));
@@ -621,9 +621,9 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf127785_Mirror)
 const sal_Int32 nWidthH = aBoundRectH.Width;
 const sal_Int32 nLeftH = aBoundRectH.X;
 const sal_Int32 nTopH = aBoundRectH.Y;
-if (abs(nHeightH - 4149) > 5 || abs(nWidthH - 3819) > 5)
+if (abs(nHeightH - 8000) > 10 || abs(nWidthH - 8000) > 10)
 sErrors += " Flip horizontal wrong size.";
-if (abs(nLeftH - 15026) > 5 || abs(nTopH - 4115) > 5)
+if (abs(nLeftH - 13000) > 10 || abs(nTopH - 2000) > 10)
 sErrors += " Flip horizontal wrong position.";
 
 CPPUNIT_ASSERT_EQUAL(OUString(), sErrors);
@@ -686,13 +686,13 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf127785_Asymmetric)
 const sal_Int32 nTop = aBoundRect.Y;
 const sal_Int32 nRight = aBoundRect.X + aBoundRect.Width - 1;
 const sal_Int32 nBottom = aBoundRect.Y + aBoundRect.Height - 1;
-if (abs(nLeft - 10034) > 5)
+if (abs(nLeft - 9000) > 10)
 sErrors += "wrong left";
-if (abs(nRight - 12973) > 5)
+if (abs(nRight - 19000) > 10)
 sErrors += " wrong right";
-if (abs(nTop - 7892) > 5)
+if (abs(nTop - 3000) > 10)
 sErrors += " wrong top";
-if (abs(nBottom - 14884) > 5)
+if (abs(nBottom - 18000) > 10)
 sErrors += " wrong bottom";
 
 CPPUNIT_ASSERT_EQUAL(OUString(), sErrors);
@@ -719,13 +719,13 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf127785_TextRotateAngle)
 const sal_Int32 nTop = aBoundRect.Y;
 const sal_Int32 nRight = aBoundRect.X + aBoundRect.Width - 1;
 const sal_Int32 nBottom = aBoundRect.Y + aBoundRect.Height - 1;
-if (abs(nLeft - 5054) > 5)
+if (abs(nLeft - 2000) > 10)
 sErrors += "wrong left";
-if (abs(nRight - 6374) > 5)
+if (abs(nRight - 14000) > 10)
 sErrors += " wrong right";
-if (abs(nTop - 4516) > 5)
+if (abs(nTop - 3000) > 10)
 sErrors += " wrong top";
-if (abs(nBottom - 8930) > 5)
+if (abs(nBottom - 9000) > 10)
 sErrors += " wrong bottom";
 
 CPPUNIT_ASSERT_EQUAL(OUString(), sErrors);
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 556e440e491c..71f51ae7055e 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2866,9 +2866,10 @@ SdrObjectUniquePtr EnhancedCustomShape2d::CreatePathObj( 
bool bLineGeometryNeede
 SdrPathObj* pObj(rCandidate.first.get());
 const drawing::LineStyle 
eLineStyle(pObj->GetMergedItem(XATTR_LINESTYLE).GetValue());
 const drawing::FillStyle 
eFillStyle(pObj->GetMergedItem(XATTR_FILLSTYLE).GetValue());
+const auto pText = pObj->getActiveText();
 
 // #i40600# if bLineGeometryNeededOnly is set, linestyle does not 
matter
-if(bLineGeometryNeededOnly || (drawing::LineStyle_NONE != 
eLineStyle) || (drawing::FillStyle_NONE != eFillStyle))
+if(pText || bLineGeometryNeededOnly || (drawing::LineStyle_NONE != 
eLineStyle) || (drawing::FillStyle_NONE != eFillStyle))
 vNewList.push_back(std::move(rCandidate));
 }
 


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/source

2021-10-21 Thread Tünde Tóth (via logerrit)
 sc/source/ui/dbgui/dbnamdlg.cxx |8 ++--
 sc/source/ui/inc/dbnamdlg.hxx   |1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b74376687e1927d89b00838d384816ae970ea25b
Author: Tünde Tóth 
AuthorDate: Thu Jul 29 10:00:06 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:53:25 2021 +0200

tdf#115520 sc UI: Define Database Range dialog disappeared

if the name of the database range was invalid.

Change-Id: If0eb08d35b2187f04ef93136acd6f7eafa3b588a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119652
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit a07351e8181353c0c0b6df5d2ccbad4615c6706b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123861
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 361a4bae505e..73c924c638df 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -249,6 +249,7 @@ void ScDbNameDlg::Init()
 bSaved = true;
 xSaveObj->Save();
 NameModifyHdl( *m_xEdName );
+bInvalid = false;
 }
 
 void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
@@ -376,17 +377,18 @@ bool ScDbNameDlg::IsRefInputMode() const
 
 IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button&, void)
 {
+bInvalid = false;
 AddBtnHdl(*m_xBtnAdd);
 
 // Pass the changes and the remove list to the view: both are
 // transferred as a reference only, so that no dead memory can
 // be created at this point:
+if (!bInvalid)
 {
 ScDBDocFunc aFunc(*m_rViewData.GetDocShell());
 aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
+response(RET_OK);
 }
-
-response(RET_OK);
 }
 
 IMPL_LINK_NOARG(ScDbNameDlg, CancelBtnHdl, weld::Button&, void)
@@ -468,6 +470,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
 ERRORBOX(m_xDialog.get(), aStrInvalid);
 m_xEdAssign->SelectAll();
 m_xEdAssign->GrabFocus();
+bInvalid = true;
 }
 }
 else
@@ -475,6 +478,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, weld::Button&, void)
 ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
 m_xEdName->select_entry_region(0, -1);
 m_xEdName->grab_focus();
+bInvalid = true;
 }
 }
 
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index fa7cc13dad4f..f179f783f177 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -42,6 +42,7 @@ public:
 
 private:
 boolbSaved;
+boolbInvalid;
 
 OUStringaStrAdd;
 OUStringaStrModify;


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - oox/source sw/qa

2021-10-21 Thread Tünde Tóth (via logerrit)
 oox/source/drawingml/chart/axisconverter.cxx |   10 ++
 sw/qa/extras/layout/data/tdf15.docx  |binary
 sw/qa/extras/layout/layout2.cxx  |   16 +++-
 3 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 00819f71e5cbaa81e8e9b381d5472c4eea6e1edd
Author: Tünde Tóth 
AuthorDate: Wed Jun 2 11:51:13 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:52:44 2021 +0200

tdf#140623 Chart OOXML import: set text overlap to false

of category axis label unless the rotation is 0 in xml.

Regression from commit: 21620f9d2f50e66dffc45a5afb539edb8d54434c
(tdf#138194 Chart OOXML import: set text break to true)

Change-Id: I18db7483f49c84a83760200037f8858a3b471994
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116575
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 6185d1ff0130b3d178d5e50eeb6944ab70db41f9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123859
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index 1a8e23024612..7aa141c0f798 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -271,10 +271,12 @@ void AxisConverter::convertFromModel(const 
Reference& rxCoord
 }
 else
 {
-// do not overlap text when the rotation is undefined in 
xml
-bool bTextOverlap
-= mrModel.mxTextProp.is()
-  && 
mrModel.mxTextProp->getTextProperties().moRotation.has();
+// do not overlap text unless the rotation is 0 in xml
+bool bTextOverlap = false;
+if (mrModel.mxTextProp.is()
+&& 
mrModel.mxTextProp->getTextProperties().moRotation.has())
+bTextOverlap
+= 
mrModel.mxTextProp->getTextProperties().moRotation.get() == 0;
 aAxisProp.setProperty(PROP_TextOverlap, bTextOverlap);
 /* do not break text into several lines unless the 
rotation is 0 degree,
or the rotation is 90 degree and the inner size of the 
chart is not fixed,
diff --git a/sw/qa/extras/layout/data/tdf15.docx 
b/sw/qa/extras/layout/data/tdf15.docx
index 2b2b24a5548d..e4f0cc35f0e8 100644
Binary files a/sw/qa/extras/layout/data/tdf15.docx and 
b/sw/qa/extras/layout/data/tdf15.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 8cb41dde9b35..7a8fc8629cd1 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -412,7 +412,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707)
 assertXPath(pXmlDoc, 
"//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds", "top", "2185");
 }
 
-#if HAVE_MORE_FONTS
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf15)
 {
 SwDoc* pDoc = createDoc("tdf15.docx");
@@ -424,12 +423,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf15)
 xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
 CPPUNIT_ASSERT(pXmlDoc);
 
-assertXPathContent(pXmlDoc,
-   
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[8]/text",
-   "Advanced Diploma");
+// Bug 15 - FILEOPEN DOCX Textbox of Column chart legend reduces and 
text of legend disappears
+const sal_Int32 nLegendLabelLines
+= getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Advanced 
Diploma\")])")
+  .toInt32();
 // This failed, if the legend label is not "Advanced Diploma".
+CPPUNIT_ASSERT_EQUAL(static_cast(1), nLegendLabelLines);
+
+// Bug 140623 - Fileopen DOCX: Text Orientation of X-Axis 0 instead of 45 
degrees
+const sal_Int32 nThirdLabelLines
+= getXPathContent(pXmlDoc, 
"count(//text[contains(text(),\"Hispanic\")])").toInt32();
+// This failed, if the third X axis label broke to multiple lines.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), nThirdLabelLines);
 }
-#endif
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335)
 {


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - chart2/qa chart2/source

2021-10-21 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   43 +++
 chart2/qa/extras/data/docx/tdf139658.docx|binary
 chart2/source/tools/InternalDataProvider.cxx |   12 ++-
 3 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit 41ec18183acbe6cf82b79e5b150eaf7b2b5f3a62
Author: Tünde Tóth 
AuthorDate: Fri Jun 4 13:10:51 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:52:24 2021 +0200

tdf#139658 OOXML: fix broken chart import at labels with quotes

During the import of the internal data table, incomplete
parsing of category labels with escaped quotation marks
resulted broken category labels and charts.

Change-Id: If5af3d527b80d1e055562f589bdaf17096ad49f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116714
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123893
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index fe9ebb5bc502..d891756da179 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -174,6 +174,8 @@ public:
 void testTdf137734();
 void testTdf137874();
 void testTdfCustomShapePos();
+void testTdf121281();
+void testTdf139658();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -295,6 +297,8 @@ public:
 CPPUNIT_TEST(testTdf137734);
 CPPUNIT_TEST(testTdf137874);
 CPPUNIT_TEST(testTdfCustomShapePos);
+CPPUNIT_TEST(testTdf121281);
+CPPUNIT_TEST(testTdf139658);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2845,6 +2849,45 @@ void Chart2ImportTest::testTdfCustomShapePos()
 }
 }
 
+void Chart2ImportTest::testTdf121281()
+{
+load(u"/chart2/qa/extras/data/xlsx/", "incorrect_label_position.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(
+getShapeByName(xShapes,
+   
"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+// This failed, if the data label flowed out of the chart area.
+CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aLabelPosition.Y);
+}
+
+void Chart2ImportTest::testTdf139658()
+{
+load(u"/chart2/qa/extras/data/docx/", "tdf139658.docx");
+uno::Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference 
xInternalProvider(xChartDoc->getDataProvider(),
+   uno::UNO_QUERY);
+CPPUNIT_ASSERT(xInternalProvider.is());
+
+Reference xDescAccess(xInternalProvider, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDescAccess.is());
+
+// Get the category labels.
+Sequence aCategories = xDescAccess->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aCategories.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("category1"), aCategories[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("\"category2\""), aCategories[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("category\"3"), aCategories[2]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/tdf139658.docx 
b/chart2/qa/extras/data/docx/tdf139658.docx
new file mode 100644
index ..59deda9f83f9
Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf139658.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index c1d0008098ab..415f08ac3ea9 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -518,7 +518,14 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 bool bInQuote = false;
 for (; p != pEnd; ++p)
 {
-if (*p == '"')
+// Skip next "" within the title text: it's an escaped double 
quotation mark.
+if (bInQuote && *p == '"' && *(p + 1) == '"')
+{
+if (!pElem)
+pElem = p;
+++p;
+}
+else if (*p == '"')
 {
 bInQuote = !bInQuote;
 if (bInQuote)
@@ -534,7 +541,8 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 // Non empty string
 if (!aElem.isEmpty())
 bAllNumeric = false;
-aRawElems.push_back(aElem);
+// Restore also escaped double quotation marks
+aRawElems.push_bac

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sd/qa sd/source

2021-10-21 Thread Attila Bakos (NISZ) (via logerrit)
 sd/qa/uitest/impress_tests/data/tdf127900.fodp |  778 +
 sd/qa/uitest/impress_tests/tdf127900.py|   39 +
 sd/source/ui/view/drawview.cxx |3 
 3 files changed, 819 insertions(+), 1 deletion(-)

New commits:
commit 90d79c4703e81c3b8b2b9db9cee679fb964f325a
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Aug 24 16:48:07 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:51:55 2021 +0200

tdf#127900 sd: fix regression at applying master properties

Language settings of frames in slide master weren't applied
on the slides based on that master.

Regression since LO 6.3 by "tdf#126067 Fix slide scope
feature." (commit 40bb9ac690d979ef544d5aa759bd734a176912a0).

Co-developed-by: Dániel Arató (NISZ)

Change-Id: I559adbe00870ed8a3d2947fef8dae435a387e34a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120993
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit ca5e344aec6a5848831101bc0d623b2bac754b6e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123862
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sd/qa/uitest/impress_tests/data/tdf127900.fodp 
b/sd/qa/uitest/impress_tests/data/tdf127900.fodp
new file mode 100644
index ..adedafc2757a
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/data/tdf127900.fodp
@@ -0,0 +1,778 @@
+
+
+http://openoffice.org/2004/office"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns
 :css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" 
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+ 
2021-08-30T08:55:10.39400LibreOffice/7.1.1.2$Windows_X86_64
 
LibreOffice_project/fe0b08f4af1bacafe4c7ecc87ce55bb4261646762021-08-30T08:56:29.11600PT7S1
+ 
+  
+   0
+   0
+   14099
+   
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ Hw==
+ Hw==
+ 
+ false
+ true
+ false
+ 0
+ 1
+ false
+ true
+ true
+ 4
+ 0
+ -974
+ -423
+ 28894
+ 17739
+ 2000
+ 2000
+ 500
+ 500
+ 2000
+ 4
+ 2000
+ 4
+ false
+ 1500
+ true
+ false
+
+   
+  
+  
+   true
+   $(inst)/share/palette%3B$(user)/config/standard.sob
+   0
+   $(inst)/share/palette%3B$(user)/config/standard.soc
+   $(inst)/share/palette%3B$(user)/config/standard.sod
+   1250
+   true
+   true
+   false
+   true
+   false
+   $(inst)/share/palette%3B$(user)/config/standard.sog
+   true
+   $(inst)/share/palette%3B$(user)/config/standard.soh
+   false
+   false
+   true
+   true
+   false
+   true
+   false
+   false
+   true
+   false
+   false
+   false
+   false
+   false
+   $(inst)/share/palette%3B$(user)/config/standard.soe
+   false
+   4
+   false
+   0
+   low-resolution
+   Microsoft Print to PDF
+   false
+   GRb+/01pY3Jvc29mdCBQcmludCB0by

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Attila Bakos (NISZ) (via logerrit)
 sw/qa/uitest/data/tdf142847.fodt|   49 
 sw/qa/uitest/writer_tests5/tdf142847.py |   39 +
 sw/source/core/doc/docfmt.cxx   |   10 ++
 sw/source/core/doc/textboxhelper.cxx|   10 +-
 sw/source/core/text/porfly.cxx  |3 +
 5 files changed, 109 insertions(+), 2 deletions(-)

New commits:
commit 6df1ea43d565035fd2edf71b7ab7103beeaffb55
Author: Attila Bakos (NISZ) 
AuthorDate: Fri Jul 2 11:29:58 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:51:28 2021 +0200

tdf#142847 sw: fix textbox layout at wrap setting

Setting wrap spacing of a textbox via its Wrap->Edit...
dialog window, the textbox had fallen apart, if it
was anchored as character.

Change-Id: I6c48c7a631a93a874129f64e1bdc6b3e2051e64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118281
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123959
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/uitest/data/tdf142847.fodt b/sw/qa/uitest/data/tdf142847.fodt
new file mode 100644
index ..5ceed7151808
--- /dev/null
+++ b/sw/qa/uitest/data/tdf142847.fodt
@@ -0,0 +1,49 @@
+
+
+http://openoffice.org/2004/office"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns
 :css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:officeooo="http://openoffice.org/2009/office"; office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
2021-08-25T15:50:24.33400PT5M16S4LibreOffice/7.1.1.2$Windows_X86_64
 
LibreOffice_project/fe0b08f4af1bacafe4c7ecc87ce55bb426164676
+ 
+  
+  
+  
+  
+  
+  
+  
+  
+  
+ 
+ 
+  
+   
+  
+  
+   
+  
+  
+   
+
+   
+   
+   
+  
+ 
+ 
+  
+ 
+ 
+  
+   
+
+
+
+
+
+   
+   Xx xx x xx x x xx  x x x xx 
x x xx x x x x xx x x x xx xx x xx x x x x x x x x x x xx 
x x x x  x x x x x xxx  Xx xx x xx x x xx  x x x xx x 
x xx x x x x xx x x x xx xx x xx x x x x x x x x x x xx x 
x x x
+ 
+ 
+  x x x x x xx xXx xx x xx x x xx  x 
x x xx x x xx x x x x xx x x x xx xx x xx x x x 
x x x x x x x xx x x x x  x x x x x xx xXx xx x xx x x xx  x 
x x xx x x xx x x x x xx x x x xx xx x xx x x x 
x x x x x x x xx x x x x  x x x x x x  xxXx xx x xx x x xx  x 
x x xx x x xx x x x x xx x x x xx xx x xx x x x 
x x x x x x x xx x x x x  x x x x x   xxxXx xx x xx x x xx  x 
x x xx x x xx x x x x xx x x x xx xx x xx x x x 
x x x x x x x xx x x x x  x x x x x x xx
+  
+ 
+
\ No newline at end of file
diff --git a/sw/qa/uitest/writer_tests5/tdf142847.py 
b/sw/qa/uitest/writer_tests5/tdf142847.py
new file mode 100644
index ..bddc64e0e13c
--- /dev/null
+++ b/sw/qa/uitest/writer_tests5/tdf142847.py
@@ -0,0 +1,39 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+import or

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/data/tdf142130.fodt |   37 
 sw/qa/extras/uiwriter/uiwriter2.cxx   |   39 ++
 sw/source/core/text/porlay.cxx|6 +---
 sw/source/core/text/redlnitr.cxx  |4 +--
 sw/source/core/text/redlnitr.hxx  |3 +-
 5 files changed, 82 insertions(+), 7 deletions(-)

New commits:
commit 4c4c8acd4329b28fab8680454c033e43d49362af
Author: László Németh 
AuthorDate: Fri May 7 17:01:10 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 10:23:27 2021 +0200

tdf#142130 sw track changes: fix crossing out of neighboring images

Normal images got crossing out from the next deleted images.
Fix it by using only the start position of the image in CheckLine()
instead of the 1-character length range of the anchor point.

Note: add unit test also for tdf#78864.

Follow-up to commit d845b91bcc6eb885c55494d4d4fab4ec09577e1d
(tdf#78864 sw track changes: cross out deleted images).

Change-Id: I8894e625d479adea4b1003f55f24f292064ed7ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115255
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit b11287cda0ce308f5fddac4c0877718fec7c70a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123968
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/data/tdf142130.fodt 
b/sw/qa/extras/uiwriter/data/tdf142130.fodt
new file mode 100644
index ..1bc26e6acf22
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf142130.fodt
@@ -0,0 +1,37 @@
+
+http://purl.org/dc/elements/1.1/"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+  
+   
+  
+ 
+ 
+  
+   
+
+ 
+  
+   X
+   2021-05-07T17:32:23
+  
+ 
+
+   
+   
+  
iVBORw0KGgoNSUhEUgEBCAIAAACQd1PeBmJLR0QA/wD/AP+gvaeT
+   CXBIWXMAAAsTAAALEwEAmpwYB3RJTUUH5QUGCg8pr2vxSB1pVFh0Q29tbWVudAAA
+   Q3JlYXRlZCB3aXRoIEdJTVBkLmUHDElEQVQI12N4stkEAARKAcxTwEa2AElF
+   TkSuQmCC
+  
+ 
+
+  
iVBORw0KGgoNSUhEUgEBCAA6fptVAmJLR0QA/4ePzL8JcEhZ
+   cwAACxMAAAsTAQCanBgHdElNRQflBQYKGR4LTuGQCklEQVQI12M4DwAA0QDQfVbA
+   HQBJRU5ErkJggg==
+  
+ 
+
+  
+ 
+
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 29bbb8dbb7ba..259687baf470 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2141,6 +2141,45 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137771)
 CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
+{
+load(DATA_DIRECTORY, "tdf142130.fodt");
+
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+
+//turn on red-lining and show changes
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// Dump the rendering of the first page as an XML file.
+SwDocShell* pShell = pTextDoc->GetDocShell();
+std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// This was 6 (crossing out of the first, not deleted image)
+// (4 lines = 2 lines for crossing out of the second image, 2 lines for the
+// vertical lines before the two lines)
+assertXPath(pXmlDoc, "/metafile/push/push/push/line", 4);
+
+// reject deletion of the second image
+IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+rIDRA.AcceptAllRedline(false);
+
+xMetaFile = pShell->GetPreviewMetaFile();
+xmlDocUniquePtr pXmlDoc2 = dumpAndParse(dumper, *xMetaFile);
+// no crossing out and vertical redlines
+assertXPath(pXmlDoc2, "/metafile/push/push/push/line", 0);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120)
 {
 SwDoc* pDoc = createDoc("tdf54819.fodt");
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 8c070715a79b..74cd12b372a6 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -646,11 +646,9 @@

[Libreoffice-commits] dev-tools.git: esc-reporting/esc-analyze.py

2021-10-21 Thread Xisco Fauli (via logerrit)
 esc-reporting/esc-analyze.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8c12b9258b87049a24c2decc3e384554014f190c
Author: Xisco Fauli 
AuthorDate: Thu Oct 21 10:15:48 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 21 10:15:48 2021 +0200

esc-analyze: fix analyze_documentation failed with 'committer'

Change-Id: I50bd242ddc8f029dd9a4738ee7b371c4fa59e6bb

diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py
index 074e2d5..4b08459 100755
--- a/esc-reporting/esc-analyze.py
+++ b/esc-reporting/esc-analyze.py
@@ -122,7 +122,7 @@ def util_build_period_stat(xDate, email, base, 
peopleTarget=None, dataTarget=Non
 xType = 'contributor'
 if email:
   statList['people'][email][base]['total'] += 1
-  if statList['people'][email]['isCommitter'] and base != 'ui':
+  if statList['people'][email]['isCommitter'] and base != 'ui' and base != 
'documentation':
 xType = 'committer'
 if dataTarget:
   statList['data'][base][xType]['total'] += 1


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - include/svx svx/qa svx/source

2021-10-21 Thread Noel (via logerrit)
 include/svx/EnhancedCustomShape2d.hxx |   10 -
 svx/qa/unit/customshapes.cxx  |   12 +
 svx/source/customshapes/EnhancedCustomShape2d.cxx |  111 +++---
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |4 
 4 files changed, 63 insertions(+), 74 deletions(-)

New commits:
commit 3dcd7d8e412e2f05a213695eeb3ea2a296e9da73
Author: Noel 
AuthorDate: Wed Feb 3 08:59:13 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 10:07:04 2021 +0200

use more unique_ptr in EnhancedCustomShape2d

and fix some leaks in the unit tests

Change-Id: I8d324a24de11b14b4820e3cdd7f078d5877489e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110288
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123954
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/include/svx/EnhancedCustomShape2d.hxx 
b/include/svx/EnhancedCustomShape2d.hxx
index 8976b2bdb106..a01e8411b9c7 100644
--- a/include/svx/EnhancedCustomShape2d.hxx
+++ b/include/svx/EnhancedCustomShape2d.hxx
@@ -22,6 +22,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -141,11 +143,11 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d : public 
SfxItemSet
 SAL_DLLPRIVATE void CreateSubPath(
 sal_Int32& rSrcPt,
 sal_Int32& rSegmentInd,
-std::vector< std::pair< SdrPathObj*, double> >& rObjectList,
+std::vector< std::pair< SdrPathObjUniquePtr, double> >& 
rObjectList,
 bool bLineGeometryNeededOnly,
 bool bSortFilledObjectsToBack,
 sal_Int32 nIndex);
-SAL_DLLPRIVATE SdrObject* CreatePathObj( bool bLineGeometryNeededOnly 
);
+SAL_DLLPRIVATE SdrObjectUniquePtr CreatePathObj( bool 
bLineGeometryNeededOnly );
 SAL_DLLPRIVATE void ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rItem );
 
 SAL_DLLPRIVATE void SetPathSize( sal_Int32 nIndex = 0 );
@@ -185,8 +187,8 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d : public 
SfxItemSet
 SAL_DLLPRIVATE bool IsFlipHorz() const { return bFlipH; };
 SAL_DLLPRIVATE sal_Int32 GetRotateAngle() const { return nRotateAngle; 
};
 
-SdrObject*  CreateLineGeometry();
-SdrObject*  CreateObject( bool bLineGeometryNeededOnly );
+SdrObjectUniquePtr  CreateLineGeometry();
+SdrObjectUniquePtr  CreateObject( bool bLineGeometryNeededOnly );
 voidApplyGluePoints( SdrObject* pObj );
 tools::RectangleGetTextRect() const;
 const tools::Rectangle& GetLogicRect() const { return aLogicRect; }
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index db7808a16f2f..791588f1984d 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -383,7 +383,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf121845_two_commands_U)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(2),
@@ -811,7 +812,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf103474_commandT_CaseZeroHeight)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(1),
@@ -841,7 +843,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf103474_commandG_CaseZeroHeight)
 SdrObjCustomShape& rSdrObjCustomShape(
 static_cast(*GetSdrObjectFromXShape(xShape)));
 EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape);
-SdrPathObj* pPathObj = 
static_cast(aCustomShape2d.CreateLineGeometry());
+SdrPathObjUniquePtr pPathObj(
+
static_cast(aCustomShape2d.CreateLineGeometry().release()));
 CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj);
 const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly());
 CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", static_cast(1),
@@ -871,7 +874,8 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf122323

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - chart2/qa offapi/com oox/source sc/inc sc/qa sc/source

2021-10-21 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx |   17 +++
 chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx |binary
 offapi/com/sun/star/sheet/FormulaParser.idl   |   10 ++
 oox/source/export/chartexport.cxx |2 
 oox/source/token/properties.txt   |1 
 sc/inc/compiler.hxx   |3 
 sc/inc/tokenuno.hxx   |1 
 sc/inc/unonames.hxx   |1 
 sc/qa/uitest/chart/tdf64086.py|   31 +++
 sc/qa/uitest/data/tdf64086.xlsx   |binary
 sc/source/core/tool/compiler.cxx  |   27 +-
 sc/source/core/tool/reftokenhelper.cxx|   20 
 sc/source/ui/unoobj/chart2uno.cxx |   79 +++---
 sc/source/ui/unoobj/tokenuno.cxx  |   15 ++-
 14 files changed, 192 insertions(+), 15 deletions(-)

New commits:
commit 464a95c90f7b00c9edbd906b335fa7dfaee73e50
Author: Balazs Varga 
AuthorDate: Tue Jul 13 18:03:28 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 10:05:34 2021 +0200

tdf#64086 tdf#143623 tdf#66250 XLSX: fix named ranges in charts

tdf#64086: fix broken XLSX import of named ranges in charts

Do not create inner data table in Calc for charts, if the
data source contains named ranges. Use the named ranges
(local sheet names and global names) to find the data
source of charts, so it will be updated correctly if we
modify the values in cells.

Second part:

tdf#143623: chart OOXML, offapi: export the named ranges in charts

with the proper special (non-ooxml-standard) Excel syntax.
We need to add "[0]" characters before a global named range
for proper refreshing of chart data. Also we have to add the
sheet name to the local named ranges even if it's on the same
sheet, but only in case of charts. Because of this, add property
RefConventionChartOOXML to com::sun::star::sheet::FormulaParser,
which specifies that use special OOXML chart syntax in case of
OOXML reference convention, when parsing a formula string.

Third part:

tdf#66250 ODF chart: export the reference of named ranges

in case of charts, if the named range contains a valid reference.

Note: maybe export the name of named ranges would be a nicer
solution in the future.

Follow-up of commit 3c766512984feff739377d0f0af46558ee7139fd
"Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML()".

Thanks to Eike Rathke for his help.

Change-Id: I10d8563fb436092e833682f331c25b0c0829ef86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118862
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123896
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index d0cd3be67d66..f6416c385ced 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -186,6 +186,7 @@ public:
 void testTdf138181();
 void testCustomShapeText();
 void testuserShapesXLSX();
+void testNameRangeXLSX();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -334,6 +335,7 @@ public:
 CPPUNIT_TEST(testTdf138181);
 CPPUNIT_TEST(testCustomShapeText);
 CPPUNIT_TEST(testuserShapesXLSX);
+CPPUNIT_TEST(testNameRangeXLSX);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -3086,6 +3088,21 @@ void Chart2ExportTest::testuserShapesXLSX()
 CPPUNIT_ASSERT(!xRange->getString().isEmpty());
 }
 
+void Chart2ExportTest::testNameRangeXLSX()
+{
+load(u"/chart2/qa/extras/data/xlsx/", "chart_with_name_range.xlsx");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
+CPPUNIT_ASSERT(pXmlDoc);
+// test the syntax of local range name on the the local sheet.
+assertXPathContent(pXmlDoc,
+"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:f",
+"Sheet1!local_name_range");
+// test the syntax of a global range name.
+assertXPathContent(pXmlDoc,
+"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:val/c:numRef/c:f",
+"[0]!series1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx 
b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx
new file mode 100644
index ..2f2b814011ff
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx differ
diff --git a/offapi/com/sun/star/sheet/FormulaParser.idl 
b/offapi/com/sun/star/sheet/FormulaParser.idl
index 2c1145ec1369..fb9085130341 100644
--- a/offapi/com/sun/star/sheet/FormulaParser.idl
+++ b/offapi/com/sun/star/sheet/FormulaParser.

[Libreoffice-commits] core.git: osx/soffice.xcodeproj

2021-10-21 Thread Tor Lillqvist (via logerrit)
 osx/soffice.xcodeproj/project.pbxproj |   64 ++
 1 file changed, 64 insertions(+)

New commits:
commit f1b5443217c89a577226faa39408acdc807c4fe4
Author: Tor Lillqvist 
AuthorDate: Thu Oct 21 10:21:04 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 21 10:04:17 2021 +0200

Add source files from fpicker/source/aqua

Change-Id: I10e84beb550c9e0410c35fe85db407fa1dceb5b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123955
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/osx/soffice.xcodeproj/project.pbxproj 
b/osx/soffice.xcodeproj/project.pbxproj
index cb8298358d22..ab7670ea2a81 100644
--- a/osx/soffice.xcodeproj/project.pbxproj
+++ b/osx/soffice.xcodeproj/project.pbxproj
@@ -632,6 +632,30 @@
BE82C42418C86E010050EB79 /* spinfld.cxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = spinfld.cxx; 
path = ../vcl/source/control/spinfld.cxx; sourceTree = ""; };
BE82C42518C86E010050EB79 /* tabctrl.cxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = tabctrl.cxx; 
path = ../vcl/source/control/tabctrl.cxx; sourceTree = ""; };
BE82C42618C86E010050EB79 /* throbber.cxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = throbber.cxx; 
path = ../vcl/source/control/throbber.cxx; sourceTree = ""; };
+   BE96F5D627214BBD00134D66 /* SalAquaPicker.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
SalAquaPicker.mm; path = ../fpicker/source/aqua/SalAquaPicker.mm; sourceTree = 
""; };
+   BE96F5D727214BBD00134D66 /* SalAquaPicker.hxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
SalAquaPicker.hxx; path = ../fpicker/source/aqua/SalAquaPicker.hxx; sourceTree 
= ""; };
+   BE96F5D827214BBE00134D66 /* AquaFilePickerDelegate.mm */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
AquaFilePickerDelegate.mm; path = 
../fpicker/source/aqua/AquaFilePickerDelegate.mm; sourceTree = ""; };
+   BE96F5D927214BBE00134D66 /* fps_aqua.component */ = {isa = 
PBXFileReference; lastKnownFileType = text.xml; name = fps_aqua.component; path 
= ../fpicker/source/aqua/fps_aqua.component; sourceTree = ""; };
+   BE96F5DA27214BBE00134D66 /* FilterHelper.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
FilterHelper.mm; path = ../fpicker/source/aqua/FilterHelper.mm; sourceTree = 
""; };
+   BE96F5DB27214BBE00134D66 /* CFStringUtilities.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
CFStringUtilities.mm; path = ../fpicker/source/aqua/CFStringUtilities.mm; 
sourceTree = ""; };
+   BE96F5DC27214BBE00134D66 /* SalAquaFolderPicker.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
SalAquaFolderPicker.mm; path = ../fpicker/source/aqua/SalAquaFolderPicker.mm; 
sourceTree = ""; };
+   BE96F5DD27214BBE00134D66 /* FilterHelper.hxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
FilterHelper.hxx; path = ../fpicker/source/aqua/FilterHelper.hxx; sourceTree = 
""; };
+   BE96F5DE27214BBE00134D66 /* resourceprovider.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
resourceprovider.mm; path = ../fpicker/source/aqua/resourceprovider.mm; 
sourceTree = ""; };
+   BE96F5DF27214BBE00134D66 /* CFStringUtilities.hxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
CFStringUtilities.hxx; path = ../fpicker/source/aqua/CFStringUtilities.hxx; 
sourceTree = ""; };
+   BE96F5E027214BBE00134D66 /* SalAquaFolderPicker.hxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
SalAquaFolderPicker.hxx; path = ../fpicker/source/aqua/SalAquaFolderPicker.hxx; 
sourceTree = ""; };
+   BE96F5E127214BBE00134D66 /* AquaFilePickerDelegate.hxx */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
AquaFilePickerDelegate.hxx; path = 
../fpicker/source/aqua/AquaFilePickerDelegate.hxx; sourceTree = ""; };
+   BE96F5E227214BBE00134D66 /* NSURL_OOoAdditions.hxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = 
NSURL_OOoAdditions.hxx; path = ../fpicker/source/aqua/NSURL_OOoAdditions.hxx; 
sourceTree = ""; };
+   BE96F5E327214BBF00134D66 /* SalAquaFilePicker.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = 
SalAquaFilePicker.mm; path = ../fpicker/source/aqua/SalAquaFilePicker.mm; 
sourceTree = ""; };
+   BE96F5E427214BBF00134D66 /* FPentry.mm */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = FPentry.mm; 
path = ../fpicker/source/aqua/FPentry.mm; sourceTree = ""; };
+   B

[Libreoffice-commits] core.git: vcl/StaticLibrary_fuzzerstubs.mk vcl/workben

2021-10-21 Thread Caolán McNamara (via logerrit)
 vcl/StaticLibrary_fuzzerstubs.mk|1 
 vcl/workben/localestub/localedata_en_IL.cxx |  131 
 2 files changed, 132 insertions(+)

New commits:
commit 4b1572b94e5d5b106eddabeb238f5239063e25a0
Author: Caolán McNamara 
AuthorDate: Thu Oct 21 08:42:17 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 21 10:03:46 2021 +0200

ofz#40166 fix build failure

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

diff --git a/vcl/StaticLibrary_fuzzerstubs.mk b/vcl/StaticLibrary_fuzzerstubs.mk
index e79e1932be80..ad1a206d8533 100644
--- a/vcl/StaticLibrary_fuzzerstubs.mk
+++ b/vcl/StaticLibrary_fuzzerstubs.mk
@@ -30,6 +30,7 @@ $(eval $(call 
gb_StaticLibrary_add_exception_objects,fuzzerstubs,\
 vcl/workben/localestub/localedata_en_GM \
 vcl/workben/localestub/localedata_en_HK \
 vcl/workben/localestub/localedata_en_IE \
+vcl/workben/localestub/localedata_en_IL \
 vcl/workben/localestub/localedata_en_IN \
 vcl/workben/localestub/localedata_en_KE \
 vcl/workben/localestub/localedata_en_JM \
diff --git a/vcl/workben/localestub/localedata_en_IL.cxx 
b/vcl/workben/localestub/localedata_en_IL.cxx
new file mode 100644
index ..bea5731a7454
--- /dev/null
+++ b/vcl/workben/localestub/localedata_en_IL.cxx
@@ -0,0 +1,131 @@
+#include 
+
+#include 
+
+extern "C" {
+
+static const sal_Unicode langID[] = { 0x65, 0x6e, 0x0 };
+static const sal_Unicode langDefaultName[] = { 0x45, 0x6e, 0x67, 0x6c, 0x69, 
0x73, 0x68, 0x0 };
+static const sal_Unicode countryID[] = { 0x49, 0x4c, 0x0 };
+static const sal_Unicode countryDefaultName[] = { 0x49, 0x73, 0x72, 0x61, 
0x65, 0x6c, 0x0 };
+static const sal_Unicode Variant[] = { 0x0 };
+
+static const sal_Unicode* LCInfoArray[]
+= { langID, langDefaultName, countryID, countryDefaultName, Variant };
+
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getLCInfo_en_IL(sal_Int16& count)
+{
+count = SAL_N_ELEMENTS(LCInfoArray);
+return (sal_Unicode**)LCInfoArray;
+}
+extern sal_Unicode** SAL_CALL getLocaleItem_he_IL(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getLocaleItem_en_IL(sal_Int16& 
count)
+{
+return getLocaleItem_he_IL(count);
+}
+static const sal_Unicode replaceTo0[]
+= { 0x5b, 0x24, 0x200e, 0x20aa, 0x2d, 0x42, 0x34, 0x30, 0x39, 0x5d, 0x0 };
+extern sal_Unicode const* const* SAL_CALL getAllFormats0_he_IL(sal_Int16& 
count,
+   const 
sal_Unicode*& from,
+   const 
sal_Unicode*& to);
+SAL_DLLPUBLIC_EXPORT sal_Unicode const* const* SAL_CALL
+getAllFormats0_en_IL(sal_Int16& count, const sal_Unicode*& from, const 
sal_Unicode*& to)
+{
+to = replaceTo0;
+const sal_Unicode* tmp;
+return getAllFormats0_he_IL(count, from, tmp);
+}
+extern sal_Unicode** SAL_CALL getDateAcceptancePatterns_he_IL(sal_Int16& 
count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getDateAcceptancePatterns_en_IL(sal_Int16& count)
+{
+return getDateAcceptancePatterns_he_IL(count);
+}
+static const sal_Unicode replaceTo1[] = { 0x0 };
+extern sal_Unicode const* const* SAL_CALL getAllFormats1_en_US(sal_Int16& 
count,
+   const 
sal_Unicode*& from,
+   const 
sal_Unicode*& to);
+SAL_DLLPUBLIC_EXPORT sal_Unicode const* const* SAL_CALL
+getAllFormats1_en_IL(sal_Int16& count, const sal_Unicode*& from, const 
sal_Unicode*& to)
+{
+to = replaceTo1;
+const sal_Unicode* tmp;
+return getAllFormats1_en_US(count, from, tmp);
+}
+extern sal_Unicode** SAL_CALL getCollatorImplementation_en_US(sal_Int16& 
count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getCollatorImplementation_en_IL(sal_Int16& count)
+{
+return getCollatorImplementation_en_US(count);
+}
+extern sal_Unicode** SAL_CALL getCollationOptions_en_US(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL 
getCollationOptions_en_IL(sal_Int16& count)
+{
+return getCollationOptions_en_US(count);
+}
+extern sal_Unicode** SAL_CALL getSearchOptions_en_US(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getSearchOptions_en_IL(sal_Int16& 
count)
+{
+return getSearchOptions_en_US(count);
+}
+extern sal_Unicode** SAL_CALL getIndexAlgorithm_en_US(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getIndexAlgorithm_en_IL(sal_Int16& 
count)
+{
+return getIndexAlgorithm_en_US(count);
+}
+extern sal_Unicode** SAL_CALL getUnicodeScripts_en_US(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CALL getUnicodeScripts_en_IL(sal_Int16& 
count)
+{
+return getUnicodeScripts_en_US(count);
+}
+extern sal_Unicode** SAL_CALL getFollowPageWords_en_US(sal_Int16& count);
+SAL_DLLPUBLIC_EXPORT sal_Unicode** SAL_CAL

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/qa sc/source

2021-10-21 Thread Balazs Varga (via logerrit)
 sc/qa/uitest/autofilter/autofilter.py  |   23 +++
 sc/qa/uitest/data/autofilter/tdf144253.ods |binary
 sc/source/core/data/table3.cxx |2 +-
 sc/source/core/tool/cellform.cxx   |2 +-
 4 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 7640a5b3f32c53f8b4e4319ffcbf515d47f112f7
Author: Balazs Varga 
AuthorDate: Mon Sep 6 12:02:54 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:56:03 2021 +0200

tdf#144253 tdf#144324 sc filter: use formatted values in filters

if the results of formulas are values.

Followed up of 40acda4e78127fa9f513646ef210b074d40cf307
(Related: tdf#140968 avoid duplicated filter values)

Change-Id: Ib396d2b7cc08ba41b5936a53a28b5e38bf678b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121715
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 51375b48378915b6e95c1ac26b2ccf8e39880f7e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123863
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sc/qa/uitest/autofilter/autofilter.py 
b/sc/qa/uitest/autofilter/autofilter.py
index 4aeb6d4c0a87..10ce0fcf4199 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -517,4 +517,27 @@ class AutofilterTest(UITestCase):
 
 self.ui_test.close_doc()
 
+def test_tdf144253(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf144253.ods")) as 
doc:
+
+xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "4", "ROW": "0"}))
+xFloatWindow = self.xUITest.getFloatWindow()
+xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+xTreeList = xCheckListMenu.getChild("check_list_box")
+self.assertEqual(2, len(xTreeList.getChildren()))
+self.assertEqual("65.43", 
get_state_as_dict(xTreeList.getChild('0'))['Text'])
+self.assertEqual("83.33", 
get_state_as_dict(xTreeList.getChild('1'))['Text'])
+
+xFirstEntry = xTreeList.getChild("1")
+xFirstEntry.executeAction("CLICK", tuple())
+
+xOkBtn = xFloatWindow.getChild("ok")
+xOkBtn.executeAction("CLICK", tuple())
+
+self.assertFalse(is_row_hidden(doc, 0))
+self.assertTrue(is_row_hidden(doc, 1))
+self.assertFalse(is_row_hidden(doc, 2))
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/autofilter/tdf144253.ods 
b/sc/qa/uitest/data/autofilter/tdf144253.ods
new file mode 100644
index ..d2581904d0ac
Binary files /dev/null and b/sc/qa/uitest/data/autofilter/tdf144253.ods differ
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 04f502277505..5a63055016df 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2348,7 +2348,7 @@ public:
 nCellVal = mrDoc.RoundValueAsShown(rCell.mfValue, nNumFmt, 
pContext);
 break;
 case CELLTYPE_FORMULA :
-nCellVal = rCell.mpFormula->GetValue();
+nCellVal = 
mrDoc.RoundValueAsShown(rCell.mpFormula->GetValue(), nNumFmt, pContext);
 break;
 default:
 nCellVal = 0.0;
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index abc13f254677..fe188847350e 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -135,7 +135,7 @@ void ScCellFormat::GetInputString(
 if (pFC->IsEmptyDisplayedAsString())
 rString = EMPTY_OUSTRING;
 else if (pFC->IsValue())
-rFormatter.GetInputLineString(pFC->GetValue(), nFormat, 
rString);
+rFormatter.GetInputLineString(pFC->GetValue(), nFormat, 
rString, bFiltering);
 else
 rString = pFC->GetString().getString();
 


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/CppunitTest_sc_subsequent_export_test.mk sc/qa sc/source

2021-10-21 Thread Attila Szűcs (via logerrit)
 sc/CppunitTest_sc_subsequent_export_test.mk   |1 
 sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods |binary
 sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx   |binary
 sc/qa/unit/subsequent_export-test.cxx |   48 +-
 sc/source/filter/oox/viewsettings.cxx |2 
 5 files changed, 49 insertions(+), 2 deletions(-)

New commits:
commit 0bdcb59b760b06beee77e9be036f00feb1bf7010
Author: Attila Szűcs 
AuthorDate: Tue May 25 10:28:05 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:45:34 2021 +0200

tdf#126541 XLSX import: fix View grid lines

It was not possible to enable the disabled grid
with View->View grid lines, as intended, because
document-level grid visibility was set to the
visibility of the actual sheet's grid (which already
imported correctly) instead of keeping its default true
value.

Note: document-level or global grid visibility is
unknown for XLSX, but handled by Writer/ODS, see
Tools->Options->Calc->View->Grid lines.

Co-authored-by: Tibor Nagy (NISZ)

Change-Id: Iccab3e2b9f617cdcd678071f73c7c2d6db0bc161
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116096
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123952
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sc/CppunitTest_sc_subsequent_export_test.mk 
b/sc/CppunitTest_sc_subsequent_export_test.mk
index 604dbabeadc8..9d5fb86cb56e 100644
--- a/sc/CppunitTest_sc_subsequent_export_test.mk
+++ b/sc/CppunitTest_sc_subsequent_export_test.mk
@@ -96,6 +96,7 @@ $(eval $(call 
gb_CppunitTest_use_components,sc_subsequent_export_test,\
 sfx2/util/sfx \
 sot/util/sot \
 svl/util/svl \
+svl/source/fsstor/fsstorage \
 svtools/util/svt \
 toolkit/util/tk \
 ucb/source/core/ucb1 \
diff --git a/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods 
b/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods
new file mode 100644
index ..389fe347d493
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods 
differ
diff --git a/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx 
b/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx
new file mode 100644
index ..e27089b01603
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index c83dd75a6c49..3c1a44a51423 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -288,6 +289,7 @@ public:
 void testDateStandardfilterXLSX();
 void testTdf142929_filterLessThanXLSX();
 void testAutofilterTop10XLSX();
+void testTdf126541_SheetVisibilityImportXlsx();
 
 CPPUNIT_TEST_SUITE(ScExportTest);
 CPPUNIT_TEST(test);
@@ -471,13 +473,16 @@ public:
 CPPUNIT_TEST(testTdf136721_paper_size);
 CPPUNIT_TEST(testTdf139258_rotated_image);
 CPPUNIT_TEST(testTdf140431);
-
+CPPUNIT_TEST(testTdf126541_SheetVisibilityImportXlsx);
 CPPUNIT_TEST(testDateStandardfilterXLSX);
 CPPUNIT_TEST(testTdf142929_filterLessThanXLSX);
 CPPUNIT_TEST(testAutofilterTop10XLSX);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
+
+ScDocShellRef loadDocAndSetupModelViewController(std::u16string_view 
rFileName, sal_Int32 nFormat, bool bReadWrite);
 void testExcelCellBorders( sal_uLong nFormatType );
 
 uno::Reference m_xCalcComponent;
@@ -5980,6 +5985,47 @@ void ScExportTest::testAutofilterTop10XLSX()
 xDocSh->DoClose();
 }
 
+ScDocShellRef 
ScExportTest::loadDocAndSetupModelViewController(std::u16string_view rFileName, 
sal_Int32 nFormat, bool bReadWrite)
+{
+uno::Reference< frame::XDesktop2 > xDesktop = 
frame::Desktop::create(::comphelper::getProcessComponentContext());
+CPPUNIT_ASSERT(xDesktop.is());
+
+// create a frame
+Reference< frame::XFrame > xTargetFrame = xDesktop->findFrame("_blank", 0);
+CPPUNIT_ASSERT(xTargetFrame.is());
+
+// 1. Open the document
+ScDocShellRef xDocSh = loadDoc(rFileName, nFormat, bReadWrite);
+CPPUNIT_ASSERT_MESSAGE(OString("Failed to load " + 
OUStringToOString(rFileName, RTL_TEXTENCODING_UTF8)).getStr(), xDocSh.is());
+
+uno::Reference< frame::XModel2 > xModel2 = xDocSh->GetModel();
+CPPUNIT_ASSERT(xModel2.is());
+
+Reference< frame::XController2 > xController = 
xModel2->createDefaultViewController(xTargetFrame);
+CPPUNIT_ASSERT(xController.is());
+
+// introduce model/view/controller to each other
+xController->attachModel(xModel2);
+xModel2->connectController(xController);
+xTargetFrame->setComponent(xController->getComponentWindow(), xController);
+xController->attachFrame(xTargetFrame);
+xModel2->setCurrentController(xController);
+
+return xDocSh;
+}
+
+void ScExp

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa writerfilter/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf128913.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|8 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   32 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |1 
 writerfilter/source/dmapper/PropertyMap.cxx   |4 ++
 5 files changed, 45 insertions(+)

New commits:
commit 8983620fb92dec7c0723d85049e29cd22721839b
Author: László Németh 
AuthorDate: Wed May 5 21:33:28 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:43:38 2021 +0200

tdf#128913 DOCX: import track changes of inline images

Deleted images were imported as not deleted part of
the document. Both deleted and inserted images lost
their change tracking.

Change-Id: Ia273d307d01c5ea535889bc9951084e96cd7fc50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115178
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123949
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf128913.docx 
b/sw/qa/extras/ooxmlexport/data/tdf128913.docx
new file mode 100644
index ..42cc2d75d3ff
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf128913.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index e367d767a46b..bece2a74e229 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1407,6 +1407,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121176, "tdf121176.docx")
 CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 2 
)->getString());
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128913, "tdf128913.docx")
+{
+xmlDocUniquePtr pXmlDoc = parseExport();
+// w:ins and w:del are imported correctly, if they contain only inline 
images
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:inline/a:graphic");
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic");
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142387, "tdf142387.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3ae632e3f1a2..b040dbbaa040 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1826,6 +1826,24 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 }
 }
 
+// apply redlines for inline images
+if (IsParaWithInlineObject())
+{
+for (const auto& rAnchored : 
rAppendContext.m_aAnchoredObjects)
+{
+// process only inline objects with redlining
+if (!rAnchored.m_xRedlineForInline)
+continue;
+
+// select the inline image and set its redline
+auto xAnchorRange = 
rAnchored.m_xAnchoredObject->getAnchor();
+uno::Reference< text::XTextCursor > xCursorOnImage 
=
+
xAnchorRange->getText()->createTextCursorByRange(xAnchorRange);
+xCursorOnImage->goRight(1, true);
+CreateRedline( xCursorOnImage, 
rAnchored.m_xRedlineForInline );
+}
+}
+
 xTextRange = xTextAppend->finishParagraph( 
comphelper::containerToSequence(aProperties) );
 m_xPreviousParagraph.set(xTextRange, uno::UNO_QUERY);
 
@@ -6880,7 +6898,21 @@ void  DomainMapper_Impl::ImportGraphic(const 
writerfilter::Reference< Properties
 m_aTextAppendStack.top().m_aAnchoredObjects.push_back(aInfo);
 }
 else if (eGraphicImportType == IMPORT_AS_DETECTED_INLINE)
+{
 m_bParaWithInlineObject = true;
+
+// store inline images with track changes, because the anchor point
+// to set redlining is not available yet
+if (!m_aTextAppendStack.empty() && !m_aRedlines.top().empty() )
+{
+// Remember this object is anchored to the current paragraph.
+AnchoredObjectInfo aInfo;
+aInfo.m_xAnchoredObject = xTextContent;
+aInfo.m_xRedlineForInline = m_aRedlines.top().back();
+m_aTextAppendStack.top().m_aAnchoredObjects.push_back(aInfo);
+}
+
+}
 }
 
 // Clear the reference, so in case the embedded object is inside a
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 6d9e2a948c16..ab83c8da8943 100644

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - oox/source sd/qa

2021-10-21 Thread Tibor Nagy (via logerrit)
 oox/source/export/drawingml.cxx|   65 -
 sd/qa/unit/data/pptx/tdf54037.pptx |binary
 sd/qa/unit/export-tests-ooxml1.cxx |   22 
 3 files changed, 79 insertions(+), 8 deletions(-)

New commits:
commit e0a4f7e28bbfc589ca66893a65845b05c57481e2
Author: Tibor Nagy 
AuthorDate: Thu Apr 29 17:26:59 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:41:56 2021 +0200

tdf#54037 PPTX export: fix internal hyperlinks

exported as external by accident: after reloading the bad
export, clicking on the hyperlink opened the same file
in another document, because the exported link contained
also the full file name reference instead of the slide name,
according to the OOXML Relationship TargetMode="External".

Change-Id: I08cf1537cd307b0b6f51ba1c3f61d89e220d44fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114891
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 3a24211a1d49f33ca52e4fb2c927d50304f005df)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123858
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4970cea7a29a..76e4302c3d0f 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -93,6 +93,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -156,9 +160,12 @@ OUString URLTransformer::getTransformedString(const 
OUString& rString) const
 return rString;
 }
 
-bool URLTransformer::isExternalURL(const OUString& /*rURL*/) const
+bool URLTransformer::isExternalURL(const OUString& rURL) const
 {
-return true;
+bool bExternal = true;
+if (rURL.startsWith("#"))
+bExternal = false;
+return bExternal;
 }
 
 static css::uno::Any getLineDash( const 
css::uno::Reference& xModel, const OUString& rDashName )
@@ -1840,6 +1847,29 @@ void DrawingML::WriteShapeTransformation( const 
Reference< XShape >& rXShape, sa
 bFlipHWrite, bFlipVWrite, ExportRotateClockwisify(nRotation + 
nCameraRotation), IsGroupShape( rXShape ));
 }
 
+static OUString lcl_GetTarget(const css::uno::Reference& 
xModel, OUString& rURL)
+{
+Reference xDPS(xModel, uno::UNO_QUERY_THROW);
+Reference xDrawPages(xDPS->getDrawPages(), 
uno::UNO_SET_THROW);
+sal_uInt32 nPageCount = xDrawPages->getCount();
+OUString sTarget;
+
+for (sal_uInt32 i = 0; i < nPageCount; ++i)
+{
+Reference xDrawPage;
+xDrawPages->getByIndex(i) >>= xDrawPage;
+Reference xNamed(xDrawPage, UNO_QUERY_THROW);
+OUString sSlideName = "#" + xNamed->getName();
+if (rURL == sSlideName)
+{
+sTarget = "slide" + OUString::number(i + 1) + ".xml";
+break;
+}
+}
+
+return sTarget;
+}
+
 void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, 
bool bIsField, sal_Int32 nElement,
 bool bCheckDirect,bool& 
rbOverridingCharHeight, sal_Int32& rnCharHeight,
 sal_Int16 nScriptType, const Reference< 
XPropertySet >& rXShapePropSet)
@@ -2175,15 +2205,34 @@ void DrawingML::WriteRunProperties( const Reference< 
XPropertySet >& rRun, bool
 OUString sURL;
 
 mAny >>= sURL;
-if( !sURL.isEmpty() ) {
-OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(),
-  
oox::getRelationship(Relationship::HYPERLINK),
-  sURL, true );
+if (!sURL.isEmpty())
+{
+if (!sURL.match("#action?jump="))
+{
+bool bExtURL = URLTransformer().isExternalURL(sURL);
+sURL = bExtURL ? sURL : lcl_GetTarget(GetFB()->getModel(), 
sURL);
+
+OUString sRelId
+= mpFB->addRelation(mpFS->getOutputStream(),
+bExtURL ? 
oox::getRelationship(Relationship::HYPERLINK)
+: 
oox::getRelationship(Relationship::SLIDE),
+sURL, bExtURL);
 
-mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), 
sRelId);
+if (bExtURL)
+mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, 
XML_id), sRelId);
+else
+mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, 
XML_id), sRelId,
+  XML_action, 
"ppaction://hlinksldjump");
+}
+else
+{
+sal_Int32 nIndex = sURL.indexOf('=');
+OUString aDestination(sURL.copy(nIndex + 1));
+mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, 
XML_id), "", XML_action,
+  "ppaction

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

2021-10-21 Thread László Németh (via logerrit)
 sw/source/core/text/porfly.cxx |   20 
 sw/source/core/text/porfly.hxx |5 -
 sw/source/core/text/porlay.cxx |   35 +++
 3 files changed, 59 insertions(+), 1 deletion(-)

New commits:
commit 1ec2dd76e8c84939ed67fa3cf8491548fe477b8e
Author: László Németh 
AuthorDate: Fri Apr 30 12:27:43 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:40:58 2021 +0200

tdf#78864 sw track changes: cross out deleted images

Show Changes mode shows deleted images with crossing
out to allow differentiate deleted and inserted images
during change tracking.

See also commit d6322bcedc197a654abc7d64bfea8cf570f123bf
(tdf#59463 track changes: record deletion of images).

Change-Id: If9bc2252c6cdd06cbe267fe130023c416aa53ce7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114906
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit d845b91bcc6eb885c55494d4d4fab4ec09577e1d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123857
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 96bdebd58adc..9c7b1d52f56f 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -38,6 +38,7 @@
 #include "inftxt.hxx"
 
 #include 
+#include 
 
 /**
  * class SwFlyPortion => we expect a frame-locale SwRect!
@@ -222,6 +223,25 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& 
rInf) const
 {
 SwLayoutModeModifier aLayoutModeModifier(*rInf.GetOut());
 m_pFly->PaintSwFrame(const_cast(*rInf.GetOut()), 
aRect);
+
+// track changes: cross out the image, if it is deleted
+const SwFrame *pFrame = m_pFly->Lower();
+if ( IsDeleted() && pFrame )
+{
+SwRect aPaintRect( pFrame->GetPaintArea() );
+
+const AntialiasingFlags nFormerAntialiasing( 
rInf.GetOut()->GetAntialiasing() );
+const bool bIsAntiAliasing = 
officecfg::Office::Common::Drawinglayer::AntiAliasing::get();
+if ( bIsAntiAliasing )
+
const_cast(*rInf.GetOut()).SetAntialiasing(AntialiasingFlags::Enable);
+tools::Long startX = aPaintRect.Left(  ), endX = 
aPaintRect.Right();
+tools::Long startY = aPaintRect.Top(  ),  endY = 
aPaintRect.Bottom();
+
const_cast(*rInf.GetOut()).SetLineColor(NON_PRINTING_CHARACTER_COLOR);
+
const_cast(*rInf.GetOut()).DrawLine(Point(startX, startY), 
Point(endX, endY));
+
const_cast(*rInf.GetOut()).DrawLine(Point(startX, endY), 
Point(endX, startY));
+if ( bIsAntiAliasing )
+
const_cast(*rInf.GetOut()).SetAntialiasing(nFormerAntialiasing);
+}
 }
 
const_cast(rInf).GetRefDev()->SetLayoutMode(rInf.GetOut()->GetLayoutMode());
 
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 7227c76b95da..b83aab4a4c88 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -44,7 +44,8 @@ public:
 class SwFlyCntPortion : public SwLinePortion
 {
 Point m_aRef; // Relatively to this point we calculate the AbsPos
-bool m_bMax;   // Line adjustment and height == line height
+bool m_bMax;  // Line adjustment and height == line height
+bool m_bDeleted;  // Part of tracked deletion: it needs strikethrough
 sw::LineAlign m_eAlign;
 
 virtual SdrObject* GetSdrObj(const SwTextFrame&) =0;
@@ -53,9 +54,11 @@ public:
 SwFlyCntPortion();
 const Point& GetRefPoint() const { return m_aRef; }
 bool IsMax() const { return m_bMax; }
+bool IsDeleted() const { return m_bDeleted; }
 sw::LineAlign GetAlign() const { return m_eAlign; }
 void SetAlign(sw::LineAlign eAlign) { m_eAlign = eAlign; }
 void SetMax(bool bMax) { m_bMax = bMax; }
+void SetDeleted(bool bDeleted) { m_bDeleted = bDeleted; }
 void SetBase(const SwTextFrame& rFrame, const Point& rBase, tools::Long 
nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long 
nFlyDescent, AsCharFlags nFlags);
 virtual bool Format(SwTextFormatInfo& rInf) override;
 };
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 06a4e5f4b7c7..8c070715a79b 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -359,6 +359,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
 
 bool bHasBlankPortion = false;
 bool bHasOnlyBlankPortions = true;
+bool bHasFlyContentPortion = false;
 
 if( mpNextPortion )
 {
@@ -445,6 +446,8 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
 SetHanging(true);
 rInf.GetParaPortion()->SetMargin();
 }
+else if( !bHasFlyContentPortion && pPos->IsFlyCntPortion() )
+ bHasFlyCo

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sd/qa sd/source

2021-10-21 Thread Attila Bakos (NISZ) (via logerrit)
 sd/qa/unit/data/pptx/LostPlaceholder.odp |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |   35 ++-
 sd/source/filter/eppt/pptx-epptooxml.cxx |   17 +++
 3 files changed, 47 insertions(+), 5 deletions(-)

New commits:
commit 6dc0e26f9b88fc8490315ac97d23630f014ee4a9
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Apr 20 13:02:44 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:39:59 2021 +0200

tdf#111903 tdf#137152 PPTX export: fix placeholders

Empty placeholders were exported as white empty
custom shapes, losing their visibility and usability.

Note: export of properties hasn't been implemented, yet.

Change-Id: Ie8bd6a611f5fb43bcaa55f6b2f5b07daf731b163
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114331
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit b6b02e0b4c9d739836e1f61a886ea45b01e6696e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123856
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sd/qa/unit/data/pptx/LostPlaceholder.odp 
b/sd/qa/unit/data/pptx/LostPlaceholder.odp
new file mode 100644
index ..80ead189f260
Binary files /dev/null and b/sd/qa/unit/data/pptx/LostPlaceholder.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index d0837001ceca..a6b0c428aff1 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -62,6 +62,7 @@ public:
 void testN828390_4();
 void testN828390_5();
 void testFdo71961();
+void testLostPlaceholders();
 void testN828390();
 void testBnc880763();
 void testBnc862510_5();
@@ -114,6 +115,7 @@ public:
 CPPUNIT_TEST(testN828390_4);
 CPPUNIT_TEST(testN828390_5);
 CPPUNIT_TEST(testFdo71961);
+CPPUNIT_TEST(testLostPlaceholders);
 CPPUNIT_TEST(testN828390);
 CPPUNIT_TEST(testBnc880763);
 CPPUNIT_TEST(testBnc862510_5);
@@ -361,6 +363,37 @@ void SdOOXMLExportTest1::testN828390_5()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest1::testLostPlaceholders()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/LostPlaceholder.odp"),
 ODP);
+CPPUNIT_ASSERT(xDocShRef.is());
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+CPPUNIT_ASSERT(xDocShRef.is());
+
+auto pDoc = xDocShRef->GetDoc();
+CPPUNIT_ASSERT(pDoc);
+auto pPage = pDoc->GetPage(1);
+CPPUNIT_ASSERT(pPage);
+auto pObj = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObj);
+uno::Reference xShp (pObj->getUnoShape(), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShp);
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong ShapeType!", 
OUString(u"com.sun.star.presentation.OutlinerShape"), xShp->getShapeType());
+uno::Reference xShpProps(xShp, uno::UNO_QUERY);
+// Without the fix in place there will be the following error:
+// Expected: com.sun.star.presentation.OutlinerShape
+// Actual: com.sun.star.drawing.CustomShape
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("It must be a placeholder!", true, 
xShpProps->getPropertyValue("IsPresentationObject").get());
+// Without the fix in place this will the following:
+// Expected: true
+// Actual: false
+
+xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest1::testFdo71961()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/fdo71961.odp"), ODP);
@@ -370,7 +403,7 @@ void SdOOXMLExportTest1::testFdo71961()
 
 // Export to .pptx changes all text frames to custom shape objects, which 
obey TextWordWrap property
 // (which is false for text frames otherwise and is ignored). Check that 
frames that should wrap still do.
-SdrObjCustomShape *pTxtObj = dynamic_cast( 
pPage->GetObj( 1 ));
+auto  pTxtObj = pPage->GetObj( 1 );
 CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr);
 CPPUNIT_ASSERT_EQUAL( OUString( "Text to be always wrapped" ), 
pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
 CPPUNIT_ASSERT_EQUAL( true, 
pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue());
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index c734bf10f0f5..2579d5627148 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1438,13 +1438,22 @@ ShapeExport& 
PowerPointShapeExport::WritePageShape(const Reference< XShape >& xS
 bool PowerPointShapeExport::WritePlaceholder(const Reference< XShape >& 
xShape, PlaceholderType ePlaceholder, bool bMaster)
 {
 SAL_INFO("sd.eppt", "WritePlaceholder " << bMaster << " " << 
ShapeExport::NonEmptyText(xShape));
-if (bMaster && ShapeExport::NonEmptyText(xShape))
+if (!xShape)
+return false;
+try
 {
-WritePlaceholderShape(xShape, ePlaceholder);
+Reference xShapeProps(xShape, UNO_QUERY);
+if (xShapeProps->getPrope

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx |   27 +++
 sw/source/uibase/wrtsh/delete.cxx   |   36 +++-
 2 files changed, 58 insertions(+), 5 deletions(-)

New commits:
commit 976c737a6d387acaeadfe5a3f7265a5cdb9384c7
Author: László Németh 
AuthorDate: Mon Apr 26 09:33:45 2021 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:38:51 2021 +0200

tdf#59463 track changes: record deletion of images

Instead of deleting the image object without
recording the deletion, delete the anchor point
in the text to record the deletion, if Record
Changes is enabled.

Note: only images anchored as characters can be
recorded this way, so change the anchor before
the deletion, if needed. This less problem, than
hidden, i.e. non-tracked deletion of images.

Change-Id: I7e4bee82b76b4a26e6482a678a2a1ce432980271
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114671
Tested-by: Jenkins
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123855
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 7e3488b23e5b..29bbb8dbb7ba 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -3019,6 +3019,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testImageCommentAtChar)
 CPPUNIT_ASSERT_EQUAL(*pImageAnchor, rAnnotationMarkStart);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTrackImageDeletion)
+{
+// load a document with an image anchored to paragraph in it
+SwDoc* pDoc = createDoc("image.odt");
+SwView* pView = pDoc->GetDocShell()->GetView();
+
+// select the image
+pView->GetViewFrame()->GetDispatcher()->Execute(FN_CNTNT_TO_NEXT_FRAME, 
SfxCallMode::SYNCHRON);
+
+// turn on red-lining and show changes
+IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+
+rIDRA.SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// now delete the image with track changes
+pView->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, 
SfxCallMode::SYNCHRON);
+
+const SwRedlineTable& rTable = rIDRA.GetRedlineTable();
+// this was 0 (missing recording of deletion of images)
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
rTable.size());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120338)
 {
 load(DATA_DIRECTORY, "tdf120338.docx");
diff --git a/sw/source/uibase/wrtsh/delete.cxx 
b/sw/source/uibase/wrtsh/delete.cxx
index 0dbc7eb89cc5..f9a5772a603a 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -416,30 +417,55 @@ bool SwWrtShell::DelRight()
 case SelectionType::DrawObjectEditMode:
 case SelectionType::DbForm:
 {
+// Group deletion of the object and its comment together
+// (also as-character anchor conversion at track changes)
+mxDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
+
 // #108205# Remember object's position.
 Point aTmpPt = GetObjRect().TopLeft();
 
 // Remember the anchor of the selected object before deletion.
 std::unique_ptr pAnchor;
+RndStdIds eAnchorId = RndStdIds::FLY_AT_PARA;
 SwFlyFrame* pFly = GetSelectedFlyFrame();
 if (pFly)
 {
 SwFrameFormat* pFormat = pFly->GetFormat();
 if (pFormat)
 {
-RndStdIds eAnchorId = pFormat->GetAnchor().GetAnchorId();
+eAnchorId = pFormat->GetAnchor().GetAnchorId();
+// as-character anchor conversion at track changes
+if ( IsRedlineOn() && eAnchorId != RndStdIds::FLY_AS_CHAR )
+{
+SfxItemSet aSet(GetAttrPool(), svl::Items{});
+GetFlyFrameAttr(aSet);
+SwFormatAnchor aAnch(RndStdIds::FLY_AS_CHAR);
+aSet.Put(aAnch);
+SetFlyFrameAttr(aSet);
+eAnchorId = pFormat->GetAnchor().GetAnchorId();
+}
 if ((eAnchorId == RndStdIds::FLY_AS_CHAR || eAnchorId == 
RndStdIds::FLY_AT_CHAR)
 && pFormat->GetAnchor().GetContentAnchor())
 {
 pAnchor.reset(new 
SwPosition(*pFormat->GetAnchor().GetConten

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter2.cxx   |   51 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |6 ++-
 2 files changed, 56 insertions(+), 1 deletion(-)

New commits:
commit f7726a488bb3f34fe183f1e21b05d100460c9866
Author: László Németh 
AuthorDate: Mon Mar 22 22:17:11 2021 +0100
Commit: Balazs Varga 
CommitDate: Thu Oct 21 09:37:33 2021 +0200

tdf#140757 sw ChangesInMargin: fix crash on Undo of Accept All

Change-Id: Ia1e0a58b0843f34c0f5042fdc147c4035e868255
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112946
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 0fe7070c9f6c1b4d4e2da05099255fbed10ab50c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123854
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 245862605d51..7e3488b23e5b 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2236,6 +2236,57 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, 
testJoinParaChangesInMargin)
 CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140757)
+{
+load(DATA_DIRECTORY, "tdf54819.fodt");
+
+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());
+
+// turn on red-lining and show changes
+SwDoc* pDoc = pWrtShell->GetDoc();
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowInsert
+  | 
RedlineFlags::ShowDelete);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// delete a character in the first paragraph, and another character in the 
second one
+dispatchCommand(mxComponent, ".uno:Delete", {});
+pWrtShell->Down(/*bSelect=*/false);
+dispatchCommand(mxComponent, ".uno:Delete", {});
+
+CPPUNIT_ASSERT_EQUAL(OUString("orem ipsum"), getParagraph(1)->getString());
+CPPUNIT_ASSERT_EQUAL(OUString("olor sit amet."), 
getParagraph(2)->getString());
+
+// accept all changes
+IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+rIDRA.AcceptAllRedline(/*bAccept=*/true);
+
+CPPUNIT_ASSERT_EQUAL(OUString("orem ipsum"), getParagraph(1)->getString());
+CPPUNIT_ASSERT_EQUAL(OUString("olor sit amet."), 
getParagraph(2)->getString());
+
+// This crashed
+dispatchCommand(mxComponent, ".uno:Undo", {});
+
+// Check result of Undo
+rIDRA.AcceptAllRedline(/*bAccept=*/false);
+CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsum"), 
getParagraph(1)->getString());
+CPPUNIT_ASSERT_EQUAL(OUString("dolor sit amet."), 
getParagraph(2)->getString());
+
+// switch off "Show changes in margin" mode
+dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
+CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139127)
 {
 load(DATA_DIRECTORY, "tdf139127.fodt");
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 2c3c2b7b5b88..cdbc7789eba9 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -155,7 +155,11 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM 
const& rPam)
 currentStart.nNode.GetNode().IsTableNode()
 ? 
static_cast(currentStart.nNode.GetNode().GetTableNode())
 : 
static_cast(currentStart.nNode.GetNode().GetSectionNode()));
-assert(pTableOrSectionNode); // known pathology
+if ( !pTableOrSectionNode )
+{
+SAL_WARN("sw.core", "UpdateFramesForAddDeleteRedline:: known 
pathology (or ChangesInRedline mode)");
+return;
+}
 for (sal_uLong j = pTableOrSectionNode->GetIndex(); j <= 
pTableOrSectionNode->EndOfSectionIndex(); ++j)
 {
 
pTableOrSectionNode->GetNodes()[j]->SetRedlineMergeFlag(SwNode::Merge::Hidden);


  1   2   >