New Defects reported by Coverity Scan for LibreOffice

2022-04-09 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

3 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 1503836:  Null pointer dereferences  (NULL_RETURNS)



*** CID 1503836:  Null pointer dereferences  (NULL_RETURNS)
/sd/source/ui/view/drviews2.cxx: 601 in 
sdlcl_convertStringArguments(unsigned short, const 
std::unique_ptr> &)()
595 }
596 }
597 
598 if (nSlot == SID_ATTR_FILL_COLOR)
599 {
600 // Merge the color parameters to the color itself.
>>> CID 1503836:  Null pointer dereferences  (NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" 
>>> "static_cast(pArgs->GetItem(10165, true))" when 
>>> calling "XFillColorItem".
601 XFillColorItem aColorItem(
602 *static_cast(pArgs->GetItem(SID_ATTR_FILL_COLOR)));
603 if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, 
&pItem) == SfxItemState::SET)
604 {
605 auto pIntItem = static_cast(pItem);
606 
aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue());

** CID 1503835:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/sc/source/core/data/column2.cxx: 828 in 
ScColumn::GetOptimalColWidth(OutputDevice *, double, double, const Fraction &, 
const Fraction &, bool, unsigned short, const ScMarkData *, const 
ScColWidthParam *) const()



*** CID 1503835:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/sc/source/core/data/column2.cxx: 828 in 
ScColumn::GetOptimalColWidth(OutputDevice *, double, double, const Fraction &, 
const Fraction &, bool, unsigned short, const ScMarkData *, const 
ScColWidthParam *) const()
822 }
823 
824 if (bFound)
825 {
826 nWidth += 2;
827 sal_uInt16 nTwips = static_cast(
>>> CID 1503835:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
>>> Dividing integer expressions "65535" and "2", and then converting the 
>>> integer quotient to type "double". Any remainder, or fractional part of the 
>>> quotient, is ignored.
828 std::min(nWidth / nPPTX, 
double(std::numeric_limits::max() / 2)));
829 return nTwips;
830 }
831 else
832 return nOldWidth;
833 }

** CID 1503834:  Incorrect expression  (COPY_PASTE_ERROR)
/sc/source/ui/dialogs/SparklineDialog.cxx: 256 in 
sc::SparklineDialog::setupValues()()



*** CID 1503834:  Incorrect expression  (COPY_PASTE_ERROR)
/sc/source/ui/dialogs/SparklineDialog.cxx: 256 in 
sc::SparklineDialog::setupValues()()
250 case sc::AxisType::Group:
251 mxComboMaxAxisType->set_active(1);
252 mxSpinCustomMax->GetFormatter().SetValue(0.0);
253 break;
254 case sc::AxisType::Custom:
255 mxComboMaxAxisType->set_active(2);
>>> CID 1503834:  Incorrect expression  (COPY_PASTE_ERROR)
>>> "getManualMin" in "this->maAttributes.getManualMin()" looks like a 
>>> copy-paste error.
256 if (maAttributes.getManualMin())
257 
mxSpinCustomMax->GetFormatter().SetValue(*maAttributes.getManualMax());
258 break;
259 }
260 ComboValueChanged(*mxComboMaxAxisType);
261 }



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3D3T6Q_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJi-2BeWjReMKf6MH-2FhLFbl6KbdigEbX8Hq2fMnF0HZqCec-2BRwd3uFlObVrx9ZE2lCsKqJBi8pKL1y-2B2m-2BYrxapR-2B1-2FHdZduOdpEqLRkKDE283Tbc02gXnACfSnrDbKZ6HgWpTLpi4FkSHerHz-2FM9gCK5k3wGBxMo64kdplXd8Up-2BYvw-3D



How to export 'Octagon Bevel' and 'Diamond Bevel' to OOXML

2022-04-09 Thread Regina Henschel

Hi all,

Currently 'Octagon Bevel' and 'Diamond Bevel' are exported as shape 
'rect'. That is bug tdf#109169.


Both shape types do not exist in MS binary, therefore export to MS 
binary exports them as image. Because a user cannot change color or text 
after reopening, I think we should not do that for OOXML. What is your 
opinion?


Because there exist no suitable OOXML preset shape, we need to export 
them with . I could make dedicated 'Write_Octagon_Bevel' and 
'Write_Diamond_Bevel' methods with OOXML handles and guides. Should I do 
that?


I can at least move them from lcl_IsOnDenylist to lcl_IsOnAllowlist. 
That way the export will generate the outline as octagon or diamond with 
fixed lines from the current handle state of the shape. I think that 
would be better than the 'rect' now.


The real problem is their shading. It is not contained as command in the 
enhanced geometry. It is encoded into the type identifier, see 
https://bz.apache.org/ooo/show_bug.cgi?id=33139. The current 
implementation of that "feature" has a bug, see 
https://bz.apache.org/ooo/show_bug.cgi?id=80216.

This "feature" uses more grades of shading than the four available in OOXML.
So what should I do with the shading of these shapes?

Kind regards,
Regina


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - svl/source

2022-04-09 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 29f7b81afcf2e21c88c38fbae31fb463b26040c1
Author: Eike Rathke 
AuthorDate: Fri Apr 8 21:46:47 2022 +0200
Commit: Caolán McNamara 
CommitDate: Sat Apr 9 22:18:44 2022 +0200

Resolves: tdf#148052 accept a ". Month " name for matching DMY format

... even if the locale doesn't define such DM order or
LongDateDaySeparator.

Change-Id: I4bef720dff3582de9b60313824a84b570c153e98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132741
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7a16002ede5fd31ae8f3358136ad49de40465ac1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132703
Reviewed-by: Caolán McNamara 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 330921242a01..010549d28151 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2605,6 +2605,29 @@ bool ImpSvNumberInputScan::ScanMidString( const 
OUString& rString, sal_uInt16 nS
 SkipBlanks(rString, nPos);
 bDate = SkipString( rDate, rString, nPos);  // 10.  10-  10/
 }
+if (!bDate && nStringPos == 1 && mpFormat && (mpFormat->GetType() & 
SvNumFormatType::DATE))
+{
+// If a DMY format was given and a mid string starts with a literal
+// ". " dot+space and could contain a following month name and ends
+// with a space or LongDateMonthSeparator, like it's scanned in
+// `14". AUG "18`, then it may be a date as well. Regardless whether
+// defined such by the locale or not.
+// This *could* check for presence of ". "MMM or ". " in the actual
+// format code for further restriction to match only if present, but..
+
+const sal_uInt32 nExactDateOrder = mpFormat->GetExactDateOrder();
+// Exactly DMY.
+if (((nExactDateOrder & 0xff) == 'Y') && (((nExactDateOrder >> 8) & 
0xff) == 'M')
+&& (((nExactDateOrder >> 16) & 0xff) == 'D'))
+{
+const sal_Int32 nTmpPos = nPos;
+if (SkipChar('.', rString, nPos) && SkipBlanks(rString, nPos) && 
nPos + 2 < rString.getLength()
+&& (rString.endsWith(" ") || rString.endsWith( 
pLoc->getLongDateMonthSep(
+bDate = true;
+else
+nPos = nTmpPos;
+}
+}
 if (bDate || ((MayBeIso8601() || MayBeMonthDate()) &&// 1999-12-31  
31-Dec-1999
   SkipChar( '-', rString, nPos)))
 {


Re: Idea of a "strict" version of LO for publishers

2022-04-09 Thread Svante Schubert
Hi all,

there are different approaches to solving this scenario. Three that come
instantly to my mind:

   1. The existence of an ODF application where customers could select the
   allowed set of ODF features (e.g. disable all automatic styles for some
   scenarios - like translators) or allow only certain subsets of
   functionality (a certain type of tables and images must have a caption,
   etc.), has been a customer wish since my early times at StarOffice 1999. My
   bet would be that adding this ability to LibreOffice might be the most
   costly solution.
   2. The discipline of the editors and the alignment of requirements with
   predefined styles seem one of the easiest and cheapest solutions. But there
   would be no validation.
   3. Nevertheless, as Thorsten mentioned, TDF has well the ODF Toolkit
    in its portfolio, which contains for
   instance the ODF Validator  and the ODFDOM
   library  for
   creating, manipulating and reading ODF documents on the server-side using
   Java. Scenarios like, the listing and later elimination of automatic styles
   by exchanging them for adequate template styles might be handled by this
   library for the ODF specification. Also, as you required, some
   user-specific validation or constraint functions like the check that only
   one style is applied to a paragraph and one enrichment applied to a word
   could be added on top of ODFDOM. At least this would be likely my approach
   to solving the problem.

Have a nice weekend,
Svante


Am Sa., 9. Apr. 2022 um 18:30 Uhr schrieb Andreas Kage :

> From the view of a publishing scientist and lecturer LO is quite perfect
> to generate a variety of formats (PDF, ePub etc ) out of the odt file. The
> odt XML style can excellently handle the different Paragraph Styles
> (regular, list, legends and such) but also the implementation of different
> languages (greek, Special European Unicode) as well as other objects such
> as formulas and more.
> What is still missing and might be able to realize with your available
> budget to s certain extent is a systematic format set of Styles for the
> different scientific journals and University styles.
>
> --
> Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail
> gesendet.
> Am 07.04.22, 19:13 schrieb Yves Picard :
>
>> Hello,
>> On the advice of Sophie Gautier, I would like to tell you about one of
>> our "research and development" projects, for which I have a budget of about
>> two thousand euros. As a university publisher, we maintain electronic
>> publishing channels from word processing to several publishing formats
>> (html, epub, InDesign, PDF), passing through a pivot format in XML TEI.
>> This pivot format is itself derived from an XML export from Libre Office.
>>
>> A significant part of our work consists of tracking down and containing
>> artefacts from the word processor (Word or Libre Office), in particular
>> style nesting, automatic styles or language attributes, etc.
>>
>> I'm looking to test the idea of a "strict" version of LO that would
>> ensure that one style and one style only is applied to a paragraph, that
>> one enrichment and one enrichment only is applied to a word (no use of
>> styles like "accentuation" for example) or that a web link is always
>> findable despite the style applied. This would probably be an "amnesiac"
>> version of LO (without memory of the various manipulations) which would
>> either be used by authors (difficult to set up) or would be used by the
>> editor by loading an author file in this strict version.
>>
>> An alternative (and probably better) idea would be a "big cleaner" tool
>> that would flatten all style or attribute nesting to the author's work.
>>
>> I'm looking for an opinion from the Libre Office community on the
>> feasibility of such a development, while being well aware that it goes
>> against the logic of the word processor in some way. But such a version, I
>> believe, would meet the expectations of the publishing world.
>>
>> Thank you for your attention,
>>
>> Regards,
>>
>> Yves Picard,
>> Presses universitaires de Rennes,
>> France.
>>
>


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

2022-04-09 Thread Caolán McNamara (via logerrit)
 connectivity/source/drivers/dbase/DTable.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d34d1db55978bdcff082af1e0f75b18fa6fc94f4
Author: Caolán McNamara 
AuthorDate: Sat Apr 9 09:56:23 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Apr 9 20:39:34 2022 +0200

ofz#46526 Abrt

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

diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 8c8461fd485d..fd4b5ea85cc2 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -948,7 +948,7 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const 
OSQLColumns & _rCols, bool
 {
 case DataType::DATE:
 {
-if (aStr.getLength() != nLen)
+if (nLen < 8 || aStr.getLength() != nLen)
 {
 (*_rRow)[i]->setNull();
 break;


[Libreoffice-commits] core.git: Branch 'feature/cib_contract891c' - external/openldap

2022-04-09 Thread Thorsten Behrens (via logerrit)
 external/openldap/UnpackedTarball_openldap.mk |6 
 external/openldap/automake.patch  | 3654 --
 2 files changed, 5 insertions(+), 3655 deletions(-)

New commits:
commit 97648c6ccce80df96c438c0af37b924dd15edb32
Author: Thorsten Behrens 
AuthorDate: Sat Apr 9 19:10:53 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Apr 9 19:11:19 2022 +0200

use the new gbuild way to update config.*

(using the openldap part of the patch)

Change-Id: I43805ac8c3d5c1b65519da02c3cc50fdb9729ea6
Reviewed-on: https://gerrit.libreoffice.org/42941
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/external/openldap/UnpackedTarball_openldap.mk 
b/external/openldap/UnpackedTarball_openldap.mk
index 74d6908b5623..61a083ddcd8a 100644
--- a/external/openldap/UnpackedTarball_openldap.mk
+++ b/external/openldap/UnpackedTarball_openldap.mk
@@ -13,9 +13,13 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,openldap,$(OPENLDAP_TARBALL),,openl
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,openldap,0))
 
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,openldap,\
+   build \
+   contrib/ldapc++ \
+))
+
 $(eval $(call gb_UnpackedTarball_add_patches,openldap,\
external/openldap/openldap-2.4.44.patch.1 \
-   external/openldap/automake.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/openldap/automake.patch b/external/openldap/automake.patch
deleted file mode 100644
index 6f2ebd6c0330..
--- a/external/openldap/automake.patch
+++ /dev/null
@@ -1,3654 +0,0 @@
 build/config.guess
-+++ build/config.guess
-@@ -1,15 +1,12 @@
- #! /bin/sh
- # Attempt to guess a canonical system name.
--#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
--#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
--#   Free Software Foundation, Inc.
-+#   Copyright 1992-2014 Free Software Foundation, Inc.
- 
--timestamp='2010-09-24-OpenLDAP'
--# $OpenLDAP$
-+timestamp='2014-11-04'
- 
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
--# the Free Software Foundation; either version 2 of the License, or
-+# the Free Software Foundation; either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful, but
-@@ -18,26 +15,22 @@
- # General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
--# along with this program; if not, write to the Free Software
--# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
--# 02110-1301, USA.
-+# along with this program; if not, see .
- #
- # As a special exception to the GNU General Public License, if you
- # distribute this file as part of a program that contains a
- # configuration script generated by Autoconf, you may include it under
--# the same distribution terms that you use for the rest of that program.
--
--
--# Originally written by Per Bothner.  Please send patches (context
--# diff format) to  and include a ChangeLog
--# entry.
-+# the same distribution terms that you use for the rest of that
-+# program.  This Exception is an additional permission under section 7
-+# of the GNU General Public License, version 3 ("GPLv3").
- #
--# This script attempts to guess a canonical system name similar to
--# config.sub.  If it succeeds, it prints the system name on stdout, and
--# exits with 0.  Otherwise, it exits with 1.
-+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
- #
- # You can get the latest version of this script from:
- # 
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-+#
-+# Please send patches to .
-+
- 
- me=`echo "$0" | sed -e 's,.*/,,'`
- 
-@@ -57,9 +50,7 @@
- GNU config.guess ($timestamp)
- 
- Originally written by Per Bothner.
--Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
--2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
--Software Foundation, Inc.
-+Copyright 1992-2014 Free Software Foundation, Inc.
- 
- This is free software; see the source for copying conditions.  There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-@@ -93,7 +84,7 @@
-   exit 1
- fi
- 
--trap 'exit 1' HUP INT TERM
-+trap 'exit 1' 1 2 15
- 
- # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
- # compiler to aid in system detection is discouraged as it requires
-@@ -107,7 +98,7 @@
- 
- set_cc_for_build='
- trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) 
&& exit \$exitcode" 0 ;
--trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT 
PIPE TERM ;
-+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 
15 ;
- : ${TMPDIR=/tmp} ;
-  { tmp=`(umask 077 && mktemp -d "$TMPDI

Aw: Idea of a "strict" version of LO for publishers

2022-04-09 Thread Andreas Kage



 
 From the view of a publishing scientist and lecturer LO is quite perfect to generate a variety of formats (PDF, ePub etc ) out of the odt file. The odt XML style can excellently handle the different Paragraph Styles (regular, list, legends and such) but also the implementation of different languages (greek, Special European Unicode) as well as other objects such as formulas and more. What is still missing and might be able to realize with your available budget to s certain extent is a systematic format set of Styles for the different scientific journals and University styles. --Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 07.04.22, 19:13 schrieb Yves Picard :

  
   
Hello,
On the advice of Sophie Gautier, I would like to tell you about one of our "research and development" projects, for which I have a budget of about two thousand euros. As a university publisher, we maintain electronic publishing channels from word processing to several publishing formats (html, epub, InDesign, PDF), passing through a pivot format in XML TEI. This pivot format is itself derived from an XML export from Libre Office.

A significant part of our work consists of tracking down and containing artefacts from the word processor (Word or Libre Office), in particular style nesting, automatic styles or language attributes, etc.

I'm looking to test the idea of a "strict" version of LO that would ensure that one style and one style only is applied to a paragraph, that one enrichment and one enrichment only is applied to a word (no use of styles like "accentuation" for example) or that a web link is always findable despite the style applied. This would probably be an "amnesiac" version of LO (without memory of the various manipulations) which would either be used by authors (difficult to set up) or would be used by the editor by loading an author file in this strict version.

An alternative (and probably better) idea would be a "big cleaner" tool that would flatten all style or attribute nesting to the author's work.

I'm looking for an opinion from the Libre Office community on the feasibility of such a development, while being well aware that it goes against the logic of the word processor in some way. But such a version, I believe, would meet the expectations of the publishing world. 

Thank you for your attention,


   
   
Regards,
   
   

   
   
Yves Picard,
   
   
Presses universitaires de Rennes,

   
   
France.

   
   

   
  
 



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

2022-04-09 Thread Luboš Luňák (via logerrit)
 include/vcl/font.hxx|1 +
 vcl/inc/impfont.hxx |1 +
 vcl/source/font/font.cxx|   21 +
 vcl/source/gdi/impglyphitem.cxx |7 +--
 4 files changed, 24 insertions(+), 6 deletions(-)

New commits:
commit 33fe4909e29654faeef7f665f31ff31776ecfeec
Author: Luboš Luňák 
AuthorDate: Fri Apr 8 20:53:07 2022 +0200
Commit: Luboš Luňák 
CommitDate: Sat Apr 9 16:11:35 2022 +0200

add vcl::Font::EqualIgnoreColor()

The color values in vcl::Font are obsolete, and the underlying font is
the same regardless of the color.

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

diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index ddc98c0223b9..0f641100eecb 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -159,6 +159,7 @@ public:
 booloperator!=( const Font& rFont ) const
 { return !(Font::operator==( rFont )); }
 boolIsSameInstance( const Font& ) const;
+boolEqualIgnoreColor( const Font& ) const;
 
 friend VCL_DLLPUBLIC SvStream&  ::ReadFont( SvStream& rIStm, vcl::Font& );
 friend VCL_DLLPUBLIC SvStream&  ::WriteFont( SvStream& rOStm, const 
vcl::Font& );
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index dc90f6d48bd5..2c8ce660ea91 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -92,6 +92,7 @@ public:
 voidSetCalculatedAverageFontWidth(tools::Long nNew) { 
mnCalculatedAverageFontWidth = nNew; }
 
 booloperator==( const ImplFont& ) const;
+boolEqualIgnoreColor( const ImplFont& ) const;
 
 private:
 friend class vcl::Font;
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index 16678dd61ac7..3387dd196f1f 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -327,6 +327,11 @@ bool Font::operator==( const vcl::Font& rFont ) const
 return mpImplFont == rFont.mpImplFont;
 }
 
+bool Font::EqualIgnoreColor( const vcl::Font& rFont ) const
+{
+return mpImplFont->EqualIgnoreColor( *rFont.mpImplFont );
+}
+
 void Font::Merge( const vcl::Font& rFont )
 {
 if ( !rFont.GetFamilyName().isEmpty() )
@@ -960,6 +965,18 @@ ImplFont::ImplFont( const ImplFont& rImplFont ) :
 {}
 
 bool ImplFont::operator==( const ImplFont& rOther ) const
+{
+if(!EqualIgnoreColor( rOther ))
+return false;
+
+if( (maColor!= rOther.maColor)
+||  (maFillColor!= rOther.maFillColor) )
+return false;
+
+return true;
+}
+
+bool ImplFont::EqualIgnoreColor( const ImplFont& rOther ) const
 {
 // equality tests split up for easier debugging
 if( (meWeight   != rOther.meWeight)
@@ -983,10 +1000,6 @@ bool ImplFont::operator==( const ImplFont& rOther ) const
 ||  (maStyleName!= rOther.maStyleName) )
 return false;
 
-if( (maColor!= rOther.maColor)
-||  (maFillColor!= rOther.maFillColor) )
-return false;
-
 if( (meUnderline!= rOther.meUnderline)
 ||  (meOverline != rOther.meOverline)
 ||  (meStrikeout!= rOther.meStrikeout)
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index e78d23b68676..130039ed88ee 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -188,8 +188,11 @@ inline bool 
SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const CachedGlyphs
&& logicWidth == other.logicWidth && outputDevice == 
other.outputDevice
&& rtl == other.rtl && layoutMode == other.layoutMode
&& digitLanguage == other.digitLanguage
-   // slower things here
-   && font == other.font && vcl::text::FastStringCompareEqual()(text, 
other.text);
+   // Need to use EqualIgnoreColor, because sometimes the color 
changes, but it's irrelevant
+   // for text layout (and also obsolete in vcl::Font).
+   && font.EqualIgnoreColor(other.font)
+   && vcl::text::FastStringCompareEqual()(text, other.text);
+// Slower things last in the comparison.
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/inc vcl/qa vcl/source vcl/unx vcl/win

2022-04-09 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitem.hxx |2 -
 vcl/inc/fontinstance.hxx  |2 -
 vcl/inc/fontsubset.hxx|3 +-
 vcl/inc/glyphid.hxx   |   26 +
 vcl/inc/impfontcache.hxx  |2 -
 vcl/inc/impglyphitem.hxx  |   20 ++--
 vcl/inc/listbox.hxx   |3 +-
 vcl/inc/pch/precompiled_vcl.hxx   |1 
 vcl/inc/unx/fontmanager.hxx   |3 +-
 vcl/inc/unx/freetype_glyphcache.hxx   |3 +-
 vcl/inc/unx/printergfx.hxx|1 
 vcl/qa/cppunit/physicalfontfacecollection.cxx |1 
 vcl/source/gdi/CommonSalLayout.cxx|   18 +++---
 vcl/source/gdi/pdfwriter_impl.cxx |4 +--
 vcl/source/gdi/sallayout.cxx  |   32 +-
 vcl/source/outdev/textline.cxx|2 -
 vcl/unx/generic/print/glyphset.hxx|3 +-
 vcl/win/gdi/DWriteTextRenderer.cxx|2 -
 18 files changed, 80 insertions(+), 48 deletions(-)

New commits:
commit 136d9b34459edb444fb5154fa8b5c74d877099d5
Author: Luboš Luňák 
AuthorDate: Fri Apr 8 17:54:26 2022 +0200
Commit: Luboš Luňák 
CommitDate: Sat Apr 9 15:01:23 2022 +0200

no public data members in GlyphItem

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

diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx
index 57efcd827ccb..7228911a3ed7 100644
--- a/vcl/inc/impglyphitem.hxx
+++ b/vcl/inc/impglyphitem.hxx
@@ -50,27 +50,26 @@ template <> struct typed_flags : 
is_typed_flags& rCharWidths)
 const int nIndex = aGlyphItem.charPos() - mnMinCharPos;
 if (nIndex >= nCharCount)
 continue;
-rCharWidths[nIndex] += aGlyphItem.m_nNewWidth;
+rCharWidths[nIndex] += aGlyphItem.newWidth();
 }
 }
 
@@ -722,15 +722,15 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 {
 // Adjust the width and position of the first (leftmost) glyph in
 // the cluster.
-m_GlyphItems[i].m_nNewWidth += nDiff;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta);
+m_GlyphItems[i].addNewWidth(nDiff);
+m_GlyphItems[i].adjustLinearPosX(nDelta);
 
 // Adjust the position of the rest of the glyphs in the cluster.
 while (++i < m_GlyphItems.size())
 {
 if (!m_GlyphItems[i].IsInCluster())
 break;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta);
+m_GlyphItems[i].adjustLinearPosX(nDelta);
 }
 }
 else if (m_GlyphItems[i].IsInCluster())
@@ -744,8 +744,8 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 // Adjust the width and position of the first (rightmost) glyph in
 // the cluster.
 // For RTL, we put all the adjustment to the left of the glyph.
-m_GlyphItems[i].m_nNewWidth += nDiff;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta + nDiff);
+m_GlyphItems[i].addNewWidth(nDiff);
+m_GlyphItems[i].adjustLinearPosX(nDelta + nDiff);
 
 // Adjust the X position of all glyphs in the cluster.
 size_t j = i;
@@ -754,7 +754,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 --j;
 if (!m_GlyphItems[j].IsInCluster())
 break;
-m_GlyphItems[j].m_aLinearPos.adjustX(nDelta + nDiff);
+m_GlyphItems[j].adjustLinearPosX(nDelta + nDiff);
 }
 
 // If this glyph is Kashida-justifiable, then mark this as a
@@ -771,7 +771,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 {
 if (!m_GlyphItems[j].IsDiacritic())
 break;
-m_GlyphItems[j--].m_aLinearPos.adjustX(nDiff);
+m_GlyphItems[j--].adjustLinearPosX(nDiff);
 }
 }
 i++;
@@ -813,7 +813,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 nOverlap = nExcess / (nCopies - 1);
 }
 
-DevicePoint aPos(pGlyphIter->m_aLinearPos.getX() - nTotalWidth, 0);
+DevicePoint aPos(pGlyphIter->linearPos().getX() - nTotalWidth, 0);
 int nCharPos = pGlyphIter->charPos();
 GlyphItemFlags const nFlags = GlyphItemFlags::IS_IN_CLUSTER | 
GlyphItemFlags::IS_RTL_GLYPH;
 while (nCopies--)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 7e01ed70dc58..8f9792acf54a 100644
--- a/vcl/source/gdi/pdfwri

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

2022-04-09 Thread Andreas Heinisch (via logerrit)
 cui/source/dialogs/cuicharmap.cxx  |   12 
 sw/qa/uitest/writer_tests3/specialCharacter.py |   17 -
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 7a2bd19355d78551f9ce253fca69d37881d1d1c1
Author: Andreas Heinisch 
AuthorDate: Tue Mar 22 21:12:09 2022 +0100
Commit: Andreas Heinisch 
CommitDate: Sat Apr 9 14:31:09 2022 +0200

tdf#56363 - Search font family without the font feature after the colon

In the special character dialog, search font family without the font
feature after the colon in order to find the correct item in the font
combobox.

Change-Id: I60d068bb22782bcce062365a8d4d53e15ec34c76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131953
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 95678899df90..42c12c5e3ce9 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -477,7 +477,7 @@ void SvxCharacterMap::init()
 // the font may not be in the list =>
 // try to find a font name token in list and select found font,
 // else select topmost entry
-bool bFound = (m_xFontLB->find_text(aDefStr) == -1);
+bool bFound = (m_xFontLB->find_text(aDefStr) != -1);
 if (!bFound)
 {
 sal_Int32 nIndex = 0;
@@ -611,17 +611,21 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont 
)
 // like "Times New Roman;Times" resolved
 vcl::Font aTmp(m_xVirDev->GetFontMetric(rFont));
 
-if (aTmp.GetFamilyName() == "StarSymbol" && 
m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+// tdf#56363 - search font family without the font feature after the colon
+OUString sFontFamilyName = aTmp.GetFamilyName();
+if (const sal_Int32 nIndex = sFontFamilyName.indexOf(":"); nIndex != -1)
+sFontFamilyName = sFontFamilyName.copy(0, nIndex);
+if (sFontFamilyName == "StarSymbol" && 
m_xFontLB->find_text(sFontFamilyName) == -1)
 {
 //if for some reason, like font in an old document, StarSymbol is 
requested and it's not available, then
 //try OpenSymbol instead
 aTmp.SetFamilyName("OpenSymbol");
 }
 
-if (m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+if (m_xFontLB->find_text(sFontFamilyName) == -1)
 return;
 
-m_xFontLB->set_active_text(aTmp.GetFamilyName());
+m_xFontLB->set_active_text(sFontFamilyName);
 aFont = aTmp;
 FontSelectHdl(*m_xFontLB);
 if (m_xSubsetLB->get_count())
diff --git a/sw/qa/uitest/writer_tests3/specialCharacter.py 
b/sw/qa/uitest/writer_tests3/specialCharacter.py
index 577b8b531984..494875024c1e 100644
--- a/sw/qa/uitest/writer_tests3/specialCharacter.py
+++ b/sw/qa/uitest/writer_tests3/specialCharacter.py
@@ -12,10 +12,25 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 
-
 # specialcharacters.ui
 class specialCharacter(UITestCase):
 
+def test_tdf56363(self):
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+
+# Insert a font including a font feature into the font name 
combobox
+xFontName = xWriterDoc.getChild("fontnamecombobox")
+xFontName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xFontName.executeAction("TYPE", 
mkPropertyValues({"TEXT":"Liberation Sans:smcp"}))
+xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+
+# Open special character dialog and check selected font name
+with 
self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", 
close_button="cancel") as xDialog:
+xComboFont = xDialog.getChild("fontlb")
+# Without the fix in place, no font would be selected
+self.assertEqual(get_state_as_dict(xComboFont)["Text"], 
"Liberation Sans")
+
 def test_special_character(self):
 with self.ui_test.create_doc_in_start_center("writer") as document:
 


[Libreoffice-commits] core.git: cppu/source stoc/source

2022-04-09 Thread Noel Grandin (via logerrit)
 cppu/source/typelib/typelib.cxx  |5 +++--
 stoc/source/security/permissions.cxx |   11 ++-
 2 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 035c9fc7ecaf0fce032748f47450fb31cc62d65a
Author: Noel Grandin 
AuthorDate: Sat Apr 9 09:42:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 9 13:26:39 2022 +0200

use more subView when converting to Int32

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

diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index d659171f1722..fddaa16baa3a 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "typelib.hxx"
 
 using namespace osl;
@@ -1984,8 +1985,8 @@ extern "C" void SAL_CALL 
typelib_typedescription_getByName(
 &pInterface, name.copy(i4 + 1).pData);
 if (!createDerivedInterfaceMemberDescription(
 ppRet, name, pBaseRef, pBase, pInterface,
-name.copy(i2, i3 - i2).toInt32(),
-name.copy(i3 + 1, i4 - i3 - 1).toInt32()))
+o3tl::toInt32(name.subView(i2, i3 - i2)),
+o3tl::toInt32(name.subView(i3 + 1, i4 - i3 - 1
 {
 if (pInterface != nullptr) {
 typelib_typedescription_release(pInterface);
diff --git a/stoc/source/security/permissions.cxx 
b/stoc/source/security/permissions.cxx
index 1d7aca177344..8fa8bdd831cd 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -148,20 +149,20 @@ SocketPermission::SocketPermission(
 sal_Int32 minus = m_host.indexOf( '-', colon +1 );
 if (minus < 0)
 {
-m_lowerPort = m_upperPort = m_host.copy( colon +1 ).toInt32();
+m_lowerPort = m_upperPort = o3tl::toInt32(m_host.subView( colon +1 ));
 }
 else if (minus == (colon +1)) // -N
 {
-m_upperPort = m_host.copy( minus +1 ).toInt32();
+m_upperPort = o3tl::toInt32(m_host.subView( minus +1 ));
 }
 else if (minus == (m_host.getLength() -1)) // N-
 {
-m_lowerPort = m_host.copy( colon +1, m_host.getLength() -1 -colon -1 
).toInt32();
+m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, 
m_host.getLength() -1 -colon -1 ));
 }
 else // A-B
 {
-m_lowerPort = m_host.copy( colon +1, minus - colon -1 ).toInt32();
-m_upperPort = m_host.copy( minus +1 ).toInt32();
+m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, minus - colon -1 
));
+m_upperPort = o3tl::toInt32(m_host.subView( minus +1 ));
 }
 m_host = m_host.copy( 0, colon );
 }


[Libreoffice-commits] core.git: odk/docs unoidl/source

2022-04-09 Thread Stephan Bergmann (via logerrit)
 odk/docs/idl/wikilinks.py |2 
 unoidl/source/unoidl-read.cxx |  125 +-
 2 files changed, 100 insertions(+), 27 deletions(-)

New commits:
commit 29578ae1394de2fffae2e34326d03d81b4c4f475
Author: Stephan Bergmann 
AuthorDate: Sat Apr 9 12:16:41 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Sat Apr 9 13:15:01 2022 +0200

Introduce `unoidl-read --summary` mode

...as needed by odk/docs/idl/wikilinks.py

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

diff --git a/odk/docs/idl/wikilinks.py b/odk/docs/idl/wikilinks.py
index 7854f645063e..4f775d29b550 100644
--- a/odk/docs/idl/wikilinks.py
+++ b/odk/docs/idl/wikilinks.py
@@ -22,7 +22,7 @@ allkinds = {}
 
 # unfortunately we need to know what kind of entity to declare...
 # generate this file like so:
-# solver/unxlngx6/bin/regview solver/unxlngx6/bin/types.rdb | grep -A1 "type 
class:" | awk '/type class:/ { class = $NF } /type name:/ { gsub("/", ".", 
$NF); gsub("\"", "", $NF); print class, $NF }' > /tmp/kinds
+# cat <(make -s cmd cmd='LD_LIBRARY_PATH=$(INSTDIR_FOR_BUILD)/program 
$(WORKDIR_FOR_BUILD)/LinkTarget/Executable/unoidl-read --summary 
$(INSTDIR)/program/types.rdb') <(make -s cmd 
cmd='LD_LIBRARY_PATH=$(INSTDIR_FOR_BUILD)/program 
$(WORKDIR_FOR_BUILD)/LinkTarget/Executable/unoidl-read --summary 
$(INSTDIR)/program/types.rdb $(INSTDIR)/program/types/offapi.rdb') | LC_ALL=C 
sort | LC_ALL=C uniq > /tmp/kinds
 for line in open("/tmp/kinds") :
 (kind,_,name) = line.strip().partition(" ")
 allkinds[name] = kind
diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index a458d9b32863..fec721a34491 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -32,7 +32,7 @@ namespace {
 void badUsage() {
 std::cerr
 << "Usage:" << std::endl << std::endl
-<< "  unoidl-read [--published] [] "
+<< "  unoidl-read [--published] [--summary] [] 
"
 << std::endl << std::endl
 << ("where each  is either a new- or legacy-format .rdb 
file,"
 " a single .idl")
@@ -46,7 +46,10 @@ void badUsage() {
 << ("published entities (plus any non-published entities referenced"
 " from published")
 << std::endl
-<< "via any unpublished optional bases) are written out." << std::endl;
+<< "via any unpublished optional bases) are written out.  If --summary 
is specified,"
+<< std::endl
+<< "only a short summary is written, with the type and name of one 
entity per line."
+<< std::endl;
 std::exit(EXIT_FAILURE);
 }
 
@@ -139,9 +142,9 @@ struct Entity {
 enum class Written { NO, DECLARATION, DEFINITION };
 
 explicit Entity(
-rtl::Reference const & theEntity, bool theRelevant):
+rtl::Reference const & theEntity, bool theRelevant, 
Entity * theParent):
 entity(theEntity), relevant(theRelevant), sorted(Sorted::NO),
-written(Written::NO)
+written(Written::NO), parent(theParent)
 {}
 
 rtl::Reference const entity;
@@ -150,6 +153,7 @@ struct Entity {
 bool relevant;
 Sorted sorted;
 Written written;
+Entity * parent;
 };
 
 void insertEntityDependency(
@@ -215,8 +219,8 @@ void insertTypeDependency(
 
 void scanMap(
 rtl::Reference const & manager,
-rtl::Reference const & cursor, bool published,
-std::u16string_view prefix, std::map & entities)
+rtl::Reference const & cursor, bool modules, bool 
published,
+std::u16string_view prefix, Entity * parent, std::map & 
entities)
 {
 assert(cursor.is());
 for (;;) {
@@ -227,11 +231,17 @@ void scanMap(
 }
 OUString name(prefix + id);
 if (ent->getSort() == unoidl::Entity::SORT_MODULE) {
+Entity * p = nullptr;
+if (modules) {
+p = &entities.insert(std::make_pair(name, Entity(ent, 
!published, parent))).first
+->second;
+}
 scanMap(
 manager,
-static_cast(ent.get())->createCursor(),
-published, OUStringConcatenation(name + "."), entities);
+static_cast(ent.get())->createCursor(), modules,
+published, OUStringConcatenation(name + "."), p, entities);
 } else {
+auto const pub = static_cast(ent.get())->isPublished();
 std::map::iterator i(
 entities.insert(
 std::make_pair(
@@ -239,10 +249,14 @@ void scanMap(
 Entity(
 ent,
 (!published
- || (static_cast(
- ent.get())
- ->isPublished())
+ || pub),
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 18 commits - external/nss oox/source solenv/flatpak-manifest.in sw/inc sw/qa sw/source sw/uiconfig vcl/inc vcl/qt5 vcl/unx writerfi

2022-04-09 Thread Jan-Marek Glogowski (via logerrit)
 external/nss/ExternalProject_nss.mk   |4 
 oox/source/export/shapes.cxx  |3 
 solenv/flatpak-manifest.in|1 
 sw/inc/IDocumentMarkAccess.hxx|5 
 sw/qa/core/data/rtf/pass/forcepoint104.rtf|  571 
++
 sw/qa/core/doc/doc.cxx|   28 
 sw/qa/extras/ooxmlexport/data/TestPuzzleExport.odt|binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx|   30 
 sw/qa/extras/rtfexport/data/tdf95706.rtf  |   36 
 sw/qa/extras/rtfexport/rtfexport4.cxx |   61 +
 sw/qa/extras/uiwriter/data/variable-field-table-row-split-header.fodt |  270 

 sw/qa/extras/uiwriter/uiwriter.cxx|4 
 sw/qa/extras/uiwriter/uiwriter3.cxx   |   73 +
 sw/source/core/doc/DocumentFieldsManager.cxx  |   25 
 sw/source/core/doc/docbm.cxx  |   22 
 sw/source/core/doc/docfld.cxx |   45 
 sw/source/core/doc/docfly.cxx |2 
 sw/source/core/docnode/node2lay.cxx   |   77 +
 sw/source/core/fields/expfld.cxx  |3 
 sw/source/core/inc/MarkManager.hxx|2 
 sw/source/core/inc/docfld.hxx |   11 
 sw/source/core/inc/node2lay.hxx   |6 
 sw/source/core/undo/unbkmk.cxx|2 
 sw/source/core/undo/undobj.cxx|2 
 sw/source/ui/dbui/mmoutputtypepage.cxx|4 
 sw/source/ui/dbui/mmresultdialogs.cxx |3 
 sw/source/ui/misc/bookmark.cxx|2 
 sw/source/uibase/dochdl/swdtflvr.cxx  |4 
 sw/source/uibase/shells/textsh1.cxx   |4 
 sw/source/uibase/utlui/content.cxx|2 
 sw/uiconfig/swriter/ui/exchangedatabases.ui   |  150 +-
 vcl/inc/qt5/QtFrame.hxx   |7 
 vcl/inc/qt5/QtMenu.hxx|2 
 vcl/inc/qt5/QtTransferable.hxx|2 
 vcl/inc/qt5/QtWidget.hxx  |4 
 vcl/qt5/QtFrame.cxx   |   99 -
 vcl/qt5/QtMenu.cxx|   38 
 vcl/qt5/QtTransferable.cxx|   25 
 vcl/qt5/QtWidget.cxx  |   32 
 vcl/unx/gtk3/gtkframe.cxx |   20 
 vcl/unx/gtk3/gtkinst.cxx  |4 
 writerfilter/source/rtftok/rtfcharsets.cxx|9 
 writerfilter/source/rtftok/rtfcharsets.hxx|   13 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   39 
 44 files changed, 1491 insertions(+), 255 deletions(-)

New commits:
commit a191e68148206ef736ce80fa336be462f5bcb50b
Author: Jan-Marek Glogowski 
AuthorDate: Thu Apr 7 01:07:43 2022 +0200
Commit: Andras Timar 
CommitDate: Sat Apr 9 12:31:13 2022 +0200

tdf#141578 Qt handle QtFrame screen changes

LO doesn't provide any way to notify screen changes / scaling
factors of a window and in fact doesn't really handle scaling
factors in VCL. The QWidget doesn't receive a resize event,
because it's size doesn't change, just the scaling factor.
So we trigger a faked resize on QWindow::screenChanged signal.

Change-Id: I6928c4c62d1c0995c70fea0088cff17849bcd1d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132650
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 881cfbf77567194f5016a961d1c3db869734d68b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132740
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 59ec093a2ed6..5ffaacf3ad94 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -25,6 +25,7 @@
 #include 
 
 #include "QtTools.hxx"
+#include "QtWidget.hxx"
 
 #include 
 #include 
@@ -70,7 +71,7 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 
 friend class QtWidget;
 
-QWidget* m_pQWidget;
+QtWidget* m_pQWidget;
 QtMainWindow* m_pTopLevel;
 
 const bool m_bUseCairo;
@

[Libreoffice-commits] core.git: codemaker/source include/o3tl o3tl/qa sal/osl

2022-04-09 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cppumaker.cxx |   13 ++-
 codemaker/source/cppumaker/dumputils.cxx |5 -
 codemaker/source/cppumaker/dumputils.hxx |2 
 codemaker/source/javamaker/javamaker.cxx |   13 ++-
 include/o3tl/string_view.hxx |   44 
 o3tl/qa/test-string_view.cxx |  107 +++
 sal/osl/all/debugbase.cxx|3 
 7 files changed, 171 insertions(+), 16 deletions(-)

New commits:
commit 2bf56582475179faa9d71573532a0d416cb64bfc
Author: Noel Grandin 
AuthorDate: Fri Apr 8 13:49:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 9 09:08:56 2022 +0200

add a more complete o3tl::getToken

so we avoid OUString copying (mostly when doing stuff like parsing
numbers of out of strings)

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

diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index 384e2b5aa079..b2556655b361 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "cppuoptions.hxx"
 #include "cpputype.hxx"
@@ -57,13 +58,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 if (options.isValid("-T")) {
 OUString names(b2u(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
-OUString name(names.getToken(0, ';', i));
-if (!name.isEmpty()) {
+std::u16string_view name(o3tl::getToken(names, 0, ';', i));
+if (!name.empty()) {
 produce(
-(name == "*"
- ? ""
- : name.endsWith(".*")
- ? name.copy(0, name.getLength() - std::strlen(".*"))
+OUString(name == u"*"
+ ? u""
+ : o3tl::ends_with(name, u".*")
+ ? name.substr(0, name.size() - std::strlen(".*"))
  : name),
 typeMgr, generated, options);
 }
diff --git a/codemaker/source/cppumaker/dumputils.cxx 
b/codemaker/source/cppumaker/dumputils.cxx
index 8524b1962ce2..2a3e809e70f3 100644
--- a/codemaker/source/cppumaker/dumputils.cxx
+++ b/codemaker/source/cppumaker/dumputils.cxx
@@ -24,17 +24,18 @@
 
 #include 
 #include 
+#include 
 
 
 namespace codemaker::cppumaker {
 
 bool dumpNamespaceOpen(
-FileStream & out, OUString const & entityName, bool fullModuleType)
+FileStream & out, std::u16string_view entityName, bool fullModuleType)
 {
 bool bOutput = false;
 bool bFirst = true;
 for (sal_Int32 i = 0; i >= 0;) {
-OUString id(entityName.getToken(0, '.', i));
+std::u16string_view id(o3tl::getToken(entityName, 0, '.', i));
 if (fullModuleType || i >= 0) {
 if (!bFirst) {
 out << " ";
diff --git a/codemaker/source/cppumaker/dumputils.hxx 
b/codemaker/source/cppumaker/dumputils.hxx
index 2fcd708c43fb..24e5bae3bede 100644
--- a/codemaker/source/cppumaker/dumputils.hxx
+++ b/codemaker/source/cppumaker/dumputils.hxx
@@ -30,7 +30,7 @@ class FileStream;
 
 namespace codemaker::cppumaker
 {
-bool dumpNamespaceOpen(FileStream& out, rtl::OUString const& entityName, bool 
fullModuleType);
+bool dumpNamespaceOpen(FileStream& out, std::u16string_view entityName, bool 
fullModuleType);
 
 bool dumpNamespaceClose(FileStream& out, std::u16string_view entityName, bool 
fullModuleType);
 
diff --git a/codemaker/source/javamaker/javamaker.cxx 
b/codemaker/source/javamaker/javamaker.cxx
index 044292bf6b8f..ee376c8cc484 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "javaoptions.hxx"
 #include "javatype.hxx"
@@ -57,13 +58,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 if (options.isValid("-T")) {
 OUString names(b2u(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
-OUString name(names.getToken(0, ';', i));
-if (!name.isEmpty()) {
+std::u16string_view name(o3tl::getToken(names, 0, ';', i));
+if (!name.empty()) {
 produce(
-(name == "*"
- ? ""
- : name.endsWith(".*")
- ? name.copy(0, name.getLength() - std::strlen(".*"))
+OUString(name == u"*"
+ ? u""
+ : o3tl::ends_with(name, u".*")
+ ? name.substr(0, name.size() - std::strlen(".*"))
  : name),
 typeMgr, generated