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

2021-02-04 Thread Noel (via logerrit)
 editeng/source/uno/unofield.cxx |4 ++--
 include/editeng/mutxhelp.hxx|   36 
 include/editeng/unofield.hxx|4 ++--
 include/svx/unopage.hxx |9 +
 svx/source/unodraw/unopage.cxx  |2 +-
 5 files changed, 10 insertions(+), 45 deletions(-)

New commits:
commit 011d0d0078841a8ccebfdd1b360172314493c750
Author: Noel 
AuthorDate: Thu Feb 4 10:43:10 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 4 14:29:36 2021 +0100

remove svx/mutxhelp.hxx

which is a clone of cppu::BaseMutex

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

diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 59772b594490..081ccec809db 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -249,7 +249,7 @@ sal_Int64 SAL_CALL SvxUnoTextField::getSomething( const 
css::uno::Sequence< sal_
 }
 
 SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw()
-:   OComponentHelper( getMutex() )
+:   OComponentHelper( m_aMutex )
 ,   mpPropSet(nullptr)
 ,   mnServiceId(nServiceId)
 ,   mpImpl( new SvxUnoFieldData_Impl )
@@ -315,7 +315,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) 
throw()
 }
 
 SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > const & 
xAnchor, const OUString& rPresentation, const SvxFieldData* pData ) throw()
-:   OComponentHelper( getMutex() )
+:   OComponentHelper( m_aMutex )
 ,   mxAnchor( xAnchor )
 ,   mpPropSet(nullptr)
 ,   mnServiceId(text::textfield::Type::UNSPECIFIED)
diff --git a/include/editeng/mutxhelp.hxx b/include/editeng/mutxhelp.hxx
deleted file mode 100644
index 7487fee48e46..
--- a/include/editeng/mutxhelp.hxx
+++ /dev/null
@@ -1,36 +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 .
- */
-
-#ifndef INCLUDED_EDITENG_MUTXHELP_HXX
-#define INCLUDED_EDITENG_MUTXHELP_HXX
-
-#include 
-
-class SvxMutexHelper
-{
-private:
-::osl::Mutex maMutex;
-
-public:
-::osl::Mutex& getMutex() { return maMutex; }
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/unofield.hxx b/include/editeng/unofield.hxx
index 8eb521066347..173bb4b11121 100644
--- a/include/editeng/unofield.hxx
+++ b/include/editeng/unofield.hxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 
 namespace com::sun::star::beans { class XPropertySetInfo; }
@@ -41,7 +41,7 @@ class SvxFieldData;
 css::uno::Reference< css::uno::XInterface > EDITENG_DLLPUBLIC 
SvxUnoTextCreateTextField(
 const OUString& ServiceSpecifier );
 
-class EDITENG_DLLPUBLIC SvxUnoTextField final : public SvxMutexHelper,
+class EDITENG_DLLPUBLIC SvxUnoTextField final : public cppu::BaseMutex,
 public ::cppu::OComponentHelper,
 public css::text::XTextField,
 public css::beans::XPropertySet,
diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx
index a428254f6af7..bff0aa5fd5e3 100644
--- a/include/svx/unopage.hxx
+++ b/include/svx/unopage.hxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -52,14 +52,15 @@ enum class SdrInventor : sal_uInt32;
 #define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
 #define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
 
-class SVXCORE_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper7< 
css::drawing::XDrawPage,
+class SVXCORE_DLLPUBLIC SvxDrawPage : protected cppu::BaseMutex,
+public ::cppu::WeakAggImplHelper7< 
css::drawing::XDrawPage,
css::drawing::XShapeGrouper,
css::drawing::XShapes2,
css::drawing::XShapes3,
css::lang::XServiceInfo,
css::lang::XUnoTunnel,
-

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

2021-02-03 Thread Pranam Lashkari (via logerrit)
 editeng/source/editeng/impedit.cxx |2 +-
 sw/source/core/crsr/crstrvl.cxx|7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 3233db0913193855285e1f56492d4617368441b6
Author: Pranam Lashkari 
AuthorDate: Mon Feb 1 22:18:01 2021 +0530
Commit: Pranam Lashkari 
CommitDate: Wed Feb 3 17:34:03 2021 +0100

enable hyperlink to be detected at the end of text

now in online hyperlink popup will appear
even when the cursor is at the end of hyperlink text

Change-Id: I80a1a093afa11e39236693f8a2639741f74c9876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110227
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 389b9d5bca20..40d551eab27f 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1818,7 +1818,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& 
rPos, sal_Int32* pPara,
 for (size_t nAttr = rAttrs.size(); nAttr; )
 {
 const EditCharAttrib& rAttr = *rAttrs[--nAttr];
-if (rAttr.GetStart() == nXPos)
+if (rAttr.GetStart() == nXPos || rAttr.GetEnd() == nXPos)
 {
 if (rAttr.Which() == EE_FEATURE_FIELD)
 {
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 893233c7ec1a..9c18f16f4fbb 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1573,8 +1573,11 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
  && IsAttrAtPos::InetAttr & rContentAtPos.eContentAtPos
  && !aTmpState.m_bFootnoteNoInfo )
 {
-pTextAttr = pTextNd->GetTextAttrAt(
-aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
+sal_Int32 index = aPos.nContent.GetIndex();
+pTextAttr = pTextNd->GetTextAttrAt(index, 
RES_TXTATR_INETFMT);
+
+if(!pTextAttr && index > 0)
+pTextAttr = pTextNd->GetTextAttrAt(index - 1, 
RES_TXTATR_INETFMT);
 // "detect" only INetAttrs with URLs
 if( pTextAttr && 
!pTextAttr->GetINetFormat().GetValue().isEmpty() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng offapi/com sw/inc sw/source

2021-02-02 Thread Miklos Vajna (via logerrit)
 editeng/source/items/frmitems.cxx|9 +
 include/editeng/memberids.h  |1 +
 offapi/com/sun/star/style/PageProperties.idl |7 +++
 sw/inc/unoprnms.hxx  |1 +
 sw/source/core/unocore/unomap1.cxx   |1 +
 5 files changed, 19 insertions(+)

New commits:
commit 947277146e4c1ff7544371095fcc6bd5842b2d98
Author: Miklos Vajna 
AuthorDate: Tue Feb 2 15:49:16 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 2 19:30:33 2021 +0100

sw page gutter margin: add UNO API

SvxLRSpaceItem is used for all sorts of left/right margins, but gutter
only makes sense for pages, so only expose the gutter margin in the page
properties.

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index e1520735d804..c6b26c1c03a5 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -372,6 +372,11 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 rVal <<= IsAutoFirst();
 break;
 
+case MID_GUTTER_MARGIN:
+rVal <<= static_cast(bConvert ? 
convertTwipToMm100(m_nGutterMargin)
+ : m_nGutterMargin);
+break;
+
 default:
 bRet = false;
 // SfxDispatchController_Impl::StateChanged calls this with 
hardcoded 0 triggering this; there used to be a MID_LR_MARGIN 0 but what type 
would it have?
@@ -447,6 +452,10 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 SetAutoFirst( Any2Bool(rVal) );
 break;
 
+case MID_GUTTER_MARGIN:
+SetGutterMargin(bConvert ? convertMm100ToTwip(nVal) : nVal);
+break;
+
 default:
 OSL_FAIL("unknown MemberId");
 return false;
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index a857d7593afb..8a6c9d0e7769 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -129,6 +129,7 @@
 #define MID_FIRST_LINE_REL_INDENT   9
 #define MID_FIRST_AUTO  10
 #define MID_TXT_LMARGIN 11
+#define MID_GUTTER_MARGIN 12
 
 //ProtectItem
 #define MID_PROTECT_CONTENT 0
diff --git a/offapi/com/sun/star/style/PageProperties.idl 
b/offapi/com/sun/star/style/PageProperties.idl
index 73242f230f90..dccd63f20b04 100644
--- a/offapi/com/sun/star/style/PageProperties.idl
+++ b/offapi/com/sun/star/style/PageProperties.idl
@@ -487,6 +487,13 @@ published service PageProperties
 @since LibreOffice 6.1
  */
 [optional, property, maybevoid] com::sun::star::graphic::XGraphic 
FooterBackGraphic;
+
+/** determines the gutter margin of the page.
+
+@since LibreOffice 7.2
+ */
+[optional, property] long GutterMargin;
+
 };
 
 }; }; }; };
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 8fc67fdf5206..9cceac0f8d0f 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -66,6 +66,7 @@
 #define UNO_NAME_PARA_HYPHENATION_NO_CAPS "ParaHyphenationNoCaps"
 #define UNO_NAME_LEFT_MARGIN "LeftMargin"
 #define UNO_NAME_RIGHT_MARGIN "RightMargin"
+#define UNO_NAME_GUTTER_MARGIN "GutterMargin"
 #define UNO_NAME_HEADER_LEFT_MARGIN "HeaderLeftMargin"
 #define UNO_NAME_HEADER_RIGHT_MARGIN "HeaderRightMargin"
 #define UNO_NAME_FOOTER_LEFT_MARGIN "FooterLeftMargin"
diff --git a/sw/source/core/unocore/unomap1.cxx 
b/sw/source/core/unocore/unomap1.cxx
index d3fb8b909608..253da09f67f1 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -445,6 +445,7 @@ const SfxItemPropertyMapEntry*  
SwUnoPropertyMapProvider::GetPageStylePropertyMa
 { u"" UNO_NAME_BACK_GRAPHIC_LOCATION, RES_BACKGROUND, 
cppu::UnoType::get(), PROPERTY_NONE 
,MID_GRAPHIC_POSITION},
 { u"" UNO_NAME_LEFT_MARGIN, RES_LR_SPACE, 
cppu::UnoType::get(), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
 { u"" UNO_NAME_RIGHT_MARGIN, RES_LR_SPACE,
cppu::UnoType::get(), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
+{ u"" UNO_NAME_GUTTER_MARGIN, RES_LR_SPACE, 
cppu::UnoType::get(), PROPERTY_NONE, MID_GUTTER_MARGIN | 
CONVERT_TWIPS},
 { u"" UNO_NAME_BACK_TRANSPARENT, RES_BACKGROUND,  
cppu::UnoType::get(), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT  
 },
 { u"" UNO_NAME_LEFT_BORDER, RES_BOX,  
cppu::UnoType::get(),  0, LEFT_BORDER  |CONVERT_TWIPS },
 { u"" UNO_NAME_RIGHT_BORDER, RES_BOX, 
cppu::UnoType::get(),  0, RIGHT_BORDER |CONVERT_TWIPS },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libre

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

2021-02-02 Thread Miklos Vajna (via logerrit)
 editeng/source/items/frmitems.cxx |5 +
 include/editeng/lrspitem.hxx  |4 
 2 files changed, 9 insertions(+)

New commits:
commit 48829edfb148ff61d1e03319547151380899ba63
Author: Miklos Vajna 
AuthorDate: Tue Feb 2 12:22:15 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 2 14:17:28 2021 +0100

sw page gutter margin: add doc model

The page gutter defines the amount of extra space added to the specified
margin, above any existing margin values. This can be helpful in case of
printed books: e.g. 1cm left margin, 1cm right margin, then some
additional gutter margin on the left can mean that once the book is
printed and binding consumes its space, the remaining left/right margin
is matching.

This is just the doc model, other parts will come in follow-up commits.

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 184bf21cd994..e1520735d804 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -289,6 +289,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
 nTxtLeft( 0 ),
 nLeftMargin ( 0 ),
 nRightMargin( 0 ),
+m_nGutterMargin(0),
 nPropFirstLineOffset( 100 ),
 nPropLeftMargin( 100 ),
 nPropRightMargin( 100 ),
@@ -308,6 +309,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const tools::Long nLeft, 
const tools::Long nRigh
 nTxtLeft( nTLeft ),
 nLeftMargin ( nLeft ),
 nRightMargin( nRight ),
+m_nGutterMargin(0),
 nPropFirstLineOffset( 100 ),
 nPropLeftMargin( 100 ),
 nPropRightMargin( 100 ),
@@ -472,6 +474,7 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) 
const
 return (
 nFirstLineOffset == rOther.GetTextFirstLineOffset() &&
 nTxtLeft == rOther.GetTextLeft() &&
+m_nGutterMargin == rOther.GetGutterMargin() &&
 nLeftMargin == rOther.GetLeft()  &&
 nRightMargin == rOther.GetRight() &&
 nPropFirstLineOffset == rOther.GetPropTextFirstLineOffset() &&
@@ -594,6 +597,8 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nTxtLeft"), 
BAD_CAST(OString::number(nTxtLeft).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeftMargin"), 
BAD_CAST(OString::number(nLeftMargin).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRightMargin"), 
BAD_CAST(OString::number(nRightMargin).getStr()));
+xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nGutterMargin"),
+
BAD_CAST(OString::number(m_nGutterMargin).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropFirstLineOffset"), 
BAD_CAST(OString::number(nPropFirstLineOffset).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropLeftMargin"), 
BAD_CAST(OString::number(nPropLeftMargin).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropRightMargin"), 
BAD_CAST(OString::number(nPropRightMargin).getStr()));
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index b04944326407..9b3ec7734a8e 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -51,6 +51,8 @@ class EDITENG_DLLPUBLIC SvxLRSpaceItem final : public 
SfxPoolItem
 tools::LongnTxtLeft;   // We spend a sal_uInt16
 tools::LongnLeftMargin;// nLeft or the negative first-line 
indent
 tools::LongnRightMargin;   // The unproblematic right edge
+/// The amount of extra space added to the left margin.
+tools::Longm_nGutterMargin;
 
 sal_uInt16  nPropFirstLineOffset, nPropLeftMargin, nPropRightMargin;
 short   nFirstLineOffset; // First-line indent _always_ relative to 
nTxtLeft
@@ -116,6 +118,8 @@ public:
 { return nPropFirstLineOffset; }
 void SetTextFirstLineOffsetValue( const short nValue )
 { nFirstLineOffset = nValue; }
+void SetGutterMargin(const tools::Long nGutterMargin) { m_nGutterMargin = 
nGutterMargin; }
+tools::Long GetGutterMargin() const { return m_nGutterMargin; }
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 virtual boost::property_tree::ptree dumpAsJSON() const override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/svtools sc/source svtools/source sw/inc sw/source

2021-02-01 Thread Andrea Gelmini (via logerrit)
 editeng/source/editeng/eehtml.cxx   |4 ++--
 include/svtools/htmlkywd.hxx|2 +-
 include/svtools/htmltokn.h  |4 ++--
 sc/source/filter/html/htmlpars.cxx  |4 ++--
 svtools/source/svhtml/htmlkywd.cxx  |2 +-
 svtools/source/svhtml/parhtml.cxx   |4 ++--
 sw/inc/poolfmt.hxx  |2 +-
 sw/inc/strings.hrc  |2 +-
 sw/source/core/doc/DocumentStylePoolManager.cxx |4 ++--
 sw/source/filter/html/css1atr.cxx   |   10 +-
 sw/source/filter/html/htmlcss1.cxx  |2 +-
 sw/source/filter/html/swhtml.cxx|4 ++--
 12 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 585b0a39d7170ef30d0a1d03601e008613df9807
Author: Andrea Gelmini 
AuthorDate: Wed Jan 6 12:46:45 2021 +0100
Commit: Eike Rathke 
CommitDate: Tue Feb 2 00:57:00 2021 +0100

Fix typo in code

As per request in comments here:
https://gerrit.libreoffice.org/c/core/+/108661

I don't remember if it was already corrected and rejected.
Anyway, this is massive and it compiles on my laptop.

Let's see adding devs.

Thanks a lot to Seth!

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

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index ea38d05d290d..d83b5410d14f 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -370,8 +370,8 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 case HtmlTokenId::ADDRESS_OFF:
 //  case HtmlTokenId::BLOCKQUOTE_ON://! special handling
 //  case HtmlTokenId::BLOCKQUOTE_OFF:
-case HtmlTokenId::CITIATION_ON:
-case HtmlTokenId::CITIATION_OFF:
+case HtmlTokenId::CITATION_ON:
+case HtmlTokenId::CITATION_OFF:
 case HtmlTokenId::CODE_ON:
 case HtmlTokenId::CODE_OFF:
 case HtmlTokenId::DEFINSTANCE_ON:
diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx
index 1594dbc6b829..24133bd159cd 100644
--- a/include/svtools/htmlkywd.hxx
+++ b/include/svtools/htmlkywd.hxx
@@ -61,7 +61,7 @@
 #define OOO_STRING_SVTOOLS_HTML_bold "b"
 #define OOO_STRING_SVTOOLS_HTML_caption "caption"
 #define OOO_STRING_SVTOOLS_HTML_center "center"
-#define OOO_STRING_SVTOOLS_HTML_citiation "cite"
+#define OOO_STRING_SVTOOLS_HTML_citation "cite"
 #define OOO_STRING_SVTOOLS_HTML_code "code"
 #define OOO_STRING_SVTOOLS_HTML_col "col"
 #define OOO_STRING_SVTOOLS_HTML_colgroup "colgroup"
diff --git a/include/svtools/htmltokn.h b/include/svtools/htmltokn.h
index c4acf8dbeef7..ea27faa89471 100644
--- a/include/svtools/htmltokn.h
+++ b/include/svtools/htmltokn.h
@@ -108,8 +108,8 @@ enum class HtmlTokenId : sal_Int16
 CAPTION_OFF, // HTML 3.0
 CENTER_ON, // Netscape
 CENTER_OFF,  // Netscape
-CITIATION_ON,
-CITIATION_OFF,
+CITATION_ON,
+CITATION_OFF,
 CODE_ON,
 CODE_OFF,
 COL_ON, // HTML3 Table Model Draft
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index 13b00a60bb30..f922bb21b86d 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1599,7 +1599,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo 
)
 case HtmlTokenId::ADDRESS_ON :
 case HtmlTokenId::BLOCKQUOTE_ON :
 case HtmlTokenId::BLOCKQUOTE30_ON :
-case HtmlTokenId::CITIATION_ON :
+case HtmlTokenId::CITATION_ON :
 case HtmlTokenId::VARIABLE_ON :
 {
 if ( IsAtBeginningOfText( pInfo ) )
@@ -2878,7 +2878,7 @@ void ScHTMLQueryParser::ProcessToken( const 
HtmlImportInfo& rInfo )
 case HtmlTokenId::ADDRESS_ON:   // 
 case HtmlTokenId::BLOCKQUOTE_ON:// 
 case HtmlTokenId::BLOCKQUOTE30_ON:  // 
-case HtmlTokenId::CITIATION_ON: // 
+case HtmlTokenId::CITATION_ON:  // 
 case HtmlTokenId::VARIABLE_ON:  // 
 mpCurrTable->PutItem( SvxPostureItem( ITALIC_NORMAL, 
ATTR_FONT_POSTURE ) );
 break;
diff --git a/svtools/source/svhtml/htmlkywd.cxx 
b/svtools/source/svhtml/htmlkywd.cxx
index 482bfab5e611..1873b8ee186a 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -82,7 +82,7 @@ HTML_TokenEntry const aHTMLTokenTab[] = {
 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_linebreak),   
HtmlTokenId::LINEBREAK},
 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_caption), 
HtmlTokenId::CAPTION_ON},   // HTML 3.0
 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_center),  
HtmlTokenId::CENTER_ON},// Netscape
-{std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_citiation),   
HtmlTokenId::CITIATION_ON},
+{std::u16string_view(u"" OO

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

2021-01-21 Thread siddheshpatil777 (via logerrit)
 editeng/source/outliner/outlin2.cxx |4 ++--
 idl/inc/database.hxx|4 ++--
 idl/source/objects/bastype.cxx  |2 +-
 idl/source/prj/database.cxx |   22 +++---
 idl/source/prj/parser.cxx   |4 ++--
 include/editeng/outliner.hxx|4 ++--
 6 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 5419b894a2e791de24d10f0c4433a807e175e7a0
Author: siddheshpatil777 
AuthorDate: Wed Jan 6 14:14:33 2021 +0400
Commit: Michael Stahl 
CommitDate: Thu Jan 21 16:36:00 2021 +0100

tdf#114441: Convert use of sal_uLong to better integer types

Change-Id: I14742675541a315e72191df4ee38c35373b39d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108842
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/outliner/outlin2.cxx 
b/editeng/source/outliner/outlin2.cxx
index ff3d1583a5f1..df2e50389d3f 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -313,7 +313,7 @@ bool Outliner::IsInUndo() const
 return pEditEngine->IsInUndo();
 }
 
-sal_uLong Outliner::GetLineCount( sal_Int32 nParagraph ) const
+sal_uInt32 Outliner::GetLineCount( sal_Int32 nParagraph ) const
 {
 return pEditEngine->GetLineCount( nParagraph );
 }
@@ -323,7 +323,7 @@ sal_Int32 Outliner::GetLineLen( sal_Int32 nParagraph, 
sal_Int32 nLine ) const
 return pEditEngine->GetLineLen( nParagraph, nLine );
 }
 
-sal_uLong Outliner::GetLineHeight( sal_Int32 nParagraph )
+sal_uInt32 Outliner::GetLineHeight( sal_Int32 nParagraph )
 {
 return pEditEngine->GetLineHeight( nParagraph );
 }
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 79d289bee697..dcdf935931c5 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -111,8 +111,8 @@ public:
 voidSetAndWriteError( SvTokenStream & rInStm, const 
OString& rError );
 voidPush( SvMetaObject * pObj );
 sal_uInt32  GetUniqueId() { return ++nUniqueId; }
-boolFindId( const OString& rIdName, sal_uLong * pVal );
-voidInsertId( const OString& rIdName, sal_uLong nVal );
+boolFindId( const OString& rIdName, sal_uInt32 * pVal 
);
+voidInsertId( const OString& rIdName, sal_uInt32 nVal 
);
 boolReadIdFile( std::string_view rFileName );
 
 SvMetaType *FindType( std::string_view rName );
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index 098d5323..c68fa513ef0f 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -83,7 +83,7 @@ void SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
 
 if( rTok.IsIdentifier() )
 {
-sal_uLong n;
+sal_uInt32 n;
 if( !rBase.FindId( rTok.GetString(), &n ) )
 rBase.SetAndWriteError( rInStm, "no value for identifier <" + 
getString() + "> " );
 setString(rTok.GetString());
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 6075a2da5fbd..56e05665b7f8 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -108,7 +108,7 @@ void SvIdlDataBase::Push( SvMetaObject * pObj )
 GetStack().push_back( pObj );
 }
 
-bool SvIdlDataBase::FindId( const OString& rIdName, sal_uLong * pVal )
+bool SvIdlDataBase::FindId( const OString& rIdName, sal_uInt32 * pVal )
 {
 if( pIdTable )
 {
@@ -122,7 +122,7 @@ bool SvIdlDataBase::FindId( const OString& rIdName, 
sal_uLong * pVal )
 return false;
 }
 
-void SvIdlDataBase::InsertId( const OString& rIdName, sal_uLong nVal )
+void SvIdlDataBase::InsertId( const OString& rIdName, sal_uInt32 nVal )
 {
 if( !pIdTable )
 pIdTable.reset( new SvStringHashTable );
@@ -163,7 +163,7 @@ bool SvIdlDataBase::ReadIdFile( std::string_view rOFileName 
)
 throw SvParseException( "unexpected token after define", 
rTok );
 aDefName = rTok.GetString();
 
-sal_uLong nVal = 0;
+sal_uInt32 nVal = 0;
 bool bOk = true;
 while( bOk )
 {
@@ -183,7 +183,7 @@ bool SvIdlDataBase::ReadIdFile( std::string_view rOFileName 
)
 }
 else if( rTok.IsIdentifier() )
 {
-sal_uLong n;
+sal_uInt32 n;
 if( FindId( rTok.GetString(), &n ) )
 nVal += n;
 else
@@ -317,10 +317,10 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
 SvToken& rTok = rInStm.GetToken_Next();
 if( rTok.IsIdentifier() )
 {
-sal_uLong n;
+sal_uInt32 n;
 if( FindId( rTok.GetString(), &n ) )
 {
-for( sal_uLong i = 0; i < aSlotList.size(); i++ )
+for( size_t i = 0;

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

2021-01-21 Thread Henry Castro (via logerrit)
 editeng/source/editeng/editview.cxx   |5 +
 editeng/source/outliner/outlvw.cxx|5 +
 include/editeng/editview.hxx  |1 +
 include/editeng/outliner.hxx  |1 +
 sw/source/uibase/docvw/AnnotationWin2.cxx |   12 ++--
 5 files changed, 18 insertions(+), 6 deletions(-)

New commits:
commit aadfeaff158316af1a868c66fa2fd78fb473c802
Author: Henry Castro 
AuthorDate: Fri Jan 15 10:14:50 2021 -0400
Commit: Henry Castro 
CommitDate: Thu Jan 21 12:49:35 2021 +0100

lok: fix incorrect invalidate cursor position

When the comment is created and it's shown in the "Writer"
application, it creates an initial output area:

mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) ) );

Unfortunately, it causes that send to client side cursor position
and scroll to the beginning of the document.

Change-Id: I13e21c71328b7f05781e7cdeed082d6cc2b9d679
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109371
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
(cherry picked from commit 4618849a1cbba4e249ee13c3b6412337160a2816)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109732
Tested-by: Jenkins
Reviewed-by: Henry Castro 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index f044671e1c17..901e29e756c6 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -701,6 +701,11 @@ void EditView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
 pImpEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* EditView::GetViewShell()
+{
+return pImpEditView->GetViewShell();
+}
+
 void EditView::RegisterOtherShell(OutlinerViewShell* pOtherShell)
 {
 pImpEditView->RegisterOtherShell(pOtherShell);
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 8ba3a28c87f0..487431995636 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1382,6 +1382,11 @@ void OutlinerView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
 pEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* OutlinerView::GetViewShell()
+{
+return pEditView->GetViewShell();
+}
+
 Color const & OutlinerView::GetBackgroundColor() const
 {
 return pEditView->GetBackgroundColor();
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index debc7b6efe71..bcf031559bed 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -258,6 +258,7 @@ public:
 
 /// Informs this edit view about which view shell contains it.
 void RegisterViewShell(OutlinerViewShell* pViewShell);
+const OutlinerViewShell* GetViewShell();
 /// Informs this edit view about which other shell listens to it.
 void RegisterOtherShell(OutlinerViewShell* pOtherShell);
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 0ffa5721c203..cfcfe85191d6 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -258,6 +258,7 @@ public:
 
 /// Informs this edit view about which view shell contains it.
 void RegisterViewShell(OutlinerViewShell* pViewShell);
+const OutlinerViewShell* GetViewShell();
 
 SfxItemSet  GetAttribs();
 
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 3fe30564cc44..9a067038d773 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -530,12 +530,6 @@ void SwAnnotationWin::InitControls()
 
 mpOutlinerView->SetAttribs(DefaultItem());
 
-if (comphelper::LibreOfficeKit::isActive())
-{
-// If there is a callback already registered, inform the new outliner 
view about it.
-mpOutlinerView->RegisterViewShell(&mrView);
-}
-
 //create Scrollbars
 mpVScrollbar = VclPtr::Create(*this, WB_3DLOOK 
|WB_VSCROLL|WB_DRAG, mrView);
 mpVScrollbar->EnableNativeWidget(false);
@@ -931,6 +925,12 @@ void SwAnnotationWin::DoResize()
 }
 
 mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
+
+if (comphelper::LibreOfficeKit::isActive() && 
!mpOutlinerView->GetViewShell())
+{
+mpOutlinerView->RegisterViewShell(&mrView);
+}
+
 if (!mpVScrollbar->IsVisible())
 {   // if we do not have a scrollbar anymore, we want to see the complete 
text
 mpOutlinerView->SetVisArea( PixelToLogic( 
tools::Rectangle(0,0,aWidth,aHeight) ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-18 Thread Mike Kaganski (via logerrit)
 editeng/source/uno/unofield.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 5405bd8cb81f09d1631aeebd95bd6b00926ae931
Author: Mike Kaganski 
AuthorDate: Mon Jan 18 09:29:45 2021 +0100
Commit: Mike Kaganski 
CommitDate: Mon Jan 18 12:43:40 2021 +0100

Get the rest directly from startsWith

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

diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 9fdc097132da..59772b594490 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -905,16 +905,13 @@ uno::Reference< uno::XInterface > 
SvxUnoTextCreateTextField( const OUString& Ser
 {
 uno::Reference< uno::XInterface > xRet;
 
-const OUString aTextFieldPrexit( "com.sun.star.text.textfield." );
-
 // #i93308# up to OOo 3.2 we used this wrong namespace name with the 
capital T & F. This is
 // fixed since OOo 3.2 but for compatibility we will still provide support 
for the wrong notation.
 
-if( (ServiceSpecifier.startsWith( aTextFieldPrexit )) ||
-(ServiceSpecifier.startsWith( "com.sun.star.text.TextField." )) )
+OUString aFieldType;
+if( (ServiceSpecifier.startsWith( "com.sun.star.text.textfield.", 
&aFieldType )) ||
+(ServiceSpecifier.startsWith( "com.sun.star.text.TextField.", 
&aFieldType )) )
 {
-OUString aFieldType( ServiceSpecifier.copy( 
aTextFieldPrexit.getLength() ) );
-
 sal_Int32 nId = text::textfield::Type::UNSPECIFIED;
 
 if ( aFieldType == "DateTime" )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-15 Thread Justin Luth (via logerrit)
 editeng/source/editeng/impedit2.cxx |   29 ++-
 sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py |   39 
 2 files changed, 46 insertions(+), 22 deletions(-)

New commits:
commit 79bfb54665b1a8dc2b932318eb6915d300772cff
Author: Justin Luth 
AuthorDate: Thu Dec 24 13:24:30 2020 +0300
Commit: Miklos Vajna 
CommitDate: Fri Jan 15 16:04:40 2021 +0100

tdf#137459 editeng: Ctrl+Del must only delete right

If there was nothing else at the end of the paragraph,
Ctrl+Del was acting like Ctrl+Backspace - it turned
around and started deleting the earlier words.
Instead, we need to keep deleting to the right,
starting with the next paragraph.
That's what Ctrl-Backspace does in reverse anyway.

It looks like this was just a copy-paste mistake
already seen at original import and the few times
that people tried to fix up this area, they didn't
notice that apparently? But then again, the code
changes don't look that impressive either...

[if x == 1, set x=1?]

make UITest_writer_tests UITEST_TEST_NAME=\
tdf137459_editeng_ctrl-DEL.tdf137459.test_tdf137459

Change-Id: I0c2268f9f1a2102997b2e84b0b7a6d0e2da43b15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108265
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d2596ebd9065..8ea35eb3e91f 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2359,34 +2359,19 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const 
EditSelection& rSel, sal_uInt8 n
 else if ( nDelMode == DeleteMode::RestOfWord )
 {
 aDelEnd = EndOfWord( aCurPos );
-
 if (aDelEnd.GetIndex() == aCurPos.GetIndex())
 {
 const sal_Int32 nLen(aCurPos.GetNode()->Len());
-
-// #i120020# when 0 == nLen, aDelStart needs to be adapted, not
-// aDelEnd. This would (and did) lead to a wrong order in the
-// ImpConnectParagraphs call later.
-if(nLen)
+// end of para?
+if (aDelEnd.GetIndex() == nLen)
 {
-// end of para?
-if (aDelEnd.GetIndex() == nLen)
-{
-aDelEnd = WordLeft( aCurPos );
-}
-else // there's still sth to delete on the right
-{
-aDelEnd = EndOfWord( WordRight( aCurPos ) );
-// if there'n no next word...
-if (aDelEnd.GetIndex() == nLen )
-{
-aDelEnd.SetIndex( nLen );
-}
-}
+ContentNode* pNext = GetNextVisNode( aCurPos.GetNode() );
+if ( pNext )
+aDelEnd = EditPaM( pNext, 0 );
 }
-else
+else // there's still something to delete on the right
 {
-aDelStart = WordLeft(aCurPos);
+aDelEnd = EndOfWord( WordRight( aCurPos ) );
 }
 }
 }
diff --git a/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py 
b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
new file mode 100644
index ..1c8c1e54fef0
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
@@ -0,0 +1,39 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from uitest.framework import UITestCase
+import time
+from uitest.uihelper.common import get_state_as_dict, type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf137459(UITestCase):
+
+def test_tdf137459(self):
+
+xMainDoc = self.ui_test.create_doc_in_start_center("writer")
+
+xMainWindow = self.xUITest.getTopFocusWindow()
+
+xwriter_edit = xMainWindow.getChild("writer_edit")
+# adding new Comment
+self.xUITest.executeCommand(".uno:InsertAnnotation")
+# wait until the comment is available
+self.ui_test.wait_until_child_is_available(xMainWindow, 'Comment1')
+
+xComment1 = xMainWindow.getChild("Comment1")
+sText = "Ctrl+Del should not delete BACKWARDS"
+xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": sText}))
+self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
+
+xComment1.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"CTRL+DELETE"}))
+self.

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

2021-01-13 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit efb6e29359a14888fa9ba1c77c5f34a1e37333cd
Author: Caolán McNamara 
AuthorDate: Wed Jan 13 15:29:41 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 13 20:38:46 2021 +0100

tdf#139493 EditViewCallbacks might not implement EditViewPopupParent

in which case fallback to the vcl::Window

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index bd2f0bf24218..4f0f4ccac865 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -826,7 +826,11 @@ OutputDevice& ImpEditView::GetOutputDevice() const
 weld::Widget* ImpEditView::GetPopupParent(tools::Rectangle& rRect) const
 {
 if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
-return pCallbacks->EditViewPopupParent();
+{
+weld::Widget* pParent = pCallbacks->EditViewPopupParent();
+if (pParent)
+return pParent;
+}
 return weld::GetPopupParent(*pOutWin, rRect);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-10 Thread Julien Nabet (via logerrit)
 editeng/source/misc/svxacorr.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ae56dc05b27f05ffcee99845d661a237e70a7a51
Author: Julien Nabet 
AuthorDate: Sat Jan 9 20:47:24 2021 +0100
Commit: Julien Nabet 
CommitDate: Sun Jan 10 09:38:23 2021 +0100

tdf#96787: AutoCorrect: after deleting a replacement entry, it's still used

If specific acor.dat exists in "user", don't use the initial one 
in "share"
since the initial one will still contain the deleted entry.

See detailed explanation here:
https://bugs.documentfoundation.org/show_bug.cgi?id=96787#c21
Change-Id: Ic349159c93d9fc327f38a1d4e8187e3bdc16d08a

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ae6dceb33adf..0f048114462b 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1941,6 +1941,8 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
 rLang = aLanguageTag;
 return pRet;
 }
+else
+return nullptr;
 }
 
 // If it still could not be found here, then keep on searching
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/tools sc/source svx/source sw/source vcl/source

2021-01-08 Thread Noel (via logerrit)
 editeng/source/items/frmitems.cxx|2 -
 include/tools/color.hxx  |7 +
 sc/source/ui/view/output.cxx |2 -
 svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx |   18 +++
 svx/source/tbxctrls/tbxcolorupdate.cxx   |4 +--
 sw/source/filter/ww8/ww8par6.cxx |2 -
 vcl/source/gdi/print2.cxx|4 +--
 7 files changed, 23 insertions(+), 16 deletions(-)

New commits:
commit 5c9ace48f05269c50d57642256153450335ace5f
Author: Noel 
AuthorDate: Fri Jan 8 14:48:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 8 18:15:22 2021 +0100

Introduce Color::IsFullyTransparent

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 6dfacab3ec6f..e3a6f8e5ac0c 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2880,7 +2880,7 @@ bool SvxBrushItem::isUsed() const
 // graphic used
 return true;
 }
-else if (0xff != GetColor().GetTransparency())
+else if (!GetColor().IsFullyTransparent())
 {
 // color used
 return true;
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 27b63b178715..fa062d59eddd 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -149,6 +149,13 @@ public:
 return GetTransparency() != 0;
 }
 
+/** Is the color fully transparent i.e. 100% transparency ?
+ */
+bool IsFullyTransparent() const
+{
+return A == 255;
+}
+
 /** Sets the red value.
   * @param nRed
   */
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 7dc9cd1ded95..3d9ce033ff6a 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1098,7 +1098,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& 
rRenderContext)
 pBackground = pProtectedBackground.get();
 
 if ( pInfo->nRotateDir > ScRotateDir::Standard &&
-pBackground->GetColor().GetTransparency() != 255 &&
+!pBackground->GetColor().IsFullyTransparent() &&
 !bCellContrast )
 {
 SCROW nY = pRowInfo[nArrY].nRowNo;
diff --git a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx 
b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
index 76af6c23b68e..6e289d4be3f1 100644
--- a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx
@@ -126,9 +126,9 @@ namespace
 if (bSecnUsed)
 {
 // both or all three lines used
-const bool bPrimTransparent(0xff == 
rStyle.GetColorPrim().GetTransparency());
-const bool bDistTransparent(!rStyle.UseGapColor() || 0xff == 
rStyle.GetColorGap().GetTransparency());
-const bool bSecnTransparent(0xff == aSecn.GetTransparency());
+const bool 
bPrimTransparent(rStyle.GetColorPrim().IsFullyTransparent());
+const bool bDistTransparent(!rStyle.UseGapColor() || 
rStyle.GetColorGap().IsFullyTransparent());
+const bool bSecnTransparent(aSecn.IsFullyTransparent());
 
 if(!bPrimTransparent || !bDistTransparent || !bSecnTransparent)
 {
@@ -161,7 +161,7 @@ namespace
 else
 {
 // one line used, push two values, from outer to inner
-if(0xff != rStyle.GetColorPrim().GetTransparency())
+if(!rStyle.GetColorPrim().IsFullyTransparent())
 {
 maOffsets.push_back(
 OffsetAndHalfWidthAndColor(
@@ -325,7 +325,7 @@ namespace
 Color aMyColor; double fMyOffset(0.0); double fMyHalfWidth(0.0);
 rCombination.getColorAndOffsetAndHalfWidth(0, aMyColor, fMyOffset, 
fMyHalfWidth);
 
-if(0xff != aMyColor.GetTransparency())
+if(!aMyColor.IsFullyTransparent())
 {
 const basegfx::B2DPoint aLeft(rOrigin + (rPerpendX * 
(fMyOffset - fMyHalfWidth)));
 const basegfx::B2DPoint aRight(rOrigin + (rPerpendX * 
(fMyOffset + fMyHalfWidth)));
@@ -341,7 +341,7 @@ namespace
 Color aOtherColor; double fOtherOffset(0.0); double 
fOtherHalfWidth(0.0);
 rStyleCandidate.getColorAndOffsetAndHalfWidth(other, 
aOtherColor, fOtherOffset, fOtherHalfWidth);
 
-if(0xff != aOtherColor.GetTransparency())
+if(!aOtherColor.IsFullyTransparent())
 {
 

[Libreoffice-commits] core.git: editeng/source include/editeng include/tools svx/source tools/source

2021-01-06 Thread Noel Grandin (via logerrit)
 editeng/source/items/borderline.cxx |   11 ++-
 editeng/source/items/frmitems.cxx   |   29 +++--
 editeng/source/items/textitem.cxx   |5 +++--
 include/editeng/itemtype.hxx|   12 +---
 include/tools/bigint.hxx|3 +++
 svx/source/svdraw/svdattr.cxx   |6 +-
 svx/source/svdraw/svdtrans.cxx  |   16 +++-
 svx/source/xoutdev/xattr.cxx|   24 
 tools/source/generic/bigint.cxx |   16 
 9 files changed, 52 insertions(+), 70 deletions(-)

New commits:
commit 2298b055cab8cf8d0268ee1375a5c6e416bf1332
Author: Noel Grandin 
AuthorDate: Wed Jan 6 10:10:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 6 11:38:01 2021 +0100

move the bigint based Scale() implementations to one central place

Picking the best looking one in the process.

Change-Id: I77f9236fcd21f883a23fe2f43f20336f17b44cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108831
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/borderline.cxx 
b/editeng/source/items/borderline.cxx
index 6a33b4bbcfc5..08261ed7165f 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star::table::BorderLineStyle;
 
@@ -496,23 +497,23 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderLineStyle 
nStyle, sal_uInt16 nOut
 
 sal_uInt16 SvxBorderLine::GetOutWidth() const
 {
-sal_uInt16 nOut = static_cast(Scale( m_aWidthImpl.GetLine1( 
m_nWidth ), m_nMult, m_nDiv ));
+sal_uInt16 nOut = static_cast(BigInt::Scale( 
m_aWidthImpl.GetLine1( m_nWidth ), m_nMult, m_nDiv ));
 if ( m_bMirrorWidths )
-nOut = static_cast(Scale( m_aWidthImpl.GetLine2( m_nWidth 
), m_nMult, m_nDiv ));
+nOut = static_cast(BigInt::Scale( m_aWidthImpl.GetLine2( 
m_nWidth ), m_nMult, m_nDiv ));
 return nOut;
 }
 
 sal_uInt16 SvxBorderLine::GetInWidth() const
 {
-sal_uInt16 nIn = static_cast(Scale( m_aWidthImpl.GetLine2( 
m_nWidth ), m_nMult, m_nDiv ));
+sal_uInt16 nIn = static_cast(BigInt::Scale( 
m_aWidthImpl.GetLine2( m_nWidth ), m_nMult, m_nDiv ));
 if ( m_bMirrorWidths )
-nIn = static_cast(Scale( m_aWidthImpl.GetLine1( m_nWidth 
), m_nMult, m_nDiv ));
+nIn = static_cast(BigInt::Scale( m_aWidthImpl.GetLine1( 
m_nWidth ), m_nMult, m_nDiv ));
 return nIn;
 }
 
 sal_uInt16 SvxBorderLine::GetDistance() const
 {
-return static_cast(Scale( m_aWidthImpl.GetGap( m_nWidth ), 
m_nMult, m_nDiv ));
+return static_cast(BigInt::Scale( m_aWidthImpl.GetGap( 
m_nWidth ), m_nMult, m_nDiv ));
 }
 
 
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 4f365da2b7de..43a9be8e4635 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -270,8 +271,8 @@ bool SvxSizeItem::GetPresentation
 
 void SvxSizeItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
 {
-m_aSize.setWidth( Scale( m_aSize.Width(), nMult, nDiv ) );
-m_aSize.setHeight( Scale( m_aSize.Height(), nMult, nDiv ) );
+m_aSize.setWidth( BigInt::Scale( m_aSize.Width(), nMult, nDiv ) );
+m_aSize.setHeight( BigInt::Scale( m_aSize.Height(), nMult, nDiv ) );
 }
 
 
@@ -572,10 +573,10 @@ bool SvxLRSpaceItem::GetPresentation
 
 void SvxLRSpaceItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
 {
-nFirstLineOffset = static_cast(Scale( nFirstLineOffset, nMult, nDiv 
));
-nTxtLeft = Scale( nTxtLeft, nMult, nDiv );
-nLeftMargin = Scale( nLeftMargin, nMult, nDiv );
-nRightMargin = Scale( nRightMargin, nMult, nDiv );
+nFirstLineOffset = static_cast(BigInt::Scale( nFirstLineOffset, 
nMult, nDiv ));
+nTxtLeft = BigInt::Scale( nTxtLeft, nMult, nDiv );
+nLeftMargin = BigInt::Scale( nLeftMargin, nMult, nDiv );
+nRightMargin = BigInt::Scale( nRightMargin, nMult, nDiv );
 }
 
 
@@ -824,8 +825,8 @@ bool SvxULSpaceItem::GetPresentation
 
 void SvxULSpaceItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
 {
-nUpper = static_cast(Scale( nUpper, nMult, nDiv ));
-nLower = static_cast(Scale( nLower, nMult, nDiv ));
+nUpper = static_cast(BigInt::Scale( nUpper, nMult, nDiv ));
+nLower = static_cast(BigInt::Scale( nLower, nMult, nDiv ));
 }
 
 
@@ -1222,7 +1223,7 @@ bool SvxShadowItem::GetPresentation
 
 void SvxShadowItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
 {
-nWidth = static_cast(Scale( nWidth, nMult, nDiv ));
+nWidth = static_cast(BigInt::Scale( nWidth, nMult, nDiv ));
 }
 
 
@@ -1862,10 +1863,10 @@ void SvxBoxItem::ScaleMetrics( tools::Long nMult, 
tools::Long nDiv )
 if ( pBottom )  pBottom->ScaleMetrics( nMult, nDiv );
 if ( pLeft )pLeft->ScaleMetrics( nMult, nDiv );
 if ( pRight )   pRi

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

2021-01-05 Thread Miklos Vajna (via logerrit)
 editeng/source/items/frmitems.cxx |8 
 include/editeng/keepitem.hxx  |2 ++
 2 files changed, 10 insertions(+)

New commits:
commit da348a4740267592c36902ac6295302e7c9647a7
Author: Miklos Vajna 
AuthorDate: Mon Jan 4 21:45:10 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 5 09:03:28 2021 +0100

sw doc model xml dump: improve keep-with-next output

From: 
To: 

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index cb3c4a14a136..4f365da2b7de 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2643,6 +2643,14 @@ bool SvxFormatKeepItem::GetPresentation
 return true;
 }
 
+void SvxFormatKeepItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFormatKeepItem"));
+
+SfxBoolItem::dumpAsXml(pWriter);
+
+xmlTextWriterEndElement(pWriter);
+}
 
 SvxLineItem::SvxLineItem( const sal_uInt16 nId ) :
 SfxPoolItem ( nId )
diff --git a/include/editeng/keepitem.hxx b/include/editeng/keepitem.hxx
index 6d511d04b0a2..c108560ce3aa 100644
--- a/include/editeng/keepitem.hxx
+++ b/include/editeng/keepitem.hxx
@@ -46,6 +46,8 @@ public:
   MapUnit eCoreMetric,
   MapUnit ePresMetric,
   OUString &rText, const IntlWrapper& ) const 
override;
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 inline SvxFormatKeepItem::SvxFormatKeepItem( const bool bKeep, const 
sal_uInt16 _nWhich ) :
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-04 Thread Mark Hung (via logerrit)
 editeng/source/editeng/impedit3.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 2ffa6c897379bf07367d445918b4c142cd493e7f
Author: Mark Hung 
AuthorDate: Sat Jan 2 22:58:23 2021 +0800
Commit: Mark Hung 
CommitDate: Mon Jan 4 13:40:01 2021 +0100

tdf#120171 editeng: don't reduce nBreakPos

even if it is greater then nMaxBreakPos. The only situation
that happens is when there is a hanging punctuation. Reducing
nBreakPos to nMaxBreakPos always break that punctuation to the
next line.

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

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index a271aa37c1e6..7df8aaa92bf4 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1900,10 +1900,9 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* 
pParaPortion, EditLine* pLine, Te
 OSL_FAIL( "I18N: XBreakIterator::getLineBreak returns position 
> Max" );
 nBreakPos = nMaxBreakPos;
 }
-
-// nBreakPos can never be outside the portion, even not with 
hanging punctuation
-if ( nBreakPos > nMaxBreakPos )
-nBreakPos = nMaxBreakPos;
+// Hanging punctuation is the only case that increases nBreakPos 
and makes
+// nBreakPos > nMaxBreakPos. It's expected that the hanging 
punctuation goes over
+// the border of the object.
 }
 
 // BUG in I18N - the japanese dot is in the next line!
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-23 Thread Mike Kaganski (via logerrit)
 editeng/source/editeng/editview.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 85f39dc62b7feb357535582deec1c18f72f9ef0d
Author: Mike Kaganski 
AuthorDate: Wed Dec 23 17:27:05 2020 +0100
Commit: Mike Kaganski 
CommitDate: Thu Dec 24 05:23:57 2020 +0100

Use range-based for

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index a17f76d6d492..f044671e1c17 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -133,10 +133,8 @@ LanguageType EditView::CheckLanguage(
 lang::Locale a3( LanguageTag::convertToLocale( aLangList[3] ) );
 #endif
 
-sal_Int32 const nCount = SAL_N_ELEMENTS(aLangList);
-for (sal_Int32 i = 0;  i < nCount;  i++)
+for (const LanguageType& nTmpLang : aLangList)
 {
-LanguageType nTmpLang = aLangList[i];
 if (nTmpLang != LANGUAGE_NONE  &&  nTmpLang != LANGUAGE_DONTKNOW)
 {
 if (xSpell->hasLanguage( static_cast(nTmpLang) ) &&
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-23 Thread Stephan Bergmann (via logerrit)
 editeng/source/misc/svxacorr.cxx |7 ++-
 include/editeng/svxacorr.hxx |4 ++--
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit c386994e78f69cb2e9babf42bb54bdfa1f8bd28e
Author: Stephan Bergmann 
AuthorDate: Wed Dec 23 10:48:30 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 23 14:54:20 2020 +0100

Directly pass in OUString instances

All the passed-in pStrmName are either pXMLImplCplStt_ExcptLstStr or
pXMLImplWrdStt_ExcptLstStr, both of which are ASCII-only, so using
RTL_TEXTENCODING_MS_1252 wasn't relevant.

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e6fd6ec459cb..3b9da426dc64 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2181,7 +2181,7 @@ bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp()
 
 void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
 std::unique_ptr& 
rpLst,
-const char* pStrmName,
+const OUString& sStrmName,
 tools::SvRef& rStg)
 {
 if( rpLst )
@@ -2190,8 +2190,6 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
 rpLst.reset( new SvStringsISortDtor );
 
 {
-const OUString sStrmName( pStrmName, strlen(pStrmName), 
RTL_TEXTENCODING_MS_1252 );
-
 if( rStg.is() && rStg->IsStream( sStrmName ) )
 {
 tools::SvRef xStrm = rStg->OpenSotStream( 
sStrmName,
@@ -2254,14 +2252,13 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
 
 void SvxAutoCorrectLanguageLists::SaveExceptList_Imp(
 const SvStringsISortDtor& rLst,
-const char* pStrmName,
+const OUString& sStrmName,
 tools::SvRef const &rStg,
 bool bConvert )
 {
 if( !rStg.is() )
 return;
 
-OUString sStrmName( pStrmName, strlen(pStrmName), RTL_TEXTENCODING_MS_1252 
);
 if( rLst.empty() )
 {
 rStg->Remove( sStrmName );
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 4e5d929405f0..d386a6888f9a 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -196,10 +196,10 @@ class EDITENG_DLLPUBLIC SvxAutoCorrectLanguageLists
 
 bool IsFileChanged_Imp();
 void LoadXMLExceptList_Imp( std::unique_ptr& rpLst,
-const char* pStrmName,
+const OUString& sStrmName,
 tools::SvRef& rStg);
 static void SaveExceptList_Imp( const SvStringsISortDtor& rLst,
-const char* pStrmName,
+const OUString& sStrmName,
 tools::SvRef const & rStg,
 bool bConvert = false);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng include/svl sc/inc sc/source sd/inc sd/source svl/source sw/source

2020-12-18 Thread Noel (via logerrit)
 editeng/source/uno/unoipset.cxx |2 +-
 editeng/source/uno/unotext.cxx  |2 +-
 include/editeng/unoipset.hxx|2 +-
 include/editeng/unotext.hxx |2 +-
 include/svl/itemprop.hxx|4 ++--
 sc/inc/optuno.hxx   |4 ++--
 sc/inc/styleuno.hxx |   10 +-
 sc/source/ui/unoobj/optuno.cxx  |4 ++--
 sc/source/ui/unoobj/styleuno.cxx|   18 +-
 sd/inc/stlsheet.hxx |2 +-
 sd/source/core/stlsheet.cxx |2 +-
 sd/source/ui/unoidl/unopback.cxx|2 +-
 sd/source/ui/unoidl/unopback.hxx|2 +-
 svl/source/items/itemprop.cxx   |6 +++---
 sw/source/core/unocore/unofield.cxx |2 +-
 15 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 27d585cd2d0a0157896c4af11f2463f0197e3eb2
Author: Noel 
AuthorDate: Fri Dec 18 20:23:40 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 19 08:02:56 2020 +0100

use more string_view in SfxItemPropertyMap

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

diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index c9d54c83e972..523b29794461 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -246,7 +246,7 @@ void SvxItemPropertySet::setPropertyValue( const 
SfxItemPropertySimpleEntry* pMa
 }
 
 
-const SfxItemPropertySimpleEntry* 
SvxItemPropertySet::getPropertyMapEntry(const OUString &rName) const
+const SfxItemPropertySimpleEntry* 
SvxItemPropertySet::getPropertyMapEntry(std::u16string_view rName) const
 {
 return m_aPropertyMap.getByName( rName );
  }
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 6761f8b8b622..9476ba7659c7 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1017,7 +1017,7 @@ beans::PropertyState 
SvxUnoTextRangeBase::_getPropertyState(const SfxItemPropert
 throw beans::UnknownPropertyException();
 }
 
-beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const OUString& 
PropertyName, sal_Int32 nPara /* = -1 */)
+beans::PropertyState 
SvxUnoTextRangeBase::_getPropertyState(std::u16string_view PropertyName, 
sal_Int32 nPara /* = -1 */)
 {
 SolarMutexGuard aGuard;
 
diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx
index c05ff656ee9c..0a4d8c2fe3ad 100644
--- a/include/editeng/unoipset.hxx
+++ b/include/editeng/unoipset.hxx
@@ -59,7 +59,7 @@ public:
 
 css::uno::Reference< css::beans::XPropertySetInfo > const & 
getPropertySetInfo() const;
 const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;}
-const SfxItemPropertySimpleEntry* getPropertyMapEntry(const OUString 
&rName) const;
+const SfxItemPropertySimpleEntry* getPropertyMapEntry(std::u16string_view 
rName) const;
 };
 
 /** converts the given any with a metric to 100th/mm if needed */
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 86841fbb0d56..a07a8cf059e1 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -274,7 +274,7 @@ protected:
 css::beans::PropertyState _getPropertyState( const 
SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara = -1 );
 /// @throws css::beans::UnknownPropertyException
 /// @throws css::uno::RuntimeException
-css::beans::PropertyState _getPropertyState( const OUString& PropertyName, 
sal_Int32 nPara = -1 );
+css::beans::PropertyState _getPropertyState(  std::u16string_view 
PropertyName, sal_Int32 nPara = -1 );
 /// @throws css::beans::UnknownPropertyException
 /// @throws css::uno::RuntimeException
 css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const 
css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1  );
diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx
index e985977f265a..67cedb7a64b6 100644
--- a/include/svl/itemprop.hxx
+++ b/include/svl/itemprop.hxx
@@ -124,11 +124,11 @@ public:
 SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
 ~SfxItemPropertyMap();
 
-const SfxItemPropertySimpleEntry*  getByName( const OUString &rName ) 
const;
+const SfxItemPropertySimpleEntry*  getByName( std::u16string_view rName ) 
const;
 css::uno::Sequence< css::beans::Property > const & getProperties() const;
 /// @throws css::beans::UnknownPropertyException
 css::beans::Property getPropertyByName( const OUString & rName ) const;
-bool hasPropertyByName( const OUString& rName ) const;
+bool hasPropertyByName( std::u16string_view rName ) const;
 
 void mergeProperties( const css::uno::Sequence< css::beans::Property >& 
rPropSeq );
 PropertyEntryVector_t getPropertyEntries() const;
diff --git a/sc/inc/optuno.hxx b/sc/inc/optuno.hxx
index 35e7ad28e3d5..8ce6d9c149d1 100644
--- a/sc/inc/optuno.hxx
+++ 

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

2020-12-18 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |4 ++--
 editeng/source/editeng/impedit.cxx  |4 ++--
 editeng/source/editeng/impedit.hxx  |4 ++--
 editeng/source/editeng/impedit2.cxx |8 ++--
 editeng/source/outliner/outlvw.cxx  |6 ++
 include/editeng/editview.hxx|2 +-
 include/editeng/outliner.hxx|2 +-
 include/vcl/seleng.hxx  |2 +-
 svx/source/dialog/weldeditview.cxx  |3 +--
 vcl/source/window/seleng.cxx|7 ---
 10 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 2a91637ed9a312471afe7a2201371eb9ae7f33c7
Author: Caolán McNamara 
AuthorDate: Fri Dec 18 10:46:03 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 18 21:39:05 2020 +0100

add a return to EditView::Command to indicate if the command was consumed

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 7b70f98b6ef7..a17f76d6d492 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -471,9 +471,9 @@ bool EditView::MouseMove( const MouseEvent& rMouseEvent )
 return pImpEditView->MouseMove( rMouseEvent );
 }
 
-void EditView::Command( const CommandEvent& rCEvt )
+bool EditView::Command(const CommandEvent& rCEvt)
 {
-pImpEditView->Command( rCEvt );
+return pImpEditView->Command(rCEvt);
 }
 
 void EditView::SetBroadcastLOKViewCursor(bool bSet)
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 20dce95424a9..bd2f0bf24218 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1705,10 +1705,10 @@ bool ImpEditView::MouseMove( const MouseEvent& 
rMouseEvent )
 return pEditEngine->pImpEditEngine->MouseMove( rMouseEvent, 
GetEditViewPtr() );
 }
 
-void ImpEditView::Command( const CommandEvent& rCEvt )
+bool ImpEditView::Command(const CommandEvent& rCEvt)
 {
 pEditEngine->CheckIdleFormatter();  // If fast typing and mouse button down
-pEditEngine->pImpEditEngine->Command( rCEvt, GetEditViewPtr() );
+return pEditEngine->pImpEditEngine->Command(rCEvt, GetEditViewPtr());
 }
 
 
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 45088dc9bedf..a874a51699e3 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -368,7 +368,7 @@ public:
 boolMouseButtonDown( const MouseEvent& rMouseEvent );
 voidReleaseMouse();
 boolMouseMove( const MouseEvent& rMouseEvent );
-voidCommand( const CommandEvent& rCEvt );
+boolCommand(const CommandEvent& rCEvt);
 
 voidCutCopy( css::uno::Reference< 
css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bCut );
 voidPaste( css::uno::Reference< 
css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool 
bUseSpecial = false );
@@ -841,7 +841,7 @@ public:
 boolMouseButtonDown( const MouseEvent& rMouseEvent, 
EditView* pView );
 voidReleaseMouse();
 boolMouseMove( const MouseEvent& rMouseEvent, EditView* 
pView );
-voidCommand( const CommandEvent& rCEvt, EditView* 
pView );
+boolCommand(const CommandEvent& rCEvt, EditView* 
pView);
 
 EditSelectionEngine&GetSelEngine() { return aSelEngine; }
 OUStringGetSelected( const EditSelection& rSel ) const;
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 2c83c1165856..d2596ebd9065 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -331,8 +331,10 @@ bool ImpEditEngine::MouseButtonDown( const MouseEvent& 
rMEvt, EditView* pView )
 return true;
 }
 
-void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
+bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
 {
+bool bConsumed = true;
+
 GetSelEngine().SetCurView( pView );
 SetActiveView( pView );
 if ( rCEvt.GetCommand() == CommandEventId::StartExtTextInput )
@@ -555,8 +557,10 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 }
 }
 }
+else
+bConsumed = false;
 
-GetSelEngine().Command( rCEvt );
+return GetSelEngine().Command(rCEvt) || bConsumed;
 }
 
 bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView )
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index aff9992d8b4c..8ba3a28c87f0 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -773,13 +773,11 @@ void OutlinerView::ImpPasted( sal_Int32 nStart, sal_Int32 
nPrevPa

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

2020-12-18 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0d6063a61c15688998c1a7f865b090fd9b1f8fff
Author: Caolán McNamara 
AuthorDate: Fri Dec 18 10:26:28 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 18 21:38:46 2020 +0100

use the OutputDevice view

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 99e3f67730d5..7b70f98b6ef7 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -951,7 +951,8 @@ static void LOKSendSpellPopupMenu(const weld::Menu& rMenu, 
LanguageType nGuessLa
 
 void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
Link const * pCallBack )
 {
-Point aPos(pImpEditView->GetOutputDevice().PixelToLogic(rPosPixel));
+OutputDevice& rDevice = pImpEditView->GetOutputDevice();
+Point aPos(rDevice.PixelToLogic(rPosPixel));
 aPos = pImpEditView->GetDocPos( aPos );
 EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aPos, false);
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pImpEditView->pEditEngine->pImpEditEngine->GetSpeller() );
@@ -964,7 +965,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
LinkGetWindowPos(aTempRect);
 // Convert to pixels
-aTempRect = pImpEditView->GetWindow()->LogicToPixel(aTempRect);
+aTempRect = rDevice.LogicToPixel(aTempRect);
 
 weld::Widget* pPopupParent = pImpEditView->GetPopupParent(aTempRect);
 std::unique_ptr 
xBuilder(Application::CreateBuilder(pPopupParent, "editeng/ui/spellmenu.ui"));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-18 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |5 +
 include/editeng/editview.hxx|1 +
 2 files changed, 6 insertions(+)

New commits:
commit 69f1f7f61506131ca203e43b799e7422e98b82a5
Author: Caolán McNamara 
AuthorDate: Fri Dec 18 09:34:48 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 18 16:47:23 2020 +0100

add GetOutputDevice to EditView

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 877c59f1c520..99e3f67730d5 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -348,6 +348,11 @@ vcl::Window* EditView::GetWindow() const
 return pImpEditView->pOutWin;
 }
 
+OutputDevice& EditView::GetOutputDevice() const
+{
+return pImpEditView->GetOutputDevice();
+}
+
 bool EditView::HasOtherViewWindow( vcl::Window* pWin )
 {
 OutWindowSet& rOutWindowSet = pImpEditView->aOutWindowSet;
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 5552e05b1313..7189f40d63ff 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -166,6 +166,7 @@ public:
 
 voidSetWindow( vcl::Window* pWin );
 vcl::Window*GetWindow() const;
+OutputDevice&   GetOutputDevice() const;
 
 boolHasOtherViewWindow( vcl::Window* pWin );
 boolAddOtherViewWindow( vcl::Window* pWin );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-17 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |   80 ++--
 1 file changed, 59 insertions(+), 21 deletions(-)

New commits:
commit 493429cc91d41b719d446e43415f43fb9fa5aee4
Author: Caolán McNamara 
AuthorDate: Thu Dec 17 15:49:23 2020 +
Commit: Caolán McNamara 
CommitDate: Thu Dec 17 22:01:15 2020 +0100

drop dumping intermediate popup menu and go straight to boost::property_tree

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 00be3ff442ef..491c88670f44 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -880,33 +880,71 @@ static void LOKSendSpellPopupMenu(Menu* pMenu, 
LanguageType nGuessLangWord,
 if (!comphelper::LibreOfficeKit::isActive())
 return;
 
-// First we need to set item commands for the context menu.
-OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
-OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
+// Generate the menu structure and send it to the client code.
+SfxViewShell* pViewShell = SfxViewShell::Current();
+if (!pViewShell)
+return;
 
-pMenu->SetItemCommand(pMenu->GetItemId("ignore"), 
".uno:SpellCheckIgnoreAll?Type:string=Spelling");
-pMenu->SetItemCommand(MN_WORDLANGUAGE, 
".uno:LanguageStatus?Language:string=Current_" + aTmpWord);
-pMenu->SetItemCommand(MN_PARALANGUAGE, 
".uno:LanguageStatus?Language:string=Paragraph_" + aTmpPara);
+boost::property_tree::ptree aMenu;
 
-for(int i = 0; i < nSuggestions; ++i)
+boost::property_tree::ptree aItemTree;
+if (nSuggestions)
 {
-sal_uInt16 nItemId = MN_ALTSTART + i;
-OUString sCommandString = 
".uno:SpellCheckApplySuggestion?ApplyRule:string=Spelling_" + 
pMenu->GetItemText(nItemId);
-pMenu->SetItemCommand(nItemId, sCommandString);
+for(int i = 0; i < nSuggestions; ++i)
+{
+sal_uInt16 nItemId = MN_ALTSTART + i;
+OUString sText = pMenu->GetItemText(nItemId);
+aItemTree.put("text", sText.toUtf8().getStr());
+aItemTree.put("type", "command");
+OUString sCommandString = 
".uno:SpellCheckApplySuggestion?ApplyRule:string=Spelling_" + sText;
+aItemTree.put("command", sCommandString.toUtf8().getStr());
+aItemTree.put("enabled", pMenu->IsItemEnabled(nItemId));
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
+}
+
+aItemTree.put("type", "separator");
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
 }
 
-// Then we generate the menu structure and send it to the client code.
-if (SfxViewShell* pViewShell = SfxViewShell::Current())
-{
-boost::property_tree::ptree aMenu = 
SfxDispatcher::fillPopupMenu(pMenu);
-boost::property_tree::ptree aRoot;
-aRoot.add_child("menu", aMenu);
+// First we need to set item commands for the context menu.
+OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
+OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
 
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, aRoot, true);
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, 
aStream.str().c_str());
-return;
- }
+aItemTree.put("text", 
pMenu->GetItemText(pMenu->GetItemId("ignore")).toUtf8().getStr());
+aItemTree.put("type", "command");
+aItemTree.put("command", ".uno:SpellCheckIgnoreAll?Type:string=Spelling");
+aItemTree.put("enabled", pMenu->IsItemEnabled(pMenu->GetItemId("ignore")));
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
+
+aItemTree.put("type", "separator");
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
+
+aItemTree.put("text", 
pMenu->GetItemText(MN_WORDLANGUAGE).toUtf8().getStr());
+aItemTree.put("type", "command");
+OUString sCommandString = ".uno:LanguageStatus?Language:string=Current_" + 
aTmpWord;
+aItemTree.put("command", sCommandString.toUtf8().getStr());
+aItemTree.put("enabled", pMenu->IsItemEnabled(MN_WORDLANGUAGE));
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
+
+aItemTree.put("text", 
pMenu->GetItemText(MN_PARALANGUAGE).toUtf8().getStr());
+aItemTree.put("type", "command");
+sCommandString = ".uno:LanguageStatus?Language:string=Paragraph_" + 
aTmpPara;
+aItemTree.put("command", sCommandString.toUtf8().getStr());
+aItemTree.put("enabled", pMenu->IsItemEnabled(MN_PARALANGUAGE));
+aMenu.push_back(std::make_pair("", aItemTree));
+aItemTree.clear();
+
+boost::property_tree::ptr

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

2020-12-16 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e9208eb0d50295ae066beeb21e0162f8858ccb25
Author: Caolán McNamara 
AuthorDate: Tue Dec 15 16:37:38 2020 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 16 09:40:37 2020 +0100

hint as to the special handling of the edit popup menu in LOK

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 2212b526a572..00be3ff442ef 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1104,6 +1104,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
LinkExecute(pImpEditView->GetWindow(), aTempRect, 
PopupMenuFlags::NoMouseUpClose);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-15 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |4 +---
 editeng/uiconfig/ui/spellmenu.ui|2 +-
 include/vcl/menu.hxx|8 
 vcl/source/window/menu.cxx  |   12 +++-
 4 files changed, 9 insertions(+), 17 deletions(-)

New commits:
commit f9af3a9807ef37ca888a4767d3abdc1078783106
Author: Caolán McNamara 
AuthorDate: Tue Dec 15 09:32:26 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Dec 15 17:31:19 2020 +0100

use GetParentWithLOKNotifier to get the frame LOKNotifier to reuse for menus

so it doesn't have to be explicitly set by the editview menu creator

If I force enable LibreOfficeKit::isActive and right click on a
mispelled word in impress, or in the writer comments-in-margin before or
after this change I see the same ILibreOfficeKitNotifier set on the
MenuFloatingWindow. Seeing as this is used in only the editview spell
checking menu give that a unique id 'editviewspellmenu' and only do
this for that id

SetLOKNotifier in vcl/source/window/menu.cxx added with:
commit 8938e8b153f32f3f5926baddb87cb76c8e72755a
Author: Jan Holesovsky 
Date:   Thu Mar 8 21:07:40 2018 +0100

lokdialog: Tunnel the spell-checking context menu with recommendations.

Change-Id: I1a7952e88a3f89346c97d2516628b4a7a0423de6
Reviewed-on: https://gerrit.libreoffice.org/51062
Reviewed-by: pranavk 
Tested-by: pranavk 
Reviewed-on: https://gerrit.libreoffice.org/51166
Tested-by: Jenkins 
Reviewed-by: Jan Holesovsky 

SetLOKNotifier in editeng/source/editeng/editview.cxx added with:
commit 7c6fbd0ac3b5927b337aa69b132aba14e9b3103f
Author: Tamás Zolnai 
Date:   Mon Apr 16 14:38:36 2018 +0200

sd lok: Impress: Right-click menu on misspelled word locks up session

Change-Id: Ib554eea7049c1ea244bc4789ee3d7d2adf87e283
Reviewed-on: https://gerrit.libreoffice.org/52977
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index d7642736cf27..2212b526a572 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -920,7 +920,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
Link aPopupMenu(aBuilder.get_menu("menu"));
+VclPtr aPopupMenu(aBuilder.get_menu("editviewspellmenu"));
 const sal_uInt16 nAutoCorrId = aPopupMenu->GetItemId("autocorrect");
 PopupMenu *pAutoMenu = aPopupMenu->GetPopupMenu(nAutoCorrId);
 const sal_uInt16 nInsertId = aPopupMenu->GetItemId("insert");
@@ -1104,8 +1104,6 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
LinkSetLOKNotifier(pViewShell);
 }
 sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, 
PopupMenuFlags::NoMouseUpClose);
 
diff --git a/editeng/uiconfig/ui/spellmenu.ui b/editeng/uiconfig/ui/spellmenu.ui
index 6b6e2cb05b78..ea3bd9486fd0 100644
--- a/editeng/uiconfig/ui/spellmenu.ui
+++ b/editeng/uiconfig/ui/spellmenu.ui
@@ -2,7 +2,7 @@
 
 
   
-  
+  
 True
 False
 
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 935fc68eac11..4feef6025ddb 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -500,8 +500,6 @@ class VCL_DLLPUBLIC PopupMenu : public Menu
 friend struct MenuItemData;
 
 private:
-const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK 
callbacks eg. for dialog tunneling.
-
 SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
 
 protected:
@@ -538,12 +536,6 @@ public:
 static bool IsInExecute();
 static PopupMenu* GetActivePopupMenu();
 
-/// Interface to register for dialog / window tunneling.
-void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier)
-{
-mpLOKNotifier = pNotifier;
-}
-
 PopupMenu& operator=( const PopupMenu& rMenu );
 };
 
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5fa5e99e034a..f14056057aa5 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2714,14 +2714,12 @@ MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() 
const {
 }
 
 PopupMenu::PopupMenu()
-: mpLOKNotifier(nullptr)
 {
 mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this);
 }
 
 PopupMenu::PopupMenu( const PopupMenu& rMenu )
-: Menu(),
-  mpLOKNotifier(nullptr)
+: Menu()
 {
 mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this);
 *this = rMenu;
@@ -2922,8 +2920,12 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr& pW, const tools::R
 }
 
 VclPtrInstance pWin( this, pW, WB_BORDER | 
WB_SYSTEMWINDOW );
-if (comphelper::LibreOfficeKit::isActive() && mpLOKNotifier)
-  

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

2020-12-15 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit.cxx |8 
 editeng/source/editeng/impedit.hxx |1 +
 2 files changed, 9 insertions(+)

New commits:
commit 78d1a773fe3ca3c9bf6c8ded913f4db9731d1618
Author: Caolán McNamara 
AuthorDate: Mon Dec 14 19:40:37 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Dec 15 09:48:21 2020 +0100

get parent for welded menu and location to pop it up

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 03615ca3e465..20dce95424a9 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -822,6 +823,13 @@ OutputDevice& ImpEditView::GetOutputDevice() const
 return *pOutWin;
 }
 
+weld::Widget* ImpEditView::GetPopupParent(tools::Rectangle& rRect) const
+{
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
+return pCallbacks->EditViewPopupParent();
+return weld::GetPopupParent(*pOutWin, rRect);
+}
+
 void ImpEditView::SetOutputArea( const tools::Rectangle& rRect )
 {
 const OutputDevice& rOutDev = GetOutputDevice();
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 3adffe49b1eb..45088dc9bedf 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -393,6 +393,7 @@ public:
 void ScrollStateChange();
 
 OutputDevice&   GetOutputDevice() const;
+weld::Widget*   GetPopupParent(tools::Rectangle& rRect) const;
 vcl::Window*GetWindow() const   { return pOutWin; }
 
 voidSetSelectionMode( EESelectionMode eMode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-11 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e5e3a05f13f47d44276cfe8d88e8ec9d4d559a66
Author: Caolán McNamara 
AuthorDate: Fri Dec 11 11:08:07 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 11 14:54:27 2020 +0100

spelling context menu misplaced in margin comments

in writer, comments in margin, right clicking on a misspelt word
and the menu is misplaced, very misplaced if the comment is long
enough that the comment has a scrollbar and the word is near the end

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 884817f415b6..d7642736cf27 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1080,10 +1080,12 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkRemoveDisabledEntries( true, true );
 
+// PaMtoEditCursor returns Logical units
 tools::Rectangle aTempRect = 
pImpEditView->pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, 
GetCursorFlags::TextOnly );
-Point aScreenPos = pImpEditView->GetWindowPos( aTempRect.TopLeft() );
-aScreenPos = pImpEditView->GetWindow()->OutputToScreenPixel( aScreenPos );
-aTempRect = pImpEditView->GetWindow()->LogicToPixel( 
tools::Rectangle(aScreenPos, aTempRect.GetSize() ));
+// GetWindowPos works in Logical units
+aTempRect = pImpEditView->GetWindowPos(aTempRect);
+// Convert to pixels
+aTempRect = pImpEditView->GetWindow()->LogicToPixel(aTempRect);
 
 //tdf#106123 store and restore the EditPaM around the menu Execute
 //because the loss of focus in the current editeng causes writer
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-10 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ae32ac87b223d6f90c460a83fa5073eb5d0f4706
Author: Caolán McNamara 
AuthorDate: Thu Dec 10 16:04:06 2020 +
Commit: Caolán McNamara 
CommitDate: Thu Dec 10 18:18:07 2020 +0100

don't need a vcl::Window for PixelToLogic

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 35965e1e276a..884817f415b6 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -868,7 +868,7 @@ bool EditView::IsCursorAtWrongSpelledWord()
 
 bool EditView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool 
bMarkIfWrong )
 {
-Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
+Point aPos(pImpEditView->GetOutputDevice().PixelToLogic(rPosPixel));
 aPos = pImpEditView->GetDocPos( aPos );
 EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aPos, false);
 return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
@@ -911,7 +911,7 @@ static void LOKSendSpellPopupMenu(Menu* pMenu, LanguageType 
nGuessLangWord,
 
 void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
Link const * pCallBack )
 {
-Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
+Point aPos(pImpEditView->GetOutputDevice().PixelToLogic(rPosPixel));
 aPos = pImpEditView->GetDocPos( aPos );
 EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aPos, false);
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pImpEditView->pEditEngine->pImpEditEngine->GetSpeller() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-02 Thread Noel (via logerrit)
 editeng/source/xml/xmltxtimp.cxx |   22 ++
 1 file changed, 2 insertions(+), 20 deletions(-)

New commits:
commit 549760a68f457f406141c843e8a38a2ee0677c53
Author: Noel 
AuthorDate: Wed Dec 2 10:30:38 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 2 12:14:03 2020 +0100

fastparser in SvxXMLTextImportContext

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

diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index e04d2839d170..ff5a1e9b6131 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -52,7 +52,6 @@ class SvxXMLTextImportContext : public SvXMLImportContext
 public:
 SvxXMLTextImportContext( SvXMLImport& rImport, const uno::Reference< XText 
>& xText );
 
-virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, 
const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) 
override;
 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
 sal_Int32 nElement,
 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList) 
override;
@@ -70,7 +69,7 @@ SvxXMLTextImportContext::SvxXMLTextImportContext( 
SvXMLImport& rImport, const un
 
 css::uno::Reference< css::xml::sax::XFastContextHandler > 
SvxXMLTextImportContext::createFastChildContext(
 sal_Int32 nElement,
-const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/)
+const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
 {
 SvXMLImportContext* pContext = nullptr;
 if(nElement == XML_ELEMENT(OFFICE, XML_BODY ))
@@ -82,25 +81,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
SvxXMLTextImportContex
 pContext = new SvXMLStylesContext( GetImport() );
 GetImport().GetTextImport()->SetAutoStyles( 
static_cast(pContext) );
 }
-return pContext;
-}
-
-SvXMLImportContextRef SvxXMLTextImportContext::CreateChildContext( sal_uInt16 
nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& 
xAttrList )
-{
-SvXMLImportContext* pContext = nullptr;
-if(XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_BODY ) )
-{
-// dealt with in createFastChildContext
-}
-else if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, 
XML_AUTOMATIC_STYLES ) )
-{
-// dealt with in createFastChildContext
-}
 else
-{
-pContext = GetImport().GetTextImport()->CreateTextChildContext( 
GetImport(), nPrefix, rLocalName, xAttrList );
-}
-
+pContext = GetImport().GetTextImport()->CreateTextChildContext( 
GetImport(), nElement, xAttrList );
 return pContext;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-25 Thread Stephan Bergmann (via logerrit)
 editeng/source/editeng/editdbg.cxx|2 +-
 sw/source/filter/ww8/WW8TableInfo.cxx |   16 
 vcl/workben/vcldemo.cxx   |2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 9e0de138a5afaa7132ee535a15741effc983d2b0
Author: Stephan Bergmann 
AuthorDate: Wed Nov 25 11:00:23 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 25 14:07:07 2020 +0100

Use sal_Int64 to printf tools::Long values

(The "%l" format specifiers had now caused -Werror,-Wformat with clang-cl 
for a
Windows 64-bit build.)

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

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index cee32beafcc2..3598036e2240 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -454,7 +454,7 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
 fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
 fprintf( fp, "\nRefMapMode: %i", int( 
pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
 fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, 
sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) 
);
-fprintf( fp, "\nMaxAutoPaperSize: %li x %li", 
pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
+fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, 
sal_Int64(pEE->GetMaxAutoPaperSize().Width()), 
sal_Int64(pEE->GetMaxAutoPaperSize().Height()) );
 fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , 
sal_Int64(pEE->GetMinAutoPaperSize().Width()), 
sal_Int64(pEE->GetMinAutoPaperSize().Height()) );
 fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
 fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() 
);
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx 
b/sw/source/filter/ww8/WW8TableInfo.cxx
index 03f376fbeec9..907e4131cec0 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -998,15 +998,15 @@ std::string CellInfo::toString() const
 static char sBuffer[256];
 
 snprintf(sBuffer, sizeof(sBuffer),
- "",
- left(),
- right(),
- top(),
- bottom(),
+ sal_Int64(left()),
+ sal_Int64(right()),
+ sal_Int64(top()),
+ sal_Int64(bottom()),
  m_pNodeInfo);
 
 return sBuffer;
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 68a04d1384a9..cca89f8a2ecc 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1794,7 +1794,7 @@ public:
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override
 {
 mrRenderer.SetSizePixel(GetSizePixel());
-fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), 
rRect.getY(), rRect.getWidth(), rRect.getHeight());
+fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 
",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ")\n", sal_Int64(rRect.getX()), 
sal_Int64(rRect.getY()), sal_Int64(rRect.getWidth()), 
sal_Int64(rRect.getHeight()));
 if (mrRenderer.getIterCount() == 0)
 mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-05 Thread Noel Grandin (via logerrit)
 editeng/source/misc/svxacorr.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit ad66197f9e18da53afb42042bd0c86e0f3d94675
Author: Noel Grandin 
AuthorDate: Thu Nov 5 17:57:34 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 6 07:07:09 2020 +0100

tdf#137908 Revert "use FasterParser for LoadXMLExceptList_Imp"

This reverts commit 79ea745d595945e454ced9f6cacd2bb57aa51f95.

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ea7372f1e15d..70ff36c5594f 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2215,16 +2215,19 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
 aParserInput.aInputStream = new utl::OInputStreamWrapper( 
*xStrm );
 
 // get filter
-rtl::Reference< SvXMLExceptionListImport > xImport = new 
SvXMLExceptionListImport ( xContext, *rpLst );
+uno::Reference< xml::sax::XFastDocumentHandler > xFilter = new 
SvXMLExceptionListImport ( xContext, *rpLst );
 
 // connect parser and filter
+uno::Reference< xml::sax::XFastParser > xParser = 
xml::sax::FastParser::create( xContext );
 uno::Reference xTokenHandler = 
new SvXMLAutoCorrectTokenHandler;
-xImport->setTokenHandler( xTokenHandler );
+xParser->setFastDocumentHandler( xFilter );
+xParser->registerNamespace( 
"http://openoffice.org/2001/block-list";, SvXMLAutoCorrectToken::NAMESPACE );
+xParser->setTokenHandler( xTokenHandler );
 
 // parse
 try
 {
-xImport->parseStream( aParserInput );
+xParser->parseStream( aParserInput );
 }
 catch( const xml::sax::SAXParseException& )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-28 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/impedit3.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 27ae083f7e5fce97c73498698d855cdcaac7737d
Author: Noel Grandin 
AuthorDate: Wed Oct 28 17:27:30 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 28 20:32:11 2020 +0100

std::set->o3tl::sorted_vector in ImpEditEngine

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

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 4ffaeec6afaa..2925183e9cf7 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -67,6 +67,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2390,7 +2391,7 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* 
pParaPortion, sal_Int32& rS
 ContentNode* pNode = pParaPortion->GetNode();
 DBG_ASSERT( pNode->Len(), "CreateTextPortions should not be used for empty 
paragraphs!" );
 
-std::set< sal_Int32 > aPositions;
+o3tl::sorted_vector< sal_Int32 > aPositions;
 aPositions.insert( 0 );
 
 sal_uInt16 nAttr = 0;
@@ -2463,10 +2464,10 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* 
pParaPortion, sal_Int32& rS
 // A portion may also have been formed by a line break:
 aPositions.insert( nPortionStart );
 
-std::set< sal_Int32 >::iterator nInvPos = aPositions.find(  nPortionStart 
);
+auto nInvPos = aPositions.find(  nPortionStart );
 DBG_ASSERT( (nInvPos != aPositions.end()), "InvPos ?!" );
 
-std::set< sal_Int32 >::iterator i = nInvPos;
+auto i = nInvPos;
 ++i;
 while ( i != aPositions.end() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng include/vcl sd/source svx/source sw/source vcl/inc vcl/source vcl/unx

2020-10-27 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx   |   11 +++
 editeng/source/outliner/outlvw.cxx|6 +-
 include/editeng/editview.hxx  |1 
 include/editeng/outliner.hxx  |1 
 include/vcl/layout.hxx|6 ++
 include/vcl/toolkit/edit.hxx  |1 
 include/vcl/window.hxx|1 
 sd/source/ui/annotations/annotationwindow.cxx |7 ++
 sd/source/ui/annotations/annotationwindow.hxx |1 
 sd/source/ui/inc/Window.hxx   |2 
 sd/source/ui/view/sdwindow.cxx|   17 +
 svx/source/dialog/weldeditview.cxx|   15 +
 sw/source/uibase/docvw/SidebarTxtControl.cxx  |7 ++
 sw/source/uibase/docvw/SidebarTxtControl.hxx  |1 
 vcl/inc/salvtables.hxx|1 
 vcl/inc/salwtype.hxx  |1 
 vcl/source/app/salvtables.cxx |7 ++
 vcl/source/control/edit.cxx   |   10 +++
 vcl/source/window/layout.cxx  |   20 --
 vcl/source/window/window.cxx  |   60 
 vcl/source/window/winproc.cxx |   20 ++
 vcl/unx/gtk3/gtk3gtkframe.cxx |   78 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |2 
 23 files changed, 205 insertions(+), 71 deletions(-)

New commits:
commit b9405fbc4e19901c78d136895c5ab0437d8450ac
Author: Caolán McNamara 
AuthorDate: Sun Oct 25 15:27:58 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Oct 27 17:00:59 2020 +0100

Resolves: tdf#137620 add DeleteSurroundingText at vcl::Window level

a) give it a default implementation based on the current one
b) re-use code introduced for WeldEditView::DeleteSurroundingText
   for the EditView containing vcl::Window in impress/draw and
   various similar Annotation windows

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 94012cf70651..3133126ba638 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1549,6 +1549,17 @@ Selection EditView::GetSurroundingTextSelection() const
 }
 }
 
+bool EditView::DeleteSurroundingText(const Selection& rRange)
+{
+ESelection aSel(GetSelection());
+aSel.nEndPara = aSel.nStartPara;
+aSel.nStartPos = rRange.Min();
+aSel.nEndPos = rRange.Max();
+SetSelection(aSel);
+DeleteSelected();
+return true;
+}
+
 void EditView::SetCursorLogicPosition(const Point& rPosition, bool bPoint, 
bool bClearMark)
 {
 Point aDocPos(pImpEditView->GetDocPos(rPosition));
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 525559720eac..aff9992d8b4c 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1409,8 +1409,12 @@ Selection OutlinerView::GetSurroundingTextSelection() 
const
 return pEditView->GetSurroundingTextSelection();
 }
 
-// = some code for thesaurus sub menu within context menu
+bool OutlinerView::DeleteSurroundingText(const Selection& rSelection)
+{
+return pEditView->DeleteSurroundingText(rSelection);
+}
 
+// = some code for thesaurus sub menu within context menu
 
 namespace {
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index f75b5ca1228b..e89cd356be72 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -309,6 +309,7 @@ public:
 
 OUStringGetSurroundingText() const;
 Selection   GetSurroundingTextSelection() const;
+boolDeleteSurroundingText(const Selection& rRange);
 
 /** Tries to determine the language of 'rText', returning a matching known
 locale if possible, or a fallback, or LANGUAGE_NONE if nothing found or
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 3ea2fd9b2631..f06bd9a7448d 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -354,6 +354,7 @@ public:
 
 OUStringGetSurroundingText() const;
 Selection   GetSurroundingTextSelection() const;
+boolDeleteSurroundingText(const Selection& rRange);
 
 voidSetEndCutPasteLinkHdl(const Link &rLink) 
{ aEndCutPasteLink = rLink; }
 };
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 60a7f44825e4..d67ab24ffb21 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -648,6 +648,7 @@ private:
 Link m_aCommandHdl;
 Link m_aQueryTooltipHdl;
 Link m_aGetSurroundingHdl;
+Link m_aDeleteSurroundingHdl;
 Link m_aStartDragHdl;
 
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override
@@ -748,6 +749,7 @@ public:
 }
 virtual OU

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

2020-10-26 Thread Noel (via logerrit)
 editeng/source/rtf/svxrtf.cxx |   20 +++-
 include/editeng/svxrtf.hxx|   14 ++
 2 files changed, 13 insertions(+), 21 deletions(-)

New commits:
commit 39ae9d29be0b4308b6e6ab7ee52c3fe6d6dc7d0c
Author: Noel 
AuthorDate: Mon Oct 26 10:17:14 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 26 13:01:53 2020 +0100

std::unique_ptr -> std::optional

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

diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index affc44b8f5f2..17ef94553ec5 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -72,13 +72,11 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& 
rIn )
 , bIsInReadStyleTab( false)
 {
 pDfltFont.reset( new vcl::Font );
-pDfltColor.reset( new Color );
+mxDefaultColor = Color();
 }
 
 SvxRTFParser::~SvxRTFParser()
 {
-if( !aColorTbl.empty() )
-ClearColorTbl();
 if( !aAttrStack.empty() )
 ClearAttrStack();
 }
@@ -95,7 +93,7 @@ SvParserState SvxRTFParser::CallParser()
 if( !pInsPos )
 return SvParserState::Error;
 
-if( !aColorTbl.empty() )
+if( !maColorTable.empty() )
 ClearColorTbl();
 m_FontTable.clear();
 m_StyleTable.clear();
@@ -422,11 +420,11 @@ void SvxRTFParser::ReadColorTable()
 {
 // one color is finished, fill in the table
 // try to map the values to SV internal names
-Color* pColor = new Color( nRed, nGreen, nBlue );
-if( aColorTbl.empty() &&
+Color aColor( nRed, nGreen, nBlue );
+if( maColorTable.empty() &&
 sal_uInt8(-1) == nRed && sal_uInt8(-1) == nGreen && 
sal_uInt8(-1) == nBlue )
-*pColor = COL_AUTO;
-aColorTbl.push_back( pColor );
+aColor = COL_AUTO;
+maColorTable.push_back( aColor );
 nRed = 0;
 nGreen = 0;
 nBlue = 0;
@@ -579,11 +577,7 @@ void SvxRTFParser::ReadFontTable()
 
 void SvxRTFParser::ClearColorTbl()
 {
-while ( !aColorTbl.empty() )
-{
-delete aColorTbl.back();
-aColorTbl.pop_back();
-}
+maColorTable.clear();
 }
 
 void SvxRTFParser::ClearAttrStack()
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index 2069abb48877..5457cf9765ae 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -23,16 +23,15 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
 
 namespace vcl { class Font; }
-class Color;
 struct SvxRTFStyleType;
 class SvxRTFItemStackType;
 class SvxRTFItemStackList : public 
std::vector> {};
@@ -160,7 +159,7 @@ struct RTFPardAttrMapIds
 
 class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
 {
-std::deque< Color* >  aColorTbl;
+std::vectormaColorTable;
 SvxRTFFontTbl m_FontTable;
 SvxRTFStyleTblm_StyleTable;
 std::deque< std::unique_ptr >  aAttrStack;
@@ -172,7 +171,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
 
 std::unique_ptr pInsPos;
 SfxItemPool* pAttrPool;
-std::unique_ptr  pDfltColor;
+std::optional  mxDefaultColor;
 std::unique_ptr   pDfltFont;
 std::unique_ptr pRTFDefaults;
 
@@ -339,10 +338,9 @@ public:
 
 inline const Color& SvxRTFParser::GetColor( size_t nId ) const
 {
-Color* pColor = pDfltColor.get();
-if( nId < aColorTbl.size() )
-pColor = aColorTbl[ nId ];
-return *pColor;
+if( nId < maColorTable.size() )
+return maColorTable[ nId ];
+return *mxDefaultColor;
 }
 
 inline SfxItemSet& SvxRTFParser::GetAttrSet()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-26 Thread Noel (via logerrit)
 editeng/source/editeng/impedit.cxx |2 -
 editeng/source/editeng/impedit.hxx |8 +++---
 sw/inc/swtable.hxx |   13 +-
 sw/source/core/table/swtable.cxx   |   46 +
 4 files changed, 24 insertions(+), 45 deletions(-)

New commits:
commit f49a6361ce4d7dc4efaca0b1701a3ca0e0702eb2
Author: Noel 
AuthorDate: Mon Oct 26 10:03:47 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 26 11:51:07 2020 +0100

std::unique_ptr -> std::optional

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 2c18762e1f9d..9e82cedf32f4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -214,7 +214,7 @@ ImpEditView::~ImpEditView()
 
 void ImpEditView::SetBackgroundColor( const Color& rColor )
 {
-pBackgroundColor.reset( new Color( rColor ) );
+mxBackgroundColor = rColor;
 }
 
 void ImpEditView::RegisterViewShell(OutlinerViewShell* pViewShell)
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 921c0dfe5498..dc28f3db2a65 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -257,7 +257,7 @@ class ImpEditView : public vcl::unohelper::DragAndDropClient
 private:
 EditView* pEditView;
 std::unique_ptr>  pCursor;
-std::unique_ptrpBackgroundColor;
+std::optional  mxBackgroundColor;
 /// Containing view shell, if any.
 OutlinerViewShell*mpViewShell;
 /// Another shell, just listening to our state, if any.
@@ -436,9 +436,9 @@ public:
 boolDoAutoHeight() const{ return bool( nControl & 
EVControlBits::AUTOSIZEY); }
 boolDoInvalidateMore() const{ return bool( nControl & 
EVControlBits::INVONEMORE ); }
 
-voidSetBackgroundColor( const Color& rColor );
-const Color&GetBackgroundColor() const {
-return ( pBackgroundColor ? *pBackgroundColor : 
pOutWin->GetBackground().GetColor() ); }
+voidSetBackgroundColor( const Color& rColor );
+const Color & GetBackgroundColor() const {
+return ( mxBackgroundColor ? *mxBackgroundColor : 
pOutWin->GetBackground().GetColor() ); }
 
 /// Informs this edit view about which view shell contains it.
 void RegisterViewShell(OutlinerViewShell* pViewShell);
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index a101cfeeb85e..d878478f8978 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SwStartNode;
 class SwFormat;
@@ -402,8 +403,8 @@ class SW_DLLPUBLIC SwTableBox: public SwClient  
//Client of FrameFormat.
 const SwStartNode * m_pStartNode;
 SwTableLine *m_pUpper;
 
-std::unique_ptr mpUserColor;
-std::unique_ptr mpNumFormatColor;
+std::optional mxUserColor;
+std::optional mxNumFormatColor;
 tools::Long mnRowSpan;
 bool mbDummyFlag;
 
@@ -478,10 +479,10 @@ public:
 void ActualiseValueBox();
 
 // Access on internal data - currently used for the NumFormatter.
-inline const Color* GetSaveUserColor()  const;
-inline const Color* GetSaveNumFormatColor() const;
-inline void SetSaveUserColor(const Color* p );
-inline void SetSaveNumFormatColor( const Color* p );
+const std::optional& GetSaveUserColor()  const { return 
mxUserColor; }
+const std::optional& GetSaveNumFormatColor() const { return 
mxNumFormatColor; }
+void SetSaveUserColor(std::optional p ) { mxUserColor = p; }
+void SetSaveNumFormatColor( std::optional p ) { mxNumFormatColor = 
p; }
 
 tools::Long getRowSpan() const;
 void setRowSpan( tools::Long nNewRowSpan );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 003dd062aaaf..c78c9ffdea89 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -71,32 +71,6 @@ using namespace com::sun::star;
 static void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const 
Color* pCol,
 bool bChgAlign, sal_uLong nNdPos );
 
-inline const Color* SwTableBox::GetSaveUserColor() const
-{
-return mpUserColor.get();
-}
-
-inline const Color* SwTableBox::GetSaveNumFormatColor() const
-{
-return mpNumFormatColor.get();
-}
-
-inline void SwTableBox::SetSaveUserColor(const Color* p )
-{
-if (p)
-mpUserColor.reset(new Color(*p));
-else
-mpUserColor.reset();
-}
-
-inline void SwTableBox::SetSaveNumFormatColor( const Color* p )
-{
-if (p)
-mpNumFormatColor.reset(new Color(*p));
-else
-mpNumFormatColor.reset();
-}
-
 tools::Long SwTableBox::getRowSpan() const
 {
 return mnRowSpan;
@@ -1990,8 +1964,10 @@ void ChgTe

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

2020-10-25 Thread Arnaud Versini (via logerrit)
 editeng/source/accessibility/AccessibleImageBullet.cxx |   14 +-
 editeng/source/accessibility/AccessibleImageBullet.hxx |2 ++
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 5882b9671608a082454f07fccc9d01822382f8b4
Author: Arnaud Versini 
AuthorDate: Sun Oct 25 17:10:26 2020 +0100
Commit: Noel Grandin 
CommitDate: Sun Oct 25 18:12:50 2020 +0100

editeng: AccessibleImageBullet : avoid recursive SolarMutext

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

diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx 
b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 6d5b660aa26b..0b319589f4d5 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.cxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.cxx
@@ -214,7 +214,7 @@ namespace accessibility
 DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::contains: index value 
overflow");
 
-awt::Rectangle aTmpRect = getBounds();
+awt::Rectangle aTmpRect = implGetBounds();
 tools::Rectangle aRect( Point(aTmpRect.X, aTmpRect.Y), 
Size(aTmpRect.Width, aTmpRect.Height) );
 Point aPoint( rPoint.X, rPoint.Y );
 
@@ -230,11 +230,15 @@ namespace accessibility
 
 awt::Rectangle SAL_CALL AccessibleImageBullet::getBounds(  )
 {
-
 SolarMutexGuard aGuard;
 
+return implGetBounds();
+}
+awt::Rectangle AccessibleImageBullet::implGetBounds(  )
+{
+
 DBG_ASSERT(GetParagraphIndex() >= 0,
-   "AccessibleEditableTextPara::getBounds: index value 
overflow");
+   "AccessibleEditableTextPara::implGetBounds: index value 
overflow");
 
 SvxTextForwarder& rCacheTF = GetTextForwarder();
 EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( GetParagraphIndex() 
);
@@ -271,7 +275,7 @@ namespace accessibility
 
 SolarMutexGuard aGuard;
 
-awt::Rectangle aRect = getBounds();
+awt::Rectangle aRect = implGetBounds();
 
 return awt::Point( aRect.X, aRect.Y );
 }
@@ -307,7 +311,7 @@ namespace accessibility
 
 SolarMutexGuard aGuard;
 
-awt::Rectangle aRect = getBounds();
+awt::Rectangle aRect = implGetBounds();
 
 return awt::Size( aRect.Width, aRect.Height );
 }
diff --git a/editeng/source/accessibility/AccessibleImageBullet.hxx 
b/editeng/source/accessibility/AccessibleImageBullet.hxx
index 8d75494a994b..b1041ce4aa56 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.hxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.hxx
@@ -171,6 +171,8 @@ namespace accessibility
  */
 SvxViewForwarder&   GetViewForwarder() const;
 
+css::awt::Rectangle implGetBounds();
+
 // the paragraph index in the edit engine (guarded by solar mutex)
 sal_Int32   mnParagraphIndex;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng sc/source sc/uiconfig sc/UIConfig_scalc.mk solenv/sanitizers

2020-10-16 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |5 
 include/editeng/editview.hxx|1 
 sc/UIConfig_scalc.mk|1 
 sc/source/ui/Accessibility/AccessibleEditObject.cxx |   10 
 sc/source/ui/Accessibility/AccessibleText.cxx   |   88 --
 sc/source/ui/app/inputhdl.cxx   |   10 
 sc/source/ui/app/inputwin.cxx   |  815 +---
 sc/source/ui/inc/AccessibleEditObject.hxx   |   10 
 sc/source/ui/inc/AccessibleText.hxx |6 
 sc/source/ui/inc/inputwin.hxx   |   99 +-
 sc/source/ui/pagedlg/tphfedit.cxx   |4 
 sc/uiconfig/scalc/ui/inputbar.ui|  122 ++
 solenv/sanitizers/ui/modules/scalc.suppr|2 
 13 files changed, 639 insertions(+), 534 deletions(-)

New commits:
commit e087e25f05e689091cbf1c4f91b6e93878ac17ec
Author: Caolán McNamara 
AuthorDate: Mon Oct 5 14:19:05 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 16 12:54:14 2020 +0200

weld InputBar

this also restores that DnD of a selection from the inputbar is pasted as 
plain
text not rich text formatted with the happenstance formatting of the 
inputbar's
EditEngine

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index ed8bd065dca2..6b897a3bdb5c 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -309,6 +309,11 @@ bool EditView::HasSelection() const
 return pImpEditView->HasSelection();
 }
 
+bool EditView::IsSelectionAtPoint(const Point& rPointPixel)
+{
+return pImpEditView->IsSelectionAtPoint(rPointPixel);
+}
+
 void EditView::DeleteSelected()
 {
 pImpEditView->DeleteSelected();
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 97b77609fe60..093e0d851ab6 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -185,6 +185,7 @@ public:
 boolHasSelection() const;
 ESelection  GetSelection() const;
 voidSetSelection( const ESelection& rNewSel );
+boolIsSelectionAtPoint(const Point& rPointPixel);
 voidSelectCurrentWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
 /// Returns the rectangles of the current selection in TWIPs.
 void GetSelectionRectangles(std::vector& rLogicRects) 
const;
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index b2485054ab45..f1a6f4fe902f 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -144,6 +144,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/headerfootercontent \
sc/uiconfig/scalc/ui/headerfooterdialog \
sc/uiconfig/scalc/ui/imoptdialog \
+   sc/uiconfig/scalc/ui/inputbar \
sc/uiconfig/scalc/ui/inputstringdialog \
sc/uiconfig/scalc/ui/insertcells \
sc/uiconfig/scalc/ui/insertname \
diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx 
b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index e93e6dbdb289..d0afd2c8196c 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -63,17 +63,19 @@ ScAccessibleEditObject::ScAccessibleEditObject(
 : ScAccessibleContextBase(rxParent, AccessibleRole::TEXT_FRAME)
 , mpEditView(pEditView)
 , mpWindow(pWin)
+, mpTextWnd(nullptr)
 , meObjectType(eObjectType)
 , mbHasFocus(false)
 , m_pScDoc(nullptr)
 {
-InitAcc(rxParent, pEditView, pWin, rName, rDescription);
+InitAcc(rxParent, pEditView, pWin, nullptr, rName, rDescription);
 }
 
 ScAccessibleEditObject::ScAccessibleEditObject(EditObjectType eObjectType)
 : ScAccessibleContextBase(nullptr, AccessibleRole::TEXT_FRAME)
 , mpEditView(nullptr)
 , mpWindow(nullptr)
+, mpTextWnd(nullptr)
 , meObjectType(eObjectType)
 , mbHasFocus(false)
 , m_pScDoc(nullptr)
@@ -82,12 +84,14 @@ 
ScAccessibleEditObject::ScAccessibleEditObject(EditObjectType eObjectType)
 
 void ScAccessibleEditObject::InitAcc(
 const uno::Reference& rxParent,
-EditView* pEditView, vcl::Window* pWin, const OUString& rName,
+EditView* pEditView, vcl::Window* pWin,
+ScTextWnd* pTxtWnd, const OUString& rName,
 const OUString& rDescription)
 {
 SetParent(rxParent);
 mpEditView = pEditView;
 mpWindow = pWin;
+mpTextWnd = pTxtWnd;
 
 CreateTextHelper();
 SetName(rName);
@@ -366,7 +370,7 @@ void ScAccessibleEditObject::CreateTextHelper()
 else
 {
 pAccessibleTextData.reset
-(new ScAccessibleEditLineTextData(nullptr, 
GetOutputDeviceForView()));
+(n

[Libreoffice-commits] core.git: editeng/source framework/source i18npool/source idlc/source oox/source sc/qa sc/source sd/source smoketest/libtest.cxx svx/source sw/source testtools/source vcl/qa vcl/

2020-10-16 Thread Noel (via logerrit)
 editeng/source/editeng/editdbg.cxx|   10 ++--
 framework/source/fwe/xml/menudocumenthandler.cxx  |6 --
 framework/source/fwe/xml/saxnamespacefilter.cxx   |6 --
 framework/source/fwe/xml/statusbardocumenthandler.cxx |6 --
 framework/source/fwe/xml/toolboxdocumenthandler.cxx   |6 --
 i18npool/source/localedata/LocaleNode.cxx |6 +-
 i18npool/source/textconversion/genconv_dict.cxx   |   10 ++--
 idlc/source/errorhandler.cxx  |   12 ++---
 idlc/source/idlcmain.cxx  |9 +---
 oox/source/helper/propertymap.cxx |6 +-
 sc/qa/unit/filters-test.cxx   |8 +--
 sc/source/filter/xcl97/xcl97rec.cxx   |6 +-
 sd/source/filter/ppt/pptinanimations.cxx  |   22 +-
 smoketest/libtest.cxx |7 +--
 svx/source/tbxctrls/colrctrl.cxx  |2 
 sw/source/filter/ww8/WW8TableInfo.cxx |6 +-
 testtools/source/performance/ubtest.cxx   |2 
 vcl/qa/cppunit/complextext.cxx|6 +-
 vcl/qa/cppunit/graphicfilter/filters-test.cxx |2 
 vcl/unx/generic/print/common_gfx.cxx  |   39 +-
 20 files changed, 83 insertions(+), 94 deletions(-)

New commits:
commit 87c90cec38c43efbbd9cbfad1f0f607f428043d4
Author: Noel 
AuthorDate: Thu Oct 15 14:26:35 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 16 11:12:31 2020 +0200

fix some *printf which are using "%l" ie. long specifiers

which are not portable between Linux and Windows because long
is not portable.

In preparation for converting long -> tools::Long

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

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 720c890d2048..cee32beafcc2 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -453,9 +453,9 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
 fprintf( fp, 
"\n"
 );
 fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
 fprintf( fp, "\nRefMapMode: %i", int( 
pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
-fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), 
pEE->GetPaperSize().Height() );
+fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, 
sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) 
);
 fprintf( fp, "\nMaxAutoPaperSize: %li x %li", 
pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
-fprintf( fp, "\nMinAutoPaperSize: %li x %li", 
pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
+fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , 
sal_Int64(pEE->GetMinAutoPaperSize().Width()), 
sal_Int64(pEE->GetMinAutoPaperSize().Height()) );
 fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
 fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() 
);
 for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
@@ -464,9 +464,11 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
 DBG_ASSERT( pV, "View not found!" );
 fprintf( fp, "\nView %zu: Focus=%i", nView, 
pV->GetWindow()->HasFocus() );
 tools::Rectangle aR( pV->GetOutputArea() );
-fprintf( fp, "\n  OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode 
= %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), 
aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
+fprintf( fp, "\n  OutputArea: nX=%" SAL_PRIdINT64 ", nY=%" 
SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64 ", MapMode = %i",
+sal_Int64(aR.TopLeft().X()), sal_Int64(aR.TopLeft().Y()), 
sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) , int( 
pV->GetWindow()->GetMapMode().GetMapUnit() ) );
 aR = pV->GetVisArea();
-fprintf( fp, "\n  VisArea: nX=%li, nY=%li, dX=%li, dY=%li", 
aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() 
);
+fprintf( fp, "\n  VisArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 
", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64,
+sal_Int64(aR.TopLeft().X()), sal_Int64(aR.TopLeft().Y()), 
sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) );
 ESelection aSel = pV->GetSelection();
 fprintf( fp, "\n  Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 
", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, 
aSel.nEndPara, aSel.nEndPos );
 }
diff --git a/fra

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

2020-10-15 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 5bb402a796b26767459c8e1e9d2f24796468879b
Author: Caolán McNamara 
AuthorDate: Thu Oct 15 13:04:59 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 15 17:55:35 2020 +0200

don't crash if not hosted in a vcl::Window

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index b0f229ad9cef..ed8bd065dca2 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -492,6 +492,8 @@ void EditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor, bool bActivat
 
 if (pImpEditView->mpViewShell && !bActivate)
 {
+if (!pImpEditView->pOutWin)
+return;
 VclPtr pParent = 
pImpEditView->pOutWin->GetParentWithLOKNotifier();
 if (pParent && pParent->GetLOKWindowId() != 0)
 return;
@@ -508,6 +510,8 @@ void EditView::HideCursor(bool bDeactivate)
 
 if (pImpEditView->mpViewShell && !bDeactivate)
 {
+if (!pImpEditView->pOutWin)
+return;
 VclPtr pParent = 
pImpEditView->pOutWin->GetParentWithLOKNotifier();
 if (pParent && pParent->GetLOKWindowId() != 0)
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-13 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit.cxx |   23 +++
 editeng/source/editeng/impedit.hxx |1 +
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 7b7905b37f42029611bd375d6ca24d9b9508b8ff
Author: Caolán McNamara 
AuthorDate: Tue Oct 13 09:12:14 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 13 17:29:30 2020 +0200

combine duplicates together

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 8b61a4aee975..c879c5ff51c5 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -815,9 +815,16 @@ void ImpEditView::SetSelectionMode( EESelectionMode 
eNewMode )
 }
 }
 
+OutputDevice& ImpEditView::GetOutputDevice() const
+{
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
+return pCallbacks->EditViewOutputDevice();
+return *pOutWin;
+}
+
 void ImpEditView::SetOutputArea( const tools::Rectangle& rRect )
 {
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *pOutWin;
+const OutputDevice& rOutDev = GetOutputDevice();
 // should be better be aligned on pixels!
 tools::Rectangle aNewRect(rOutDev.LogicToPixel(rRect));
 aNewRect = rOutDev.PixelToLogic(aNewRect);
@@ -1244,7 +1251,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 aEditCursor.SetTop( GetVisDocTop() );
 }
 
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *pOutWin;
+const OutputDevice& rOutDev = GetOutputDevice();
 
 long nOnePixel = rOutDev.PixelToLogic( Size( 1, 0 ) ).Width();
 
@@ -1443,7 +1450,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, 
ScrollRangeCheck nRangeCheck )
 if ( !ndX && !ndY )
 return Pair( 0, 0 );
 
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+const OutputDevice& rOutDev = GetOutputDevice();
 
 #ifdef DBG_UTIL
 tools::Rectangle aR( aOutArea );
@@ -2020,7 +2027,7 @@ bool ImpEditView::IsSelectionAtPoint( const Point& 
rPosPixel )
 return true;
 
 // Logical units ...
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+const OutputDevice& rOutDev = GetOutputDevice();
 Point aMousePos = rOutDev.PixelToLogic(rPosPixel);
 
 if ( ( !GetOutputArea().IsInside( aMousePos ) ) && 
!pEditEngine->pImpEditEngine->IsInSelectionMode() )
@@ -2040,7 +2047,7 @@ bool ImpEditView::SetCursorAtPoint( const Point& 
rPointPixel )
 Point aMousePos( rPointPixel );
 
 // Logical units ...
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+const OutputDevice& rOutDev = GetOutputDevice();
 aMousePos = rOutDev.PixelToLogic( aMousePos );
 
 if ( ( !GetOutputArea().IsInside( aMousePos ) ) && 
!pEditEngine->pImpEditEngine->IsInSelectionMode() )
@@ -2090,7 +2097,7 @@ void ImpEditView::HideDDCursor()
 {
 if ( pDragAndDropInfo && pDragAndDropInfo->bVisCursor )
 {
-OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+OutputDevice& rOutDev = GetOutputDevice();
 rOutDev.DrawOutDev( pDragAndDropInfo->aCurSavedCursor.TopLeft(), 
pDragAndDropInfo->aCurSavedCursor.GetSize(),
 Point(0,0), 
pDragAndDropInfo->aCurSavedCursor.GetSize(),*pDragAndDropInfo->pBackground );
 pDragAndDropInfo->bVisCursor = false;
@@ -2105,7 +2112,7 @@ void ImpEditView::ShowDDCursor( const tools::Rectangle& 
rRect )
 if (pOutWin && pOutWin->GetCursor())
 pOutWin->GetCursor()->Hide();
 
-OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+OutputDevice& rOutDev = GetOutputDevice();
 Color aOldFillColor = rOutDev.GetFillColor();
 rOutDev.SetFillColor( Color(4210752) );// GRAY BRUSH_50, OLDSV, change 
to DDCursor!
 
@@ -2439,7 +2446,7 @@ void ImpEditView::dragOver(const 
css::datatransfer::dnd::DropTargetDragEvent& rD
 {
 SolarMutexGuard aVclGuard;
 
-const OutputDevice& rOutDev = getEditViewCallbacks() ? 
getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
+const OutputDevice& rOutDev = GetOutputDevice();
 
 Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
 aMousePos = rOutDev.PixelToLogic( aMousePos );
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index da33598365dd..91239dd0e1aa 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -392,6 +392,7 @@ public:
 
 v

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

2020-10-12 Thread Caolán McNamara (via logerrit)
 editeng/source/rtf/svxrtf.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 47da5a7e95ef45efcc9e13f225273e728d1fbc58
Author: Caolán McNamara 
AuthorDate: Sun Oct 11 20:20:34 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 12 09:48:06 2020 +0200

ofz#24932 collatoral ubsan failure seen in TimeOut case

unsigned integer overflow: 0 - 1 cannot be represented in type size_t

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

diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index a5c1217ff3e7..affc44b8f5f2 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -1085,7 +1085,8 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& 
rParser )
 // It can be merged
 aAttrSet.Put( aMrgSet );
 
-for (size_t n = 0; n < m_pChildList->size(); ++n)
+size_t n = 0, nChildLen = m_pChildList->size();
+while (n < nChildLen)
 {
 pTmp = (*m_pChildList)[n].get();
 pTmp->aAttrSet.Differentiate( aMrgSet );
@@ -1093,8 +1094,10 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& 
rParser )
 if (!pTmp->m_pChildList && !pTmp->aAttrSet.Count() && !pTmp->nStyleNo)
 {
 m_pChildList->erase( m_pChildList->begin() + n );
---n;
+--nChildLen;
+continue;
 }
+++n;
 }
 if (m_pChildList->empty())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-10 Thread Caolán McNamara (via logerrit)
 editeng/source/outliner/outlobj.cxx |5 -
 include/editeng/outlobj.hxx |1 -
 2 files changed, 6 deletions(-)

New commits:
commit 4b988449101998b37f4c47a9eea63dc3d46472e9
Author: Caolán McNamara 
AuthorDate: Sat Oct 10 19:33:43 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 10 22:20:17 2020 +0200

drop newly unused OutlinerParaObject ctor variant

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

diff --git a/editeng/source/outliner/outlobj.cxx 
b/editeng/source/outliner/outlobj.cxx
index 61b0a40d6b98..c8a589911079 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -67,11 +67,6 @@ OutlinerParaObject::OutlinerParaObject(
 {
 }
 
-OutlinerParaObject::OutlinerParaObject( const EditTextObject& rTextObj ) :
-mpImpl(OutlinerParaObjData(rTextObj.Clone(), ParagraphDataVector(), true))
-{
-}
-
 OutlinerParaObject::OutlinerParaObject( std::unique_ptr 
pTextObj ) :
 mpImpl(OutlinerParaObjData(std::move(pTextObj), ParagraphDataVector(), 
true))
 {
diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx
index 5c11180d27de..2d95a39c1a4f 100644
--- a/include/editeng/outlobj.hxx
+++ b/include/editeng/outlobj.hxx
@@ -69,7 +69,6 @@ class EDITENG_DLLPUBLIC OutlinerParaObject
 public:
 // constructors/destructor
 OutlinerParaObject(std::unique_ptr, const 
ParagraphDataVector&, bool bIsEditDoc);
-OutlinerParaObject( const EditTextObject&);
 OutlinerParaObject( std::unique_ptr );
 OutlinerParaObject( const OutlinerParaObject&);
 ~OutlinerParaObject();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-10 Thread Caolán McNamara (via logerrit)
 editeng/source/outliner/outliner.cxx |4 ++--
 editeng/source/outliner/outlobj.cxx  |4 ++--
 include/editeng/outlobj.hxx  |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fb8973f31f111229be5184f4e4223e963ced2c7b
Author: Caolán McNamara 
AuthorDate: Sat Oct 10 19:21:38 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 10 22:19:25 2020 +0200

ofz#23492 the only user of this ctor throws away the original of the clone

so we can take ownership of the original instead

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

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 5684c64a44a7..2fba66dc2d4e 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -373,7 +373,7 @@ std::unique_ptr 
Outliner::CreateParaObject( sal_Int32 nStart
 if (nCount <= 0)
 return nullptr;
 
-std::unique_ptr pText = pEditEngine->CreateTextObject( 
nStartPara, nCount );
+std::unique_ptr xText = pEditEngine->CreateTextObject( 
nStartPara, nCount );
 const bool bIsEditDoc(OutlinerMode::TextObject == ImplGetOutlinerMode());
 ParagraphDataVector aParagraphDataVector(nCount);
 const sal_Int32 nLastPara(nStartPara + nCount - 1);
@@ -383,7 +383,7 @@ std::unique_ptr 
Outliner::CreateParaObject( sal_Int32 nStart
 aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara);
 }
 
-std::unique_ptr pPObj(new OutlinerParaObject(*pText, 
aParagraphDataVector, bIsEditDoc));
+std::unique_ptr pPObj(new 
OutlinerParaObject(std::move(xText), aParagraphDataVector, bIsEditDoc));
 pPObj->SetOutlinerMode(GetMode());
 
 return pPObj;
diff --git a/editeng/source/outliner/outlobj.cxx 
b/editeng/source/outliner/outlobj.cxx
index 48c7aa02ab08..61b0a40d6b98 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -62,8 +62,8 @@ bool OutlinerParaObjData::isWrongListEqual(const 
OutlinerParaObjData& rCompare)
 }
 
 OutlinerParaObject::OutlinerParaObject(
-const EditTextObject& rTextObj, const ParagraphDataVector& 
rParagraphDataVector, bool bIsEditDoc ) :
-mpImpl(OutlinerParaObjData(rTextObj.Clone(), rParagraphDataVector, 
bIsEditDoc))
+std::unique_ptr xTextObj, const ParagraphDataVector& 
rParagraphDataVector, bool bIsEditDoc ) :
+mpImpl(OutlinerParaObjData(std::move(xTextObj), rParagraphDataVector, 
bIsEditDoc))
 {
 }
 
diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx
index 98414deda072..5c11180d27de 100644
--- a/include/editeng/outlobj.hxx
+++ b/include/editeng/outlobj.hxx
@@ -68,7 +68,7 @@ class EDITENG_DLLPUBLIC OutlinerParaObject
 
 public:
 // constructors/destructor
-OutlinerParaObject( const EditTextObject&, const ParagraphDataVector&, 
bool bIsEditDoc);
+OutlinerParaObject(std::unique_ptr, const 
ParagraphDataVector&, bool bIsEditDoc);
 OutlinerParaObject( const EditTextObject&);
 OutlinerParaObject( std::unique_ptr );
 OutlinerParaObject( const OutlinerParaObject&);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-08 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editeng.cxx  |4 +++-
 editeng/source/editeng/impedit.cxx  |   12 
 editeng/source/editeng/impedit.hxx  |2 ++
 editeng/source/editeng/impedit3.cxx |9 +
 include/editeng/editview.hxx|5 +
 5 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit e67a755e6d4e3241360c75c3362f90a3af5999ac
Author: Caolán McNamara 
AuthorDate: Thu Oct 8 10:47:34 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 8 14:29:30 2020 +0200

add EditViewCallbacks handler to support updating scrollbar state

the problem is that since...

commit 319d8be9dad248a3ced5ac311e0b20ec3ed4cef7
Date:   Tue Nov 22 16:21:20 2011 +

tweak experimental gsoc multiline input bar, better resizing, enable 
scroll

that uses SetNofifyHdl to try and keep its scrollbar up to date, but that
SetNotifyHdl is also used by a11y to listen to the editengine and only one 
can
be set at a time, so with a11y enabled (the gtk default case) either a11y 
works
or the multiline scroll doesn't or vice versa.

Seeing as the a11y case is the very complicated case, leave a11y alone and
plot a route to disentangle the straightforward calc multiline edit from 
a11y.

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

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 15b140cd97a3..03836af7b511 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2501,13 +2501,15 @@ void EditEngine::StyleSheetChanged( SfxStyleSheet* /* 
pStyle */ )
 
 void EditEngine::ParagraphHeightChanged( sal_Int32 nPara )
 {
-
 if ( GetNotifyHdl().IsSet() )
 {
 EENotify aNotify( EE_NOTIFY_TextHeightChanged );
 aNotify.nParagraph = nPara;
 pImpEditEngine->GetNotifyHdl().Call( aNotify );
 }
+
+for (EditView* pView : pImpEditEngine->aEditViews)
+pView->pImpEditView->ScrollStateChange();
 }
 
 OUString EditEngine::GetUndoComment( sal_uInt16 nId ) const
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 2fc7252c5f23..8b61a4aee975 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1428,6 +1428,15 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 }
 }
 
+// call this so users of EditViewCallbacks can update their scrollbar state
+// so called when we have either scrolled to a new location
+// or the size of document has changed
+void ImpEditView::ScrollStateChange()
+{
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
+pCallbacks->EditViewScrollStateChange();
+}
+
 Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
 {
 DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not 
formatted!" );
@@ -1561,6 +1570,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, 
ScrollRangeCheck nRangeCheck )
 pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
 }
 
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
+pCallbacks->EditViewScrollStateChange();
+
 if (comphelper::LibreOfficeKit::isActive())
 {
 DrawSelectionXOR();
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 59db76fea44d..da33598365dd 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -390,6 +390,8 @@ public:
 voidDrawSelectionXOR( EditSelection, vcl::Region* pRegion = 
nullptr, OutputDevice* pTargetDevice = nullptr );
 void GetSelectionRectangles(EditSelection aTmpSel, 
std::vector& rLogicRects);
 
+void ScrollStateChange();
+
 vcl::Window*GetWindow() const   { return pOutWin; }
 
 voidSetSelectionMode( EESelectionMode eMode );
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 3b362a7704d4..0d88eeba800d 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -399,7 +399,16 @@ void ImpEditEngine::FormatDoc()
 }
 bGrow = true;
 if ( IsCallParaInsertedOrDeleted() )
+{
 GetEditEnginePtr()->ParagraphHeightChanged( nPara );
+
+for (EditView* pView : aEditViews)
+{
+ImpEditView* pImpView = pView->pImpEditView.get();
+pImpView->ScrollStateChange();
+}
+
+}
 pParaPortion->SetMustRepaint( false );
 }
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index ccc2be551ca9..97b77609fe60 100644
--- a/include/editeng/editview.hxx

[Libreoffice-commits] core.git: editeng/source extensions/source i18npool/source include/sfx2 include/svtools include/svx sdext/source sfx2/inc sfx2/source svtools/source svx/inc svx/source vcl/inc vc

2020-10-06 Thread Noel (via logerrit)
 editeng/source/editeng/impedit.cxx   |2 -
 editeng/source/editeng/impedit.hxx   |2 -
 extensions/source/bibliography/datman.cxx|4 +--
 i18npool/source/textconversion/textconversion_ko.cxx |2 -
 include/sfx2/objface.hxx |2 -
 include/sfx2/objsh.hxx   |   10 -
 include/sfx2/shell.hxx   |4 +--
 include/svtools/ctrlbox.hxx  |2 -
 include/svx/gallerybinaryengine.hxx  |9 
 sdext/source/presenter/PresenterToolBar.cxx  |4 +--
 sfx2/inc/emojicontrol.hxx|2 -
 sfx2/source/appl/newhelp.cxx |2 -
 sfx2/source/appl/newhelp.hxx |2 -
 sfx2/source/control/emojicontrol.cxx |2 -
 sfx2/source/control/objface.cxx  |2 -
 sfx2/source/dialog/templdlg.cxx  |4 +--
 sfx2/source/doc/objmisc.cxx  |   10 -
 svtools/source/control/ctrlbox.cxx   |2 -
 svx/inc/galbrws2.hxx |2 -
 svx/source/gallery2/galbrws2.cxx |2 -
 svx/source/gallery2/gallerybinaryengine.cxx  |   12 +--
 vcl/inc/unx/gtk/gtkframe.hxx |2 -
 vcl/unx/gtk3/gtk3gtkframe.cxx|2 -
 vcl/unx/gtk3/gtk3gtkinst.cxx |   20 +--
 24 files changed, 54 insertions(+), 53 deletions(-)

New commits:
commit 7cd179df80957b7daefab028cf35aebb1083b014
Author: Noel 
AuthorDate: Tue Oct 6 12:27:39 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 6 15:30:42 2020 +0200

loplugin:const& make some params and methods const

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 55d1239acb60..2fc7252c5f23 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -312,7 +312,7 @@ void ImpEditView::SelectionChanged()
 }
 
 // This function is also called when a text's font || size is changed. Because 
its highlight rectangle must be updated.
-void ImpEditView::lokSelectionCallback(std::unique_ptr 
&pPolyPoly, bool bStartHandleVisible, bool bEndHandleVisible) {
+void ImpEditView::lokSelectionCallback(const 
std::unique_ptr &pPolyPoly, bool bStartHandleVisible, bool 
bEndHandleVisible) {
 VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
 vcl::Region aRegion( *pPolyPoly );
 
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 0efc9d552074..59db76fea44d 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -305,7 +305,7 @@ private:
 return mpEditViewCallbacks;
 }
 
-void lokSelectionCallback(std::unique_ptr &pPolyPoly, 
bool bStartHandleVisible, bool bEndHandleVisible);
+void lokSelectionCallback(const std::unique_ptr 
&pPolyPoly, bool bStartHandleVisible, bool bEndHandleVisible);
 
 void setEditViewCallbacks(EditViewCallbacks* pEditViewCallbacks)
 {
diff --git a/extensions/source/bibliography/datman.cxx 
b/extensions/source/bibliography/datman.cxx
index 4c4855ca7461..23f8e464f1ce 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -410,14 +410,14 @@ class DBChangeDialog_Impl : public 
weld::GenericDialogController
 
 DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
 public:
-DBChangeDialog_Impl(weld::Window* pParent, BibDataManager* pMan);
+DBChangeDialog_Impl(weld::Window* pParent, const BibDataManager* pMan);
 
 OUString GetCurrentURL()const;
 };
 
 }
 
-DBChangeDialog_Impl::DBChangeDialog_Impl(weld::Window* pParent, 
BibDataManager* pDatMan )
+DBChangeDialog_Impl::DBChangeDialog_Impl(weld::Window* pParent, const 
BibDataManager* pDatMan )
 : GenericDialogController(pParent, 
"modules/sbibliography/ui/choosedatasourcedialog.ui", "ChooseDataSourceDialog")
 , m_xSelectionLB(m_xBuilder->weld_tree_view("treeview"))
 {
diff --git a/i18npool/source/textconversion/textconversion_ko.cxx 
b/i18npool/source/textconversion/textconversion_ko.cxx
index cfcb08d6deb6..d57495a546f1 100644
--- a/i18npool/source/textconversion/textconversion_ko.cxx
+++ b/i18npool/source/textconversion/textconversion_ko.cxx
@@ -188,7 +188,7 @@ TextConversion_ko::getCharConversions(const OUString& 
aText, sal_Int32 nStartPos
 return output;
 }
 
-static Sequence< OUString >& operator += (Sequence< OUString > &rSeq1, 
Sequence< OUString > &rSeq2 )
+static Sequence< OUString >& operator += (Sequence< OUString > &rSeq1, const 
Sequence< OUString > &rSeq2 )
 {
 if (! rSeq1.hasElement

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

2020-10-02 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit2.cxx |   11 -
 include/editeng/editview.hxx|3 
 include/svx/svdedxv.hxx |1 
 include/svx/weldeditview.hxx|9 +
 include/vcl/customweld.hxx  |7 
 include/vcl/layout.hxx  |7 
 include/vcl/weld.hxx|   27 +++
 svx/source/dialog/weldeditview.cxx  |   23 +++
 svx/source/svdraw/svdedxv.cxx   |7 
 vcl/inc/salvtables.hxx  |4 
 vcl/source/app/customweld.cxx   |6 
 vcl/source/app/salvtables.cxx   |   13 +
 vcl/source/window/layout.cxx|   17 ++
 vcl/unx/gtk3/gtk3gtkinst.cxx|  261 +++-
 14 files changed, 386 insertions(+), 10 deletions(-)

New commits:
commit e1ac2a940389f52e28264a623a6620a7a0d94d57
Author: Caolán McNamara 
AuthorDate: Wed Sep 30 14:42:10 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 2 10:37:09 2020 +0200

tdf#134566 gtk IM support for custom widgets

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

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 0887005cc8b1..471159845118 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -478,11 +478,12 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 if ( nInputEnd > rLine.GetEnd() )
 nInputEnd = rLine.GetEnd();
 tools::Rectangle aR2 = PaMtoEditCursor( EditPaM( 
aPaM.GetNode(), nInputEnd ), GetCursorFlags::EndOfLine );
-if (vcl::Window* pWindow = pView->GetWindow())
-{
-tools::Rectangle aRect = 
pView->GetImpEditView()->GetWindowPos( aR1 );
-pWindow->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
-}
+tools::Rectangle aRect = 
pView->GetImpEditView()->GetWindowPos( aR1 );
+auto nExtTextInputWidth = aR2.Left() - aR1.Right();
+if (EditViewCallbacks* pEditViewCallbacks = 
pView->getEditViewCallbacks())
+pEditViewCallbacks->EditViewCursorRect(aRect, 
nExtTextInputWidth);
+else if (vcl::Window* pWindow = pView->GetWindow())
+pWindow->SetCursorRect(&aRect, nExtTextInputWidth);
 }
 }
 else
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index cac588af3243..ccc2be551ca9 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -111,6 +111,9 @@ public:
 // Triggered to update InputEngine context information
 virtual void EditViewInputContext(const InputContext& rInputContext) = 0;
 
+// Triggered to update InputEngine cursor position
+virtual void EditViewCursorRect(const tools::Rectangle& rRect, int 
nExtTextInputWidth) = 0;
+
 // implemented if drag and drop support is wanted
 virtual css::uno::Reference 
GetDropTarget()
 {
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 3036836a999f..ce8bf4b1f480 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -69,6 +69,7 @@ class SVXCORE_DLLPUBLIC SdrObjEditView : public 
SdrGlueEditView, public EditView
 virtual void EditViewSelectionChange() override;
 virtual OutputDevice& EditViewOutputDevice() const override;
 virtual void EditViewInputContext(const InputContext& rInputContext) 
override;
+virtual void EditViewCursorRect(const tools::Rectangle& rRect, int 
nExtTextInputWidth) override;
 
 // The OverlayObjects used for visualizing active TextEdit (currently
 // using TextEditOverlayObject, but not limited to it
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx
index 65396e342b27..d54f2c9404a7 100644
--- a/include/svx/weldeditview.hxx
+++ b/include/svx/weldeditview.hxx
@@ -25,6 +25,8 @@ class SVX_DLLPUBLIC WeldEditView : public 
weld::CustomWidgetController, public E
 public:
 WeldEditView();
 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+virtual int GetSurroundingText(OUString& rSurrounding) override;
+virtual bool DeleteSurroundingText(const Selection& rRange) override;
 
 void SetText(const OUString& rStr) { m_xEditEngine->SetText(rStr); }
 
@@ -77,6 +79,13 @@ protected:
 {
 SetInputContext(rInputContext);
 }
+
+virtual void EditViewCursorRect(const tools::Rectangle& rRect, int 
nExtTextInputWidth) override
+{
+OutputDevice& rRefDevice = EditViewOutputDevice();
+SetCursorRect(rRefDevice.LogicToPixel(rRect),
+  rRefDevice.LogicToPixel(Size(nExtTextInputWidth, 
0)).Width());
+}
 };
 
 #endif // INCLUDED_SVX_WELDEDITVIEW_HXX
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index 0b79df8d1df1..8943110261bd 100644

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

2020-10-01 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit adb00eee518b5c5b743201cb554880448b1f29a9
Author: Caolán McNamara 
AuthorDate: Thu Oct 1 10:40:01 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 1 13:30:16 2020 +0200

Related: tdf#134566 tell IM cursor pos for empty paragraph too

even if there is no text yet we should update the IM cursor
position if asked for it

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

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 34babbcedc7f..0887005cc8b1 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -460,7 +460,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 }
 else if ( rCEvt.GetCommand() == CommandEventId::CursorPos )
 {
-if ( mpIMEInfos && mpIMEInfos->nLen )
+if (mpIMEInfos)
 {
 EditPaM aPaM( pView->pImpEditView->GetEditSelection().Max() );
 tools::Rectangle aR1 = PaMtoEditCursor( aPaM );
@@ -529,7 +529,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 }
 else if ( rCEvt.GetCommand() == CommandEventId::QueryCharPosition )
 {
-if ( mpIMEInfos && mpIMEInfos->nLen )
+if (mpIMEInfos)
 {
 EditPaM aPaM( pView->pImpEditView->GetEditSelection().Max() );
 if ( !IsFormatted() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng include/svx include/vcl svx/source sw/source vcl/inc vcl/source vcl/unx

2020-09-30 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx  |6 +++---
 editeng/source/editeng/impedit.cxx   |   27 ++-
 editeng/source/editeng/impedit.hxx   |6 +++---
 include/editeng/editview.hxx |   14 +-
 include/svx/svdedxv.hxx  |7 ---
 include/svx/weldeditview.hxx |   18 +++---
 include/vcl/customweld.hxx   |6 ++
 include/vcl/weld.hxx |5 -
 svx/source/svdraw/svdedxv.cxx|   13 ++---
 sw/source/ui/dbui/mmaddressblockpage.cxx |6 +++---
 sw/source/ui/dbui/mmaddressblockpage.hxx |4 ++--
 vcl/inc/salvtables.hxx   |2 ++
 vcl/source/app/salvtables.cxx|5 +
 vcl/unx/gtk3/gtk3gtkinst.cxx |5 +
 14 files changed, 77 insertions(+), 47 deletions(-)

New commits:
commit 31342a1bda26f4e3dd29274dafd306fd0a9e7047
Author: Caolán McNamara 
AuthorDate: Wed Sep 30 14:11:54 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 30 17:13:13 2020 +0200

tdf#134566 accept input engine commands in editview in custom widget

for the generic case first

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index b8e3a8a6e75b..b0f229ad9cef 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -169,12 +169,12 @@ EditView::~EditView()
 {
 }
 
-void EditView::setEditViewCallbacks(const EditViewCallbacks* 
pEditViewCallbacks)
+void EditView::setEditViewCallbacks(EditViewCallbacks* pEditViewCallbacks)
 {
 pImpEditView->setEditViewCallbacks(pEditViewCallbacks);
 }
 
-const EditViewCallbacks* EditView::getEditViewCallbacks() const
+EditViewCallbacks* EditView::getEditViewCallbacks() const
 {
 return pImpEditView->getEditViewCallbacks();
 }
@@ -207,7 +207,7 @@ tools::Rectangle EditView::GetInvalidateRect() const
 
 void EditView::InvalidateWindow(const tools::Rectangle& rClipRect)
 {
-if (const EditViewCallbacks* pEditViewCallbacks = 
pImpEditView->getEditViewCallbacks())
+if (EditViewCallbacks* pEditViewCallbacks = 
pImpEditView->getEditViewCallbacks())
 {
 // do not invalidate and trigger a global repaint, but forward
 // the need for change to the applied EditViewCallback, can e.g.
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index f6851b5f292f..55d1239acb60 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -304,10 +304,10 @@ static void lcl_translateTwips(vcl::Window const & 
rParent, vcl::Window& rChild)
 // change/update the Selection visualization for enhanced mechanisms
 void ImpEditView::SelectionChanged()
 {
-if (getEditViewCallbacks())
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
 {
 // use callback to tell about change in selection visualisation
-getEditViewCallbacks()->EditViewSelectionChange();
+pCallbacks->EditViewSelectionChange();
 }
 }
 
@@ -832,12 +832,12 @@ void ImpEditView::SetOutputArea( const tools::Rectangle& 
rRect )
 
 void ImpEditView::InvalidateAtWindow(const tools::Rectangle& rRect)
 {
-if (getEditViewCallbacks())
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
 {
 // do not invalidate and trigger a global repaint, but forward
 // the need for change to the applied EditViewCallback, can e.g.
 // be used to visualize the active edit text in an OverlayObject
-getEditViewCallbacks()->EditViewInvalidate(rRect);
+pCallbacks->EditViewInvalidate(rRect);
 }
 else
 {
@@ -1411,11 +1411,12 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 {
 SvxFont aFont;
 pEditEngine->SeekCursor( aPaM.GetNode(), aPaM.GetIndex()+1, aFont 
);
-if (vcl::Window* pWindow = GetWindow())
-{
-InputContextFlags const nContextFlags = 
InputContextFlags::Text | InputContextFlags::ExtText;
-pWindow->SetInputContext( InputContext( aFont, nContextFlags ) 
);
-}
+
+InputContext aInputContext(aFont, InputContextFlags::Text | 
InputContextFlags::ExtText);
+if (EditViewCallbacks* pCallbacks = getEditViewCallbacks())
+pCallbacks->EditViewInputContext(aInputContext);
+else if (auto xWindow = GetWindow())
+xWindow->SetInputContext(aInputContext);
 }
 }
 else
@@ -2579,8 +2580,8 @@ void ImpEditView::AddDragAndDropListeners()
 return;
 
 css::uno::Reference xDropTarget;
-if (getEditViewCallbacks())
-xDropTarget = getEditViewCallbacks()->GetDropTarget();
+if (EditViewCallbacks* pCal

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

2020-09-08 Thread Julien Nabet (via logerrit)
 editeng/source/uno/unotext.cxx |4 ++--
 vcl/source/window/printdlg.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 18939aadf534f97b3650544345957a0bea46825c
Author: Julien Nabet 
AuthorDate: Tue Sep 8 13:55:37 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 8 18:59:18 2020 +0200

Fix typo in code+comment (vaules->values)

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

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 392c0cd37255..86a2c8062077 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1965,12 +1965,12 @@ void SAL_CALL SvxUnoTextBase::moveTextRange( const 
uno::Reference< text::XTextRa
 /// @throws uno::RuntimeException
 static void SvxPropertyValuesToItemSet(
 SfxItemSet &rItemSet,
-const uno::Sequence< beans::PropertyValue >& rPropertyVaules,
+const uno::Sequence< beans::PropertyValue >& rPropertyValues,
 const SfxItemPropertySet *pPropSet,
 SvxTextForwarder *pForwarder /*needed for WID_NUMLEVEL*/,
 sal_Int32 nPara /*needed for WID_NUMLEVEL*/)
 {
-for (const beans::PropertyValue& rProp : rPropertyVaules)
+for (const beans::PropertyValue& rProp : rPropertyValues)
 {
 const SfxItemPropertySimpleEntry *pEntry = 
pPropSet->getPropertyMap().getByName( rProp.Name );
 if (!pEntry)
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index c210525b17f3..042e58c3a06a 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -2199,7 +2199,7 @@ PrintProgressDialog::PrintProgressDialog(weld::Window* 
i_pParent, int i_nMax)
 mxButton->connect_clicked( LINK( this, PrintProgressDialog, ClickHdl ) );
 
 // after this patch f7157f04fab298423e2c4f6a7e5f8e361164b15f, we have seen 
the calc Max string (sometimes) look above
-// now init to the right start vaules
+// now init to the right start values
 mxText->set_label(getNewLabel(maStr, mnCur, mnMax));
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-31 Thread Andrea Gelmini (via logerrit)
 editeng/source/editeng/editview.cxx |8 
 editeng/source/editeng/impedit.cxx  |4 ++--
 editeng/source/editeng/impedit.hxx  |6 +++---
 include/editeng/editview.hxx|4 ++--
 sc/source/ui/view/gridwin4.cxx  |   22 +++---
 5 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 7c32479b596156a7422a7b96f2548b8a4ea73185
Author: Andrea Gelmini 
AuthorDate: Fri Aug 28 13:01:09 2020 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 31 10:15:56 2020 +0200

Fix typo in code

It passed "make check" on Linux

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index fda93027044c..0bf2de883d46 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1602,14 +1602,14 @@ bool EditView::HasLOKSpecialPositioning() const
 return pImpEditView->HasLOKSpecialPositioning();
 }
 
-void EditView::SupressLOKMessages(bool bSet)
+void EditView::SuppressLOKMessages(bool bSet)
 {
-pImpEditView->SupressLOKMessages(bSet);
+pImpEditView->SuppressLOKMessages(bSet);
 }
 
-bool EditView::IsSupressLOKMessages() const
+bool EditView::IsSuppressLOKMessages() const
 {
-return pImpEditView->IsSupressLOKMessages();
+return pImpEditView->IsSuppressLOKMessages();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 666426c8485b..d90aa81be0c4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -196,7 +196,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* 
pEng, vcl::Window* pWindo
 eAnchorMode(EEAnchorMode::TopLeft),
 mpEditViewCallbacks(nullptr),
 mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive()),
-mbSupressLOKMessages(false)
+mbSuppressLOKMessages(false)
 {
 aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM();
 aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM();
@@ -1298,7 +1298,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 
 GetCursor()->SetSize( aCursorSz );
 
-if (comphelper::LibreOfficeKit::isActive() && mpViewShell && 
!mbSupressLOKMessages)
+if (comphelper::LibreOfficeKit::isActive() && mpViewShell && 
!mbSuppressLOKMessages)
 {
 Point aPos = GetCursor()->GetPos();
 boost::property_tree::ptree aMessageParams;
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index e1e54664f815..77d8059fdcdb 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -299,7 +299,7 @@ private:
 const EditViewCallbacks* mpEditViewCallbacks;
 std::unique_ptr mpLOKSpecialPositioning;
 bool mbBroadcastLOKViewCursor:1;
-bool mbSupressLOKMessages:1;
+bool mbSuppressLOKMessages:1;
 
 const EditViewCallbacks* getEditViewCallbacks() const
 {
@@ -460,8 +460,8 @@ public:
 tools::Rectangle GetLOKSpecialVisArea() const;
 bool HasLOKSpecialPositioning() const;
 
-void SupressLOKMessages(bool bSet) { mbSupressLOKMessages = bSet; }
-bool IsSupressLOKMessages() const { return mbSupressLOKMessages; }
+void SuppressLOKMessages(bool bSet) { mbSuppressLOKMessages = bSet; }
+bool IsSuppressLOKMessages() const { return mbSuppressLOKMessages; }
 };
 
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 86c88f5824b7..0692a17696db 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -336,8 +336,8 @@ public:
 tools::Rectangle GetLOKSpecialVisArea() const;
 bool HasLOKSpecialPositioning() const;
 
-void SupressLOKMessages(bool bSet);
-bool IsSupressLOKMessages() const;
+void SuppressLOKMessages(bool bSet);
+bool IsSuppressLOKMessages() const;
 };
 
 #endif // INCLUDED_EDITENG_EDITVIEW_HXX
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 1ebdf95b60c5..8bb068e62159 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -578,26 +578,26 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 
 namespace {
 
-class SupressEditViewMessagesGuard
+class SuppressEditViewMessagesGuard
 {
 public:
-SupressEditViewMessagesGuard(EditView& rEditView) :
+SuppressEditViewMessagesGuard(EditView& rEditView) :
 mrEditView(rEditView),
-mbOrigSupressFlag(rEditView.IsSupressLOKMessages())
+mbOrigSuppressFlag(rEditView.IsSuppressLOKMessages())
 {
-if (!mbOrigSupressFlag)
-mrEditView.SupressLOKMessages(true);
+if (!mbOrigSuppressFlag)
+mrEditView.SuppressLOKMessages(true);
 }
 
-~SupressEditViewMessagesGuard()
+

[Libreoffice-commits] core.git: editeng/source reportdesign/source sot/source svl/source svtools/source

2020-08-12 Thread Noel Grandin (via logerrit)
 editeng/source/items/numitem.cxx   |6 --
 reportdesign/source/ui/report/StartMarker.cxx  |6 --
 sot/source/sdstor/storage.cxx  |8 ++--
 svl/source/items/itempool.cxx  |6 --
 svtools/source/brwbox/ebbcontrols.cxx  |2 +-
 svtools/source/config/accessibilityoptions.cxx |3 ++-
 6 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit d4df251320ba266ff3fe3da9e3b991c18ea50f5c
Author: Noel Grandin 
AuthorDate: Wed Aug 12 11:15:51 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 12 22:04:55 2020 +0200

expand out DELETEZ

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

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 91a6cee1f7a2..bc10590f460f 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -726,8 +726,10 @@ SvxNumRule::~SvxNumRule()
 {
 if(!--nRefCount)
 {
-DELETEZ(pStdNumFmt);
-DELETEZ(pStdOutlineNumFmt);
+delete pStdNumFmt;
+pStdNumFmt = nullptr;
+delete pStdOutlineNumFmt;
+pStdOutlineNumFmt = nullptr;
 }
 }
 
diff --git a/reportdesign/source/ui/report/StartMarker.cxx 
b/reportdesign/source/ui/report/StartMarker.cxx
index 2d9eda114000..09a118f41a97 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -85,8 +85,10 @@ void OStartMarker::dispose()
 {
 if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
 {
-DELETEZ(s_pDefCollapsed);
-DELETEZ(s_pDefExpanded);
+delete s_pDefCollapsed;
+s_pDefCollapsed = nullptr;
+delete s_pDefExpanded;
+s_pDefExpanded = nullptr;
 }
 m_aVRuler.disposeAndClear();
 m_aText.disposeAndClear();
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index f15fb22dd9f1..56ffb92dc108 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -306,7 +306,10 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, 
StreamMode nMode )
 // check the stream
 m_pStorStm = ::utl::UcbStreamHelper::CreateStream( m_aName, nMode 
).release();
 if ( m_pStorStm && m_pStorStm->GetError() )
-DELETEZ( m_pStorStm );
+{
+delete m_pStorStm;
+m_pStorStm = nullptr;
+}
 
 if ( m_pStorStm )
 {
@@ -319,7 +322,8 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, 
StreamMode nMode )
 if ( bIsUCBStorage )
 {
 // UCBStorage always works directly on the UCB content, so 
discard the stream first
-DELETEZ( m_pStorStm );
+delete m_pStorStm;
+m_pStorStm = nullptr;
 m_pOwnStg = new UCBStorage( m_aName, nMode, true, 
true/*bIsRoot*/ );
 }
 else
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 82668c909a35..6deec84947c0 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -542,7 +542,8 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem 
&rItem)
 if (rOldDefault)
 {
 rOldDefault->SetRefCount(0);
-DELETEZ(rOldDefault);
+delete rOldDefault;
+rOldDefault = nullptr;
 }
 rOldDefault = pNewDefault;
 }
@@ -567,7 +568,8 @@ void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId 
)
 if (rOldDefault)
 {
 rOldDefault->SetRefCount(0);
-DELETEZ(rOldDefault);
+delete rOldDefault;
+rOldDefault = nullptr;
 }
 }
 else if ( pImpl->mpSecondary )
diff --git a/svtools/source/brwbox/ebbcontrols.cxx 
b/svtools/source/brwbox/ebbcontrols.cxx
index b15927af9e58..1ac4605a3096 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -525,7 +525,7 @@ namespace svt
 EditCellController::~EditCellController( )
 {
 if ( m_bOwnImplementation )
-DELETEZ( m_pEditImplementation );
+delete m_pEditImplementation;
 }
 
 void EditCellController::SaveValue()
diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 43fa4287f9e0..2790296c424d 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -379,7 +379,8 @@ SvtAccessibilityOptions::~SvtAccessibilityOptions()
 {
 //if( sm_pSingleImplConfig->IsModified() )
 //  sm_pSingleImplConfig->Commit();
-DELETEZ( sm_pSingleImplConfig );
+delete sm_pSingleImplConfig;
+sm_pSingleImplConfig = nullptr;
 }
 }
 
___
Libreoffice-c

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

2020-07-16 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/impedit.hxx   |   10 ++
 extensions/source/propctrlr/controltype.hxx  |9 ++---
 filter/source/config/cache/basecontainer.hxx |6 ++
 filter/source/config/cache/cacheitem.hxx |6 ++
 filter/source/config/cache/cacheupdatelistener.hxx   |6 ++
 filter/source/config/cache/configflush.hxx   |6 ++
 filter/source/config/cache/contenthandlerfactory.hxx |6 ++
 filter/source/config/cache/filtercache.hxx   |6 ++
 filter/source/config/cache/filterfactory.hxx |6 ++
 filter/source/config/cache/frameloaderfactory.hxx|6 ++
 filter/source/config/cache/querytokenizer.hxx|6 ++
 include/editeng/forbiddencharacterstable.hxx |7 +--
 include/filter/msfilter/msvbahelper.hxx  |6 ++
 include/filter/msfilter/rtfutil.hxx  |5 +
 include/filter/msfilter/util.hxx |5 ++---
 15 files changed, 28 insertions(+), 68 deletions(-)

New commits:
commit 079ebdc3fd8413d3ab4d254d7576500a9547965f
Author: Noel Grandin 
AuthorDate: Thu Jul 16 18:14:28 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 16 20:31:01 2020 +0200

compact namespace: editeng-filter

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

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index c85e3720dbd9..e1e54664f815 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -71,15 +71,9 @@ class SvxForbiddenCharactersTable;
 class SvtCTLOptions;
 namespace vcl { class Window; }
 class SvxNumberFormat;
-
-
-namespace com {
-namespace sun {
-namespace star {
-namespace datatransfer {
-namespace clipboard {
+namespace com::sun::star::datatransfer::clipboard {
 class XClipboard;
-}
+}
 
 namespace editeng {
 struct MisspellRanges;
diff --git a/extensions/source/propctrlr/controltype.hxx 
b/extensions/source/propctrlr/controltype.hxx
index 721de7b8c024..d3bf9cce0b98 100644
--- a/extensions/source/propctrlr/controltype.hxx
+++ b/extensions/source/propctrlr/controltype.hxx
@@ -22,20 +22,15 @@
 #include 
 
 
-namespace pcr
+namespace pcr::ControlType
 {
-
-namespace ControlType
-{
 const sal_Int16 FIXEDLINE  = sal_Int16(100);
 const sal_Int16 FORMATTEDFIELD = sal_Int16(101);
 const sal_Int16 PROGRESSBAR= sal_Int16(102);
 
 // need only those which are not already covered as FormComponentType
-}
-
 
-} // namespacepcr
+} // namespace pcr::ControlType
 
 
 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_CONTROLTYPE_HXX
diff --git a/filter/source/config/cache/basecontainer.hxx 
b/filter/source/config/cache/basecontainer.hxx
index 8cead06c302d..7ba811ccc060 100644
--- a/filter/source/config/cache/basecontainer.hxx
+++ b/filter/source/config/cache/basecontainer.hxx
@@ -34,8 +34,7 @@
 #include 
 
 
-namespace filter{
-namespace config{
+namespace filter::config {
 
 
 /** @short  implements the interface css::container::XNameContainer
@@ -257,8 +256,7 @@ class BaseContainer : public BaseLock
 virtual void SAL_CALL removeFlushListener(const css::uno::Reference< 
css::util::XFlushListener >& xListener) override;
 };
 
-} // namespace config
-} // namespace filter
+} // namespace filter::config
 
 #endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_BASECONTAINER_HXX
 
diff --git a/filter/source/config/cache/cacheitem.hxx 
b/filter/source/config/cache/cacheitem.hxx
index ed359bdab893..aeaaf3a83afb 100644
--- a/filter/source/config/cache/cacheitem.hxx
+++ b/filter/source/config/cache/cacheitem.hxx
@@ -28,8 +28,7 @@
 #include 
 
 
-namespace filter{
-namespace config{
+namespace filter::config {
 
 
 /** @short  Must be used as first derived base class
@@ -188,8 +187,7 @@ struct FlatDetectionInfo
 
 typedef ::std::vector< FlatDetectionInfo > FlatDetection;
 
-} // namespace config
-} // namespace filter
+} // namespace filter::config
 
 #endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_CACHEITEM_HXX
 
diff --git a/filter/source/config/cache/cacheupdatelistener.hxx 
b/filter/source/config/cache/cacheupdatelistener.hxx
index 2ac4f9f3beb9..714e4016ba51 100644
--- a/filter/source/config/cache/cacheupdatelistener.hxx
+++ b/filter/source/config/cache/cacheupdatelistener.hxx
@@ -24,8 +24,7 @@
 #include 
 
 
-namespace filter{
-namespace config{
+namespace filter::config {
 
 
 /** @short  implements a listener, which will update the
@@ -108,8 +107,7 @@ class CacheUpdateListener : public BaseLock // must be the 
first one to guarante
 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) 
override;
 };
 
-} // namespace config
-} // namespace filter
+} // namespace filter::config
 
 #endif // INCLUDED_FILTER_SOUR

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

2020-07-11 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a26351a17cd79bc7776d868b1d0eb14b6c6647d6
Author: Caolán McNamara 
AuthorDate: Sat Jul 11 19:41:07 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jul 11 22:09:26 2020 +0200

cid#1465259 silence Arguments in wrong order

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

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 07901c0bd8e9..ad32674b4140 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -147,6 +147,7 @@ tools::Rectangle LOKSpecialPositioning::GetWindowPos(const 
tools::Rectangle& rDo
 else
 {
 Point aNewPos(aPos.X() - aSz.Height(), aPos.Y());
+// coverity[swapped_arguments : FALSE] - this is in the correct order
 aRect = tools::Rectangle(aNewPos, Size(aSz.Height(), aSz.Width()));
 }
 return aRect;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-10 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/impedit.cxx |   52 +++--
 editeng/source/editeng/impedit.hxx |2 +
 2 files changed, 46 insertions(+), 8 deletions(-)

New commits:
commit 2927f36b3e3cf86228547937cc4c5c8874bc1f85
Author: Dennis Francis 
AuthorDate: Sat Jun 6 19:49:07 2020 +0530
Commit: Dennis Francis 
CommitDate: Fri Jul 10 09:54:14 2020 +0200

lokit: editeng: Use 'special-positioning' data for selections

For Calc, this means the LOK clients get selection rectangle coordinates
in print-twips when special positioning is enabled.

Change-Id: Ib26341f888cedcde2e2755ea57be0623884bb097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98132
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index e235d4eb74a4..07901c0bd8e9 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -168,6 +168,10 @@ tools::Rectangle LOKSpecialPositioning::convertUnit(const 
tools::Rectangle& rRec
 return OutputDevice::LogicToLogic(rRect, MapMode(eRectUnit), 
MapMode(meUnit));
 }
 
+Point LOKSpecialPositioning::GetRefPoint() const
+{
+return maOutArea.TopLeft();
+}
 
 //  class ImpEditView
 
@@ -548,7 +552,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 }
 }
 
-bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM;
+bool bMm100ToTwip = !mpLOKSpecialPositioning &&
+(pOutWin->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM);
 
 Point aOrigin;
 if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
@@ -556,6 +561,9 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 aOrigin = pOutWin->GetMapMode().GetOrigin();
 
 OString sRectangle;
+OString sRefPoint;
+if (mpLOKSpecialPositioning)
+sRefPoint = mpLOKSpecialPositioning->GetRefPoint().toString();
 // If we are not in selection mode, then the exported own 
selection should be empty.
 // This is needed always in Online, regardless whether in 
"selection mode" (whatever
 // that is) or not, for tdf#125568, but I don't have the clout to 
make this completely
@@ -564,6 +572,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 {
 std::vector aRectangles;
 pRegion->GetRegionRectangles(aRectangles);
+
 if (pOutWin->IsChart())
 {
 const vcl::Window* pViewShellWindow = 
mpViewShell->GetEditWindowForActiveOLEObj();
@@ -584,7 +593,11 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 aStart = OutputDevice::LogicToLogic(aStart, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
 aStart.Move(aOrigin.getX(), aOrigin.getY());
 
-
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, 
aStart.toString().getStr());
+OString aPayload = aStart.toString();
+if (mpLOKSpecialPositioning)
+aPayload += ":: " + sRefPoint;
+
+
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, 
aPayload.getStr());
 
 tools::Rectangle& rEnd = aRectangles.back();
 tools::Rectangle aEnd(rEnd.Right() - 1, rEnd.Top(), 
rEnd.Right(), rEnd.Bottom());
@@ -592,7 +605,11 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 aEnd = OutputDevice::LogicToLogic(aEnd, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
 aEnd.Move(aOrigin.getX(), aOrigin.getY());
 
-
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, 
aEnd.toString().getStr());
+aPayload = aEnd.toString();
+if (mpLOKSpecialPositioning)
+aPayload += ":: " + sRefPoint;
+
+
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, 
aPayload.getStr());
 }
 
 std::vector v;
@@ -606,6 +623,9 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 sRectangle = comphelper::string::join("; ", v);
 }
 
+if (mpLOKSpecialPositioning && !sRectangle.isEmpty())
+sRectangle += ":: " + sRefPoint;
+
 if (mpOtherShell)
 {
 // Another shell wants to know about our existing selection.
@@ -647,6 +667,23 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* 
_pTarget, const Point& rD
 if ( rDocPosTopLeft.X() == rDocPosBotto

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

2020-07-09 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/impedit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a57c2b6478dfb9d5ffd3245aeafdd747afb69da
Author: Dennis Francis 
AuthorDate: Fri Jun 5 18:10:12 2020 +0530
Commit: Dennis Francis 
CommitDate: Thu Jul 9 11:28:55 2020 +0200

scPrintTwipsMsgs: Use top-left of output-area as the refpoint

We can't use the transformed version of editeng origin, since it need
not be in client view area depending on text alignment, which is
unusable as far as the clients are concerned.  Top-left corner of
output-area is always guaranteed to be in client view area independent
of text-alignment settings.

Change-Id: I5bd20d2b52e146371de4b605bf7934b7e7d6fc5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98131
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 43165fefc1a0..e235d4eb74a4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1277,7 +1277,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 // Get rectangle in window-coordinates from editeng(doc) 
coordinates.
 aCursorRectPureLogical = 
mpLOKSpecialPositioning->GetWindowPos(aCursorRectPureLogical, eDevUnit);
 // Lets use the editeng(doc) origin as the refpoint.
-const Point aCursorOrigin = 
mpLOKSpecialPositioning->GetWindowPos(Point(0, 0), eDevUnit);
+const Point aCursorOrigin = 
mpLOKSpecialPositioning->GetOutputArea().TopLeft();
 // Get the relative coordinates w.r.t aCursorOrigin.
 aCursorRectPureLogical.Move(-aCursorOrigin.X(), 
-aCursorOrigin.Y());
 aMessageParams.put("relrect", 
aCursorRectPureLogical.toString());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-09 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/editview.cxx |   10 +
 editeng/source/editeng/impedit.cxx  |5 ++--
 editeng/source/editeng/impedit.hxx  |6 -
 include/editeng/editview.hxx|3 ++
 sc/source/ui/view/gridwin4.cxx  |   37 
 5 files changed, 58 insertions(+), 3 deletions(-)

New commits:
commit d45b6561ef5a229669b50c65f15c42d47e034434
Author: Dennis Francis 
AuthorDate: Wed Jun 3 17:27:28 2020 +0530
Commit: Dennis Francis 
CommitDate: Thu Jul 9 11:26:42 2020 +0200

lokit: Avoid sending wrong edit-cursor/selection messages when...

the EditView's output-area needs to be tweaked temporarily to render it
to a tile which is meant for another view.

Change-Id: I2b8fc1986c247ce65c18ea64e3b43d25625c7e9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98129
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 4a8b6873946d..9da4d6cbf8d5 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1602,4 +1602,14 @@ bool EditView::HasLOKSpecialPositioning() const
 return pImpEditView->HasLOKSpecialPositioning();
 }
 
+void EditView::SupressLOKMessages(bool bSet)
+{
+pImpEditView->SupressLOKMessages(bSet);
+}
+
+bool EditView::IsSupressLOKMessages() const
+{
+return pImpEditView->IsSupressLOKMessages();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index efc1dee49b63..43165fefc1a0 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -190,7 +190,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* 
pEng, vcl::Window* pWindo
 eSelectionMode(EESelectionMode::Std),
 eAnchorMode(EEAnchorMode::TopLeft),
 mpEditViewCallbacks(nullptr),
-mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive())
+mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive()),
+mbSupressLOKMessages(false)
 {
 aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM();
 aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM();
@@ -1259,7 +1260,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 
 GetCursor()->SetSize( aCursorSz );
 
-if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
+if (comphelper::LibreOfficeKit::isActive() && mpViewShell && 
!mbSupressLOKMessages)
 {
 Point aPos = GetCursor()->GetPos();
 boost::property_tree::ptree aMessageParams;
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 0e2b6df1d790..18e1ea9f9308 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -302,7 +302,8 @@ private:
 // repaints of the EditView(s)
 const EditViewCallbacks* mpEditViewCallbacks;
 std::unique_ptr mpLOKSpecialPositioning;
-bool mbBroadcastLOKViewCursor;
+bool mbBroadcastLOKViewCursor:1;
+bool mbSupressLOKMessages:1;
 
 const EditViewCallbacks* getEditViewCallbacks() const
 {
@@ -462,6 +463,9 @@ public:
 void SetLOKSpecialVisArea(const tools::Rectangle& rVisArea);
 tools::Rectangle GetLOKSpecialVisArea() const;
 bool HasLOKSpecialPositioning() const;
+
+void SupressLOKMessages(bool bSet) { mbSupressLOKMessages = bSet; }
+bool IsSupressLOKMessages() const { return mbSupressLOKMessages; }
 };
 
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index ccecb8c9da73..5b7f08228cff 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -335,6 +335,9 @@ public:
 void SetLOKSpecialVisArea(const tools::Rectangle& rVisArea);
 tools::Rectangle GetLOKSpecialVisArea() const;
 bool HasLOKSpecialPositioning() const;
+
+void SupressLOKMessages(bool bSet);
+bool IsSupressLOKMessages() const;
 };
 
 #endif // INCLUDED_EDITENG_EDITVIEW_HXX
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 17f9b16a8ec9..eb76b69dd590 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -571,6 +571,32 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCROW nY2, ScUpdateMod
 rDoc.PrepareFormulaCalc();
 }
 
+namespace {
+
+class SupressEditViewMessagesGuard
+{
+public:
+SupressEditViewMessagesGuard(EditView& rEditView) :
+mrEditView(rEditView),
+mbOrigSupressFlag(rEditView.IsSupressLOKMessages())
+{
+if (!mbOrigSupressFlag)
+mrEditView.SupressLOKMessages(true);
+}
+
+~SupressEditViewMessagesGuard()
+{
+if (mrEditView.IsSupressLOKMessages() != mbOrigSupressFlag)
+mrEditView.SupressLOKMessages(mbOrigSupressFlag);
+}
+
+private:
+EditView& mrEditView;
+const bool mbOrigSupressFlag;
+};
+
+}
+
 void ScGridWindow::DrawContent(O

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

2020-07-08 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/editeng.cxx |   10 ++
 editeng/source/editeng/impedit.hxx |4 
 include/editeng/editeng.hxx|3 +++
 sc/source/ui/view/viewdata.cxx |   10 +-
 4 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 6907817b83e37d40be491cc10b2e5b99cc0f48fc
Author: Dennis Francis 
AuthorDate: Wed Jun 3 21:33:24 2020 +0530
Commit: Dennis Francis 
CommitDate: Wed Jul 8 18:08:25 2020 +0200

scPrintTwipsMsgs: Use print-twips paper-size

Paper size for the EditEngine is calculated based on per-cell pixel
alignment. So lets use the exact print-twips version whenever we need it
to compute/adjust output-area and visible-area of EditView.

Change-Id: I7da6db9363d09965315ff5ca9d01f0fea141a533
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98130
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 73d85a07b7ce..99b6f1e04a99 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2818,6 +2818,16 @@ void EditEngine::DisableAttributeExpanding() {
 pImpEditEngine->GetEditDoc().DisableAttributeExpanding();
 }
 
+void EditEngine::SetLOKSpecialPaperSize(const Size& rSize)
+{
+pImpEditEngine->SetLOKSpecialPaperSize(rSize);
+}
+
+const Size& EditEngine::GetLOKSpecialPaperSize() const
+{
+return pImpEditEngine->GetLOKSpecialPaperSize();
+}
+
 EFieldInfo::EFieldInfo()
 {
 }
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 5f67ecd9b22a..0e2b6df1d790 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -562,6 +562,8 @@ private:
 // If it is detected at one point that the StatusHdl has to be called, but
 // this should not happen immediately (critical section):
 Timer   aStatusTimer;
+SizeaLOKSpecialPaperSize;
+
 Link aStatusHdlLink;
 Link   aNotifyHdl;
 Link aHtmlImportHdl;
@@ -1109,6 +,8 @@ public:
 boolIsNbspRunNext() const { return mbNbspRunNext; }
 
 void Dispose();
+void SetLOKSpecialPaperSize(const Size& rSize) { aLOKSpecialPaperSize = 
rSize; }
+const Size& GetLOKSpecialPaperSize() const { return aLOKSpecialPaperSize; }
 };
 
 inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM )
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 292b620a9b95..e183cf81be5a 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -628,6 +628,9 @@ public:
 // the same type expands the original instead of inserting another. But the
 // spell check dialog doesn't want that behaviour
 void DisableAttributeExpanding();
+
+void SetLOKSpecialPaperSize(const Size& rSize);
+const Size& GetLOKSpecialPaperSize() const;
 };
 
 #endif // INCLUDED_EDITENG_EDITENG_HXX
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 3469399f40b4..58ee76e99a1f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1652,7 +1652,10 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
 aPaperSizePTwips.setWidth(OutputDevice::LogicToLogic(
 aUtilRect.GetWidth(), MapUnit::Map100thMM, 
MapUnit::MapTwip));
 }
+
 pNewEngine->SetPaperSize( aPaperSize );
+if (bLOKPrintTwips)
+pNewEngine->SetLOKSpecialPaperSize(aPaperSizePTwips);
 
 // sichtbarer Ausschnitt
 Size aPaper = pNewEngine->GetPaperSize();
@@ -1781,12 +1784,10 @@ void ScViewData::EditGrowX()
 SCCOL nLeft = GetPosX(eHWhich);
 SCCOL nRight = nLeft + VisibleCellsX(eHWhich);
 
-MapUnit eWinUnit = GetLogicMode(eWhich).GetMapUnit();
 SizeaSize = pEngine->GetPaperSize();
 Size aSizePTwips;
-
 if (bLOKPrintTwips)
-aSizePTwips = OutputDevice::LogicToLogic(aSize, MapMode(eWinUnit), 
MapMode(MapUnit::MapTwip));
+aSizePTwips = pEngine->GetLOKSpecialPaperSize();
 
 tools::Rectangle   aArea = pCurView->GetOutputArea();
 tools::Rectangle aAreaPTwips;
@@ -2074,7 +2075,6 @@ void ScViewData::EditGrowY( bool bInitial )
 
 EditEngine* pEngine = pCurView->GetEditEngine();
 vcl::Window* pWin = pCurView->GetWindow();
-MapUnit eWinUnit = GetLogicMode(eWhich).GetMapUnit();
 
 SCROW nBottom = GetPosY(eVWhich) + VisibleCellsY(eVWhich);
 
@@ -2085,7 +2085,7 @@ void ScViewData::EditGrowY( bool bInitial )
 
 if (bLOKPrintTwips)
 {
-aSizePTwips = OutputDevice::LogicToLogic(aSize, MapMode(eWinUnit), 
MapMode(MapUnit::MapTwip));
+aSizePTwips = pEngine->GetLOKSpecialPaperSize();
 aAreaPTwips = pCurView->GetLOKSpecialOutputArea();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/l

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

2020-07-07 Thread Julien Nabet (via logerrit)
 editeng/source/misc/svxacorr.cxx |2 +-
 odk/examples/DevelopersGuide/Text/TextDocuments.java |2 +-
 sw/inc/shellio.hxx   |2 +-
 sw/source/core/unocore/unoobj.cxx|2 +-
 sw/source/filter/ascii/ascatr.cxx|2 +-
 sw/source/filter/writer/writer.cxx   |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e596785580cbc7e8f4055ae495de48e6ecd0c022
Author: Julien Nabet 
AuthorDate: Tue Jul 7 13:01:40 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Jul 7 17:10:03 2020 +0200

Typo: pargraph->paragraph

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 9fc509483fa0..b51d34e6173d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1722,7 +1722,7 @@ OUString 
SvxAutoCorrect::GetPrevAutoCorrWord(SvxAutoCorrDoc const& rDoc, const O
 // auto.
 sal_Int32 nCapLttrPos = nPos+1;// on the 1st Character
 if( !nPos && !IsWordDelim( rTxt[ 0 ]))
---nCapLttrPos;  // Beginning of pargraph and no Blank!
+--nCapLttrPos;  // Beginning of paragraph and no Blank!
 
 while( lcl_IsInAsciiArr( sImplSttSkipChars, rTxt[ nCapLttrPos ]) )
 if( ++nCapLttrPos >= nEnd )
diff --git a/odk/examples/DevelopersGuide/Text/TextDocuments.java 
b/odk/examples/DevelopersGuide/Text/TextDocuments.java
index 20e9f7a58e72..1a1a82762612 100644
--- a/odk/examples/DevelopersGuide/Text/TextDocuments.java
+++ b/odk/examples/DevelopersGuide/Text/TextDocuments.java
@@ -1591,7 +1591,7 @@ public class TextDocuments {
 // Insert a new paragraph
 mxDocText.insertControlCharacter (
 mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-// And select the new pargraph
+// And select the new paragraph
 xParaCursor.gotoPreviousParagraph ( true );
 
 // Create a new Text Section and access its XNamed interface
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 8d1b4776c828..dd6183444fe8 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -417,7 +417,7 @@ public:
 bool m_bASCII_ParaAsBlank : 1;
 bool m_bASCII_NoLastLineEnd : 1;
 bool m_bUCS2_WithStartChar : 1;
-bool m_bExportPargraphNumbering : 1;
+bool m_bExportParagraphNumbering : 1;
 
 bool m_bBlock : 1;
 bool m_bOrganizerMode : 1;
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 5b6a296c6065..236481cb03b2 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -144,7 +144,7 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, 
OUString & rBuffer,
 
 SwWriter aWriter( aStream, rPam );
 xWrt->m_bASCII_NoLastLineEnd = true;
-xWrt->m_bExportPargraphNumbering = false;
+xWrt->m_bExportParagraphNumbering = false;
 SwAsciiOptions aOpt = xWrt->GetAsciiOptions();
 aOpt.SetCharSet( RTL_TEXTENCODING_UNICODE );
 xWrt->SetAsciiOptions( aOpt );
diff --git a/sw/source/filter/ascii/ascatr.cxx 
b/sw/source/filter/ascii/ascatr.cxx
index 3445d7fcdff7..ec8129eab961 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -264,7 +264,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, 
SwContentNode& rNode )
 }
 
 const SwNumRule* pNumRule = rNd.GetNumRule();
-if (pNumRule && !nStrPos && rWrt.m_bExportPargraphNumbering && 
!bIsOneParagraph)
+if (pNumRule && !nStrPos && rWrt.m_bExportParagraphNumbering && 
!bIsOneParagraph)
 {
 bool bIsOutlineNumRule = pNumRule == rNd.GetDoc()->GetOutlineNumRule();
 
diff --git a/sw/source/filter/writer/writer.cxx 
b/sw/source/filter/writer/writer.cxx
index 5be2118a284b..743ce8bd1ebb 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -123,7 +123,7 @@ Writer::Writer()
 m_bASCII_NoLastLineEnd = m_bASCII_ParaAsBlank = m_bASCII_ParaAsCR =
 m_bWriteClipboardDoc = m_bWriteOnlyFirstTable = m_bBlock =
 m_bOrganizerMode = false;
-m_bExportPargraphNumbering = true;
+m_bExportParagraphNumbering = true;
 }
 
 Writer::~Writer()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-06 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/impedit.cxx |   63 -
 1 file changed, 49 insertions(+), 14 deletions(-)

New commits:
commit 9a28558a222db9b066283ff78e71d1e5910f2569
Author: Dennis Francis 
AuthorDate: Tue Jun 2 13:47:12 2020 +0530
Commit: Dennis Francis 
CommitDate: Tue Jul 7 08:43:11 2020 +0200

lokit: editeng: Use 'special-positioning' data...

for computing edit-cursor messages if available. For Calc, this means
the LOK clients get edit-cursor coordinates in print-twips.

Change-Id: Ib11f3653e626ba8db7ddbc9bc2b4e071de7b705e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98121
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 8da3740ba6cf..efc1dee49b63 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1017,16 +1018,13 @@ void ImpEditView::CalcAnchorPoint()
 namespace
 {
 
-// Build JSON message to be sent to Online
-OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink)
+// For building JSON message to be sent to Online
+boost::property_tree::ptree getHyperlinkPropTree(const OUString& sText, const 
OUString& sLink)
 {
 boost::property_tree::ptree aTree;
 aTree.put("text", sText);
 aTree.put("link", sLink);
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree, false);
-
-return OString(aStream.str().c_str()).trim();
+return aTree;
 }
 
 } // End of anon namespace
@@ -1264,6 +1262,27 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
 {
 Point aPos = GetCursor()->GetPos();
+boost::property_tree::ptree aMessageParams;
+if (mpLOKSpecialPositioning)
+{
+// Sending the absolute (pure) logical coordinates of the 
cursor to the client is not
+// enough for it to accurately reconstruct the corresponding 
tile-twips coordinates of the cursor.
+// This is because the editeng(doc) positioning is not pixel 
aligned for each cell involved in the output-area
+// (it better not be!). A simple solution is to send the 
coordinates of a point ('refpoint') in the output-area
+// along with the relative position of the cursor w.r.t this 
chosen 'refpoint'.
+
+MapUnit eDevUnit = rOutDev.GetMapMode().GetMapUnit();
+tools::Rectangle aCursorRectPureLogical(aEditCursor.TopLeft(), 
GetCursor()->GetSize());
+// Get rectangle in window-coordinates from editeng(doc) 
coordinates.
+aCursorRectPureLogical = 
mpLOKSpecialPositioning->GetWindowPos(aCursorRectPureLogical, eDevUnit);
+// Lets use the editeng(doc) origin as the refpoint.
+const Point aCursorOrigin = 
mpLOKSpecialPositioning->GetWindowPos(Point(0, 0), eDevUnit);
+// Get the relative coordinates w.r.t aCursorOrigin.
+aCursorRectPureLogical.Move(-aCursorOrigin.X(), 
-aCursorOrigin.Y());
+aMessageParams.put("relrect", 
aCursorRectPureLogical.toString());
+aMessageParams.put("refpoint", aCursorOrigin.toString());
+}
+
 if (pOutWin && pOutWin->IsChart())
 {
 const vcl::Window* pViewShellWindow = 
mpViewShell->GetEditWindowForActiveOLEObj();
@@ -1291,11 +1310,17 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 aRect.setWidth(0);
 
 OString sRect = aRect.toString();
-if (mpOtherShell)
+aMessageParams.put("rectangle", sRect);
+
+SfxViewShell* pThisShell = 
dynamic_cast(mpViewShell);
+SfxViewShell* pOtherShell = 
dynamic_cast(mpOtherShell);
+assert(pThisShell);
+
+if (pOtherShell && pThisShell != pOtherShell)
 {
 // Another shell wants to know about our existing cursor.
-if (mpViewShell != mpOtherShell)
-mpViewShell->NotifyOtherView(mpOtherShell, 
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+SfxLokHelper::notifyOtherView(pThisShell, pOtherShell,
+LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, aMessageParams);
 }
 else
 {
@@ -1303,12 +1328,12 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pEditEngine->pImpEditEngine->GetSpeller() );
 bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, 
/*bMarkIfWrong*/ false);
 
-OString sHyperlink;
+boost::property_tree::ptree aHyperlinkTree;
   

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

2020-07-06 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/editview.cxx |   32 +++
 editeng/source/editeng/impedit.cxx  |  146 
 editeng/source/editeng/impedit.hxx  |   48 +++
 include/editeng/editview.hxx|   16 +++
 4 files changed, 242 insertions(+)

New commits:
commit 6d8adb11ea91ca65f6f0e57e1365b326616c34f8
Author: Dennis Francis 
AuthorDate: Tue Jun 2 12:12:39 2020 +0530
Commit: Dennis Francis 
CommitDate: Tue Jul 7 07:47:26 2020 +0200

Introduce LOK 'special positioning' methods to EditView

This is meant for Calc. In Calc, all positions in twips are computed by
doing independent pixel-alignment for each cell's size. To allow
print-twips coordinates in LOK messages specific to EditView, this patch
introduces new methods to set/update both 'output-area' and
'visible-doc-position' in print twips coordinates, which are stored
separately.

Change-Id: Id165966c970fa26c79d583f435dccd62c7eb1f0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98120
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 3ea3ac45f5c1..4a8b6873946d 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1570,4 +1570,36 @@ void EditView::DrawSelectionXOR(OutlinerViewShell* 
pOtherShell)
 pImpEditView->RegisterOtherShell(nullptr);
 }
 
+void EditView::InitLOKSpecialPositioning(MapUnit eUnit,
+ const tools::Rectangle& rOutputArea,
+ const Point& rVisDocStartPos)
+{
+pImpEditView->InitLOKSpecialPositioning(eUnit, rOutputArea, 
rVisDocStartPos);
+}
+
+void EditView::SetLOKSpecialOutputArea(const tools::Rectangle& rOutputArea)
+{
+pImpEditView->SetLOKSpecialOutputArea(rOutputArea);
+}
+
+tools::Rectangle EditView::GetLOKSpecialOutputArea() const
+{
+return pImpEditView->GetLOKSpecialOutputArea();
+}
+
+void EditView::SetLOKSpecialVisArea(const tools::Rectangle& rVisArea)
+{
+pImpEditView->SetLOKSpecialVisArea(rVisArea);
+}
+
+tools::Rectangle EditView::GetLOKSpecialVisArea() const
+{
+return pImpEditView->GetLOKSpecialVisArea();
+}
+
+bool EditView::HasLOKSpecialPositioning() const
+{
+return pImpEditView->HasLOKSpecialPositioning();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 6aa35ce94eee..8da3740ba6cf 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -60,6 +60,113 @@ static void lcl_AllignToPixel( Point& rPoint, OutputDevice 
const * pOutDev, shor
 rPoint = pOutDev->PixelToLogic( rPoint );
 }
 
+LOKSpecialPositioning::LOKSpecialPositioning(const ImpEditView& rImpEditView, 
MapUnit eUnit,
+ const tools::Rectangle& 
rOutputArea,
+ const Point& rVisDocStartPos) :
+ mrImpEditView(rImpEditView),
+ maOutArea(rOutputArea),
+ maVisDocStartPos(rVisDocStartPos),
+ meUnit(eUnit)
+{
+}
+
+void LOKSpecialPositioning::ReInit(MapUnit eUnit, const tools::Rectangle& 
rOutputArea, const Point& rVisDocStartPos)
+{
+meUnit = eUnit;
+maOutArea = rOutputArea;
+maVisDocStartPos = rVisDocStartPos;
+}
+
+void LOKSpecialPositioning::SetOutputArea(const tools::Rectangle& rOutputArea)
+{
+maOutArea = rOutputArea;
+}
+
+const tools::Rectangle& LOKSpecialPositioning::GetOutputArea() const
+{
+return maOutArea;
+}
+
+void LOKSpecialPositioning::SetVisDocStartPos(const Point& rVisDocStartPos)
+{
+maVisDocStartPos = rVisDocStartPos;
+}
+
+tools::Rectangle LOKSpecialPositioning::GetVisDocArea() const
+{
+return tools::Rectangle(GetVisDocLeft(), GetVisDocTop(), GetVisDocRight(), 
GetVisDocBottom());
+}
+
+bool LOKSpecialPositioning::IsVertical() const
+{
+return mrImpEditView.IsVertical();
+}
+
+bool LOKSpecialPositioning::IsTopToBottom() const
+{
+return mrImpEditView.IsTopToBottom();
+}
+
+Point LOKSpecialPositioning::GetWindowPos(const Point& rDocPos, MapUnit 
eDocPosUnit) const
+{
+const Point aDocPos = convertUnit(rDocPos, eDocPosUnit);
+Point aPoint;
+if ( !IsVertical() )
+{
+aPoint.setX(aDocPos.X() + maOutArea.Left() - GetVisDocLeft());
+aPoint.setY(aDocPos.Y() + maOutArea.Top() - GetVisDocTop());
+}
+else
+{
+if (IsTopToBottom())
+{
+aPoint.setX(maOutArea.Right() - aDocPos.Y() + GetVisDocTop());
+aPoint.setY(aDocPos.X() + maOutArea.Top() - GetVisDocLeft());
+}
+else
+{
+aPoint.setX(maOutArea.Left() + aDocPos.Y() - GetVisDocTop());
+aPoint.setY(maOutArea.Bottom() - aDocP

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

2020-07-05 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx |   39 +++
 sw/qa/extras/uiwriter/data/tdf133524_ro.fodt |   14 +++
 sw/qa/extras/uiwriter/uiwriter.cxx   |   54 ---
 3 files changed, 85 insertions(+), 22 deletions(-)

New commits:
commit 99d4bf9446c392c3cf2877219c78917ca4d5dd87
Author: László Németh 
AuthorDate: Sat Jul 4 16:37:33 2020 +0200
Commit: László Németh 
CommitDate: Sun Jul 5 10:10:43 2020 +0200

tdf#133524 AutoCorrect: fix Romanian nested quotations

typing " inside primary quotation marks: use
the correct order of the double angle quotes:

„... «quote» ...”

Add also Aragonese, Asturian and Catalan to the
"<<" and ">>" replacement.

See commit 57f07b1d7378d218648667c5b1315cc8ad905875
(tdf#133524 AutoCorrect: support double angle quotes).

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 8b47ece89fae..9fc509483fa0 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -318,8 +318,10 @@ constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039;
 constexpr sal_Unicode cRightSingleAngleQuote = 0x203A;
 // stop characters for searching preceding quotes
 // (the first character is also the opening quote we are looking for)
-const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
+const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0x201C, 0 
}; // preceding ,,
 const sal_Unicode aStopDoubleAngleQuoteEnd[] = { cRightDoubleAngleQuote, 
cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }; // preceding >>
+// preceding << for Romanian, handle also alternative primary closing 
quotation mark U+201C
+const sal_Unicode aStopDoubleAngleQuoteEndRo[] = { cLeftDoubleAngleQuote, 
cRightDoubleAngleQuote, 0x201D, 0x201E, 0x201C, 0 };
 const sal_Unicode aStopSingleQuoteEnd[] = { 0x201A, 0x2018, 0x201C, 0x201E, 0 
};
 const sal_Unicode aStopSingleQuoteEndRuUa[] = { 0x201E, 0x201C, 
cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0 };
 
@@ -1212,7 +1214,12 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 if ( eType == ACQuotes::DoubleAngleQuote )
 {
 bool bSwiss = eLang == LANGUAGE_FRENCH_SWISS;
-cRet = ( '<' == cInsChar || ('\"' == cInsChar && !bSttQuote) )
+// pressing " inside a quotation -> use second level angle quotes
+bool bLeftQuote = '\"' == cInsChar &&
+// start position and Romanian OR
+// not start position and Hungarian
+bSttQuote == (eLang != LANGUAGE_HUNGARIAN);
+cRet = ( '<' == cInsChar || bLeftQuote )
 ? ( bSwiss ? cLeftSingleAngleQuote : cLeftDoubleAngleQuote )
 : ( bSwiss ? cRightSingleAngleQuote : cRightDoubleAngleQuote );
 }
@@ -1347,13 +1354,23 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& 
rDoc, const OUString& rTxt,
 {
 eType = ACQuotes::CapitalizeIAm;
 }
-// tdf#133524 support << and >> in Hungarian and Romanian
-else if ( !bSingle && nInsPos && eLang.anyOf( 
LANGUAGE_HUNGARIAN, LANGUAGE_ROMANIAN ) &&
-lcl_HasPrecedingChar( rTxt, nInsPos,
+// tdf#133524 support >>Hungarian<< and <> 
secondary level quotations
+else if ( !bSingle && nInsPos &&
+( ( eLang == LANGUAGE_HUNGARIAN &&
+lcl_HasPrecedingChar( rTxt, nInsPos,
 bSttQuote ? aStopDoubleAngleQuoteStart[0] : 
aStopDoubleAngleQuoteEnd[0],
-bSttQuote ? aStopDoubleAngleQuoteStart + 1 : 
aStopDoubleAngleQuoteEnd + 1 ) )
+bSttQuote ? aStopDoubleAngleQuoteStart + 1 : 
aStopDoubleAngleQuoteEnd + 1 ) ) ||
+  ( eLang.anyOf(
+LANGUAGE_ROMANIAN,
+LANGUAGE_ROMANIAN_MOLDOVA ) &&
+lcl_HasPrecedingChar( rTxt, nInsPos,
+bSttQuote ? aStopDoubleAngleQuoteStart[0] : 
aStopDoubleAngleQuoteEndRo[0],
+bSttQuote ? aStopDoubleAngleQuoteStart + 1 : 
aStopDoubleAngleQuoteEndRo + 1 ) ) ) )
 {
-eType = ACQuotes::DoubleAngleQuote;
+LocaleDataWrapper& rLcl = GetLocaleDataWrapper( eLang 
);
+// only if the opening double quotation mark is the 
default one
+if ( rLcl.getDoubleQuotationMarkStart() == 
OUStringChar(aStopDoubleAngleQuoteStart[0]) )
+eType = ACQuotes::DoubleAngleQuote;

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

2020-07-03 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/editdoc.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 516dc02998fd59035fb54f2c78b7891ac7c7578a
Author: Noel Grandin 
AuthorDate: Fri Jul 3 10:49:26 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 3 14:53:23 2020 +0200

avoid some sorting

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

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index fbcb4c51ed41..0d5213355c5c 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2420,6 +2420,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, 
sal_Int32 nStart, sal_Int32 nEn
 rpStarting = nullptr;
 
 bool bChanged = false;
+bool bNeedsSorting = false;
 
 DBG_ASSERT( nStart <= nEnd, "Small miscalculations in 
InsertAttribInSelection" );
 
@@ -2443,6 +2444,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, 
sal_Int32 nStart, sal_Int32 nEn
 bChanged = true;
 if ( pAttr->GetEnd() > nEnd )
 {
+bNeedsSorting = true;
 pAttr->GetStart() = nEnd;   // then it starts after this
 rpStarting = pAttr;
 if ( nWhich )
@@ -2476,6 +2478,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, 
sal_Int32 nStart, sal_Int32 nEn
 bChanged = true;
 if ( pAttr->GetStart() == nStart )
 {
+bNeedsSorting = true;
 pAttr->GetStart() = nEnd;
 rpStarting = pAttr;
 if ( nWhich )
@@ -2490,6 +2493,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, 
sal_Int32 nStart, sal_Int32 nEn
 }
 else // Attribute must be split ...
 {
+bNeedsSorting = true;
 sal_Int32 nOldEnd = pAttr->GetEnd();
 pAttr->GetEnd() = nStart;
 rpEnding = pAttr;
@@ -2514,7 +2518,8 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, 
sal_Int32 nStart, sal_Int32 nEn
 if ( bChanged )
 {
 // char attributes need to be sorted by start again
-pNode->GetCharAttribs().ResortAttribs();
+if (bNeedsSorting)
+pNode->GetCharAttribs().ResortAttribs();
 SetModified(true);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-30 Thread Stephan Bergmann (via logerrit)
 editeng/source/editeng/eertfpar.cxx |2 +-
 editeng/source/items/borderline.cxx |   20 ++--
 editeng/source/misc/svxacorr.cxx|   24 
 editeng/source/uno/unotext.cxx  |2 +-
 include/editeng/itemtype.hxx|2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 6e6772e7739aaee09d0463ddf1be3b0c4039e1c5
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 07:12:44 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 1 08:37:14 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: editeng

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

diff --git a/editeng/source/editeng/eertfpar.cxx 
b/editeng/source/editeng/eertfpar.cxx
index dd5043dd5af2..ea286d4a59ce 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -59,7 +59,7 @@ RtfImportInfo::~RtfImportInfo()
 {
 }
 
-static constexpr MapUnit gRTFMapUnit = MapUnit::MapTwip;
+constexpr MapUnit gRTFMapUnit = MapUnit::MapTwip;
 
 EditRTFParser::EditRTFParser(
 SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool, EditEngine* 
pEditEngine) :
diff --git a/editeng/source/items/borderline.cxx 
b/editeng/source/items/borderline.cxx
index 3be1c2d46869..1239503fe560 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -171,16 +171,16 @@ ConvertBorderStyleFromWord(int const nWordLineStyle)
 }
 }
 
-static const double THINTHICK_SMALLGAP_line2 = 15.0;
-static const double THINTHICK_SMALLGAP_gap   = 15.0;
-static const double THINTHICK_LARGEGAP_line1 = 30.0;
-static const double THINTHICK_LARGEGAP_line2 = 15.0;
-static const double THICKTHIN_SMALLGAP_line1 = 15.0;
-static const double THICKTHIN_SMALLGAP_gap   = 15.0;
-static const double THICKTHIN_LARGEGAP_line1 = 15.0;
-static const double THICKTHIN_LARGEGAP_line2 = 30.0;
-static const double OUTSET_line1 = 15.0;
-static const double INSET_line2  = 15.0;
+const double THINTHICK_SMALLGAP_line2 = 15.0;
+const double THINTHICK_SMALLGAP_gap   = 15.0;
+const double THINTHICK_LARGEGAP_line1 = 30.0;
+const double THINTHICK_LARGEGAP_line2 = 15.0;
+const double THICKTHIN_SMALLGAP_line1 = 15.0;
+const double THICKTHIN_SMALLGAP_gap   = 15.0;
+const double THICKTHIN_LARGEGAP_line1 = 15.0;
+const double THICKTHIN_LARGEGAP_line2 = 30.0;
+const double OUTSET_line1 = 15.0;
+const double INSET_line2  = 15.0;
 
 double
 ConvertBorderWidthFromWord(SvxBorderLineStyle const eStyle, double const 
i_fWidth,
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index efab7967deb7..8b47ece89fae 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -93,13 +93,13 @@ enum class Flags {
 namespace o3tl {
 template<> struct typed_flags : is_typed_flags {};
 }
-static const sal_Unicode cNonBreakingSpace = 0xA0; // UNICODE code for no 
break space
+const sal_Unicode cNonBreakingSpace = 0xA0; // UNICODE code for no break space
 
-static const char pXMLImplWrdStt_ExcptLstStr[] = "WordExceptList.xml";
-static const char pXMLImplCplStt_ExcptLstStr[] = "SentenceExceptList.xml";
-static const char pXMLImplAutocorr_ListStr[]   = "DocumentList.xml";
+const char pXMLImplWrdStt_ExcptLstStr[] = "WordExceptList.xml";
+const char pXMLImplCplStt_ExcptLstStr[] = "SentenceExceptList.xml";
+const char pXMLImplAutocorr_ListStr[]   = "DocumentList.xml";
 
-static const char
+const char
 /* also at these beginnings - Brackets and all kinds of begin characters */
 sImplSttSkipChars[] = "\"\'([{\x83\x84\x89\x91\x92\x93\x94",
 /* also at these ends - Brackets and all kinds of begin characters */
@@ -309,13 +309,13 @@ ACFlags SvxAutoCorrect::GetDefaultFlags()
 return nRet;
 }
 
-static constexpr sal_Unicode cEmDash = 0x2014;
-static constexpr sal_Unicode cEnDash = 0x2013;
-static constexpr sal_Unicode cApostrophe = 0x2019;
-static constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB;
-static constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB;
-static constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039;
-static constexpr sal_Unicode cRightSingleAngleQuote = 0x203A;
+constexpr sal_Unicode cEmDash = 0x2014;
+constexpr sal_Unicode cEnDash = 0x2013;
+constexpr sal_Unicode cApostrophe = 0x2019;
+constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB;
+constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB;
+constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039;
+constexpr sal_Unicode cRightSingleAngleQuote = 0x203A;
 // stop characters for searching preceding quotes
 // (the first character is also the opening quote we are looking for)
 const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 6cb3adb37a46..15a8a180793c 100644
--- a/editeng/source/uno/unotext.cxx

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

2020-06-27 Thread László Németh (via logerrit)
 editeng/source/misc/acorrcfg.cxx |   11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 076c95b27bf0e9be1fa1c077674cf974b22210fd
Author: László Németh 
AuthorDate: Fri Jun 26 22:13:26 2020 +0200
Commit: László Németh 
CommitDate: Sat Jun 27 09:11:42 2020 +0200

AutoCorrect: fix redundant loading

of new localized options added by
commit da64ec8c8a91db6a6ec9657898f081d5ee67e739
(tdf#133589 AutoCorrect: transliterate to Old Hungarian)
and commit 77b213890a96d144d9cfacdfd35ac0bba68b9f7a
(tdf#133524 add option to angle quote AutoCorrect)

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

diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index 03d238953b10..aa08f4196664 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -340,10 +340,8 @@ Sequence  SvxSwAutoCorrCfg::GetPropertyNames()
 "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",//44
 "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",   //45
 "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch", //46
-"Format/Option/TransliterateRTL",   //47
-"Format/Option/ChangeAngleQuotes"   //48
 };
-const int nCount = 49;
+const int nCount = 47;
 Sequence aNames(nCount);
 OUString* pNames = aNames.getArray();
 for(int i = 0; i < nCount; i++)
@@ -493,8 +491,6 @@ void SvxSwAutoCorrCfg::Load(bool bInit)
 rSwFlags.aByInputBulletFont.SetPitch(FontPitch(nVal));
 }
 break;// 
"Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch",
-case 47 : rSwFlags.bTransliterateRTL = 
*o3tl::doAccess(pValues[nProp]); break; // 
"Format/Option/TransliterateRTL",
-case 48 : rSwFlags.bChgAngleQuotes = 
*o3tl::doAccess(pValues[nProp]); break; // 
"Format/Option/ChangeAngleQuotes",
 }
 }
 }
@@ -596,11 +592,8 @@ void SvxSwAutoCorrCfg::ImplCommit()
 // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily"
  css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetCharSet())),
 // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset"
- css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch())),
+ css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch()))});
 // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch"
- css::uno::Any(rSwFlags.bTransliterateRTL)});
-// "Format/Option/TransliterateRTL"
-
 }
 
 void SvxSwAutoCorrCfg::Notify( const Sequence& /* aPropertyNames */ )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-26 Thread Stephan Bergmann (via logerrit)
 editeng/source/editeng/impedit3.cxx |   10 --
 editeng/source/misc/svxacorr.cxx|8 +++-
 editeng/source/uno/unotext.cxx  |6 ++
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 658dbdaa5178012cd8bd54118026cca1b69159d6
Author: Stephan Bergmann 
AuthorDate: Fri Jun 26 08:39:35 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 26 10:45:57 2020 +0200

Upcoming improved loplugin:elidestringvar: editeng

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

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 0d00c5197184..eba85963052e 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -79,7 +79,7 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::linguistic2;
 
-#define CH_HYPH '-'
+#define CH_HYPH "-"
 
 #define WRONG_SHOW_MIN   5
 
@@ -2048,7 +2048,6 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* 
pParaPortion, EditLine* pLine, Te
 // A portion for inserting the separator...
 TextPortion* pHyphPortion = new TextPortion( 0 );
 pHyphPortion->SetKind( PortionKind::HYPHENATOR );
-OUString aHyphText(CH_HYPH);
 if ( (cAlternateReplChar || cAlternateExtraChar) && bAltFullRight ) // 
alternation after the break doesn't supported
 {
 TextPortion& rPrev = pParaPortion->GetTextPortions()[nEndPortion];
@@ -2066,7 +2065,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* 
pParaPortion, EditLine* pLine, Te
 SeekCursor( pParaPortion->GetNode(), nBreakPos, aFont );
 aFont.SetPhysFont( GetRefDevice() );
 pHyphPortion->GetSize().setHeight( GetRefDevice()->GetTextHeight() );
-pHyphPortion->GetSize().setWidth( GetRefDevice()->GetTextWidth( 
aHyphText ) );
+pHyphPortion->GetSize().setWidth( GetRefDevice()->GetTextWidth( 
CH_HYPH ) );
 
 pParaPortion->GetTextPortions().Insert(++nEndPortion, pHyphPortion);
 }
@@ -3195,8 +3194,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
tools::Rectangle aClipRect, Po
 
 if ( 0x200B == cChar || 0x2060 == 
cChar )
 {
-const OUString aBlank( ' ' );
-long nHalfBlankWidth = 
aTmpFont.QuickGetTextSize( pOutDev, aBlank, 0, 1 ).Width() / 2;
+long nHalfBlankWidth = 
aTmpFont.QuickGetTextSize( pOutDev, " ", 0, 1 ).Width() / 2;
 
 const long nAdvanceX = ( 
nTmpIdx == nTmpEnd ?
  
rTextPortion.GetSize().Width() :
@@ -3377,7 +3375,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
tools::Rectangle aClipRect, Po
 {
 if ( rTextPortion.GetExtraValue() )
 aText = 
OUString(rTextPortion.GetExtraValue());
-aText += OUStringChar(CH_HYPH);
+aText += CH_HYPH;
 nTextStart = 0;
 nTextLen = aText.getLength();
 
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e8ae81f045d2..efab7967deb7 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -93,7 +93,7 @@ enum class Flags {
 namespace o3tl {
 template<> struct typed_flags : is_typed_flags {};
 }
-static const sal_Unicode cNonBreakingSpace = 0xA0;
+static const sal_Unicode cNonBreakingSpace = 0xA0; // UNICODE code for no 
break space
 
 static const char pXMLImplWrdStt_ExcptLstStr[] = "WordExceptList.xml";
 static const char pXMLImplCplStt_ExcptLstStr[] = "SentenceExceptList.xml";
@@ -1231,8 +1231,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 
 if( eType == ACQuotes::NonBreakingSpace )
 {
-OUString s( cNonBreakingSpace ); // UNICODE code for no break space
-if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
+if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, 
OUStringChar(cNonBreakingSpace) ))
 {
 if( !bSttQuote )
 ++nInsPos;
@@ -2003,8 +2002,7 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType 
eLang,
 
 static bool lcl_FindAbbreviation(const SvStringsISortDtor* pList, const 
OUString& sWord)
 {
-OUString sAbk('~');
-SvStringsISortDtor::const_iterator it = pList->find( sAbk );
+SvStringsISortDtor::const_iterator it = pList->find( "~" );
 SvStringsISortDtor::size_type nPos = it - pList->begi

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

2020-06-26 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx  |   30 +-
 sw/qa/extras/uiwriter/data/tdf123786.fodt |   14 ++
 sw/qa/extras/uiwriter/uiwriter.cxx|   27 +++
 3 files changed, 62 insertions(+), 9 deletions(-)

New commits:
commit 8d4b6e5858935c4a32f89b9e09c5f1084d34a04c
Author: László Németh 
AuthorDate: Thu Jun 25 10:54:41 2020 +0200
Commit: László Németh 
CommitDate: Fri Jun 26 09:03:19 2020 +0200

tdf#123786 AutoCorrect: fix apostrophe in Russian

and Ukrainian at "Single quotes" replacement
outside of second level quotations.

For example:

„quote' -> „quote‘

but now

apostrophe' -> apostrophe’

instead of the bad

apostrophe' -> apostrophe“

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 58878e41f9fa..e8ae81f045d2 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -321,6 +321,7 @@ static constexpr sal_Unicode cRightSingleAngleQuote = 
0x203A;
 const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
 const sal_Unicode aStopDoubleAngleQuoteEnd[] = { cRightDoubleAngleQuote, 
cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }; // preceding >>
 const sal_Unicode aStopSingleQuoteEnd[] = { 0x201A, 0x2018, 0x201C, 0x201E, 0 
};
+const sal_Unicode aStopSingleQuoteEndRuUa[] = { 0x201E, 0x201C, 
cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0 };
 
 SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile,
 const OUString& rUserAutocorrFile )
@@ -1355,19 +1356,30 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& 
rDoc, const OUString& rTxt,
 {
 eType = ACQuotes::DoubleAngleQuote;
 }
-// tdf#128860 use apostrophe outside of second level 
quotation in Czech, German, Icelandic,
-// Slovak and Slovenian instead of the – in this case, bad 
– closing quotation mark U+2018.
 else if ( bSingle && nInsPos && !bSttQuote &&
-( primary(eLang) == primary(LANGUAGE_GERMAN) || 
eLang.anyOf (
- LANGUAGE_CZECH,
- LANGUAGE_ICELANDIC,
- LANGUAGE_SLOVAK,
- LANGUAGE_SLOVENIAN ) ) &&
-!lcl_HasPrecedingChar( rTxt, nInsPos, 
aStopSingleQuoteEnd[0],  aStopSingleQuoteEnd + 1 ) )
+// tdf#128860 use apostrophe outside of second level 
quotation in Czech, German, Icelandic,
+// Slovak and Slovenian instead of the – in this case, 
bad – closing quotation mark U+2018.
+// tdf#123786 the same for Russian and Ukrainian
+( ( eLang.anyOf (
+ LANGUAGE_CZECH,
+ LANGUAGE_GERMAN,
+ LANGUAGE_GERMAN_SWISS,
+ LANGUAGE_GERMAN_AUSTRIAN,
+ LANGUAGE_GERMAN_LUXEMBOURG,
+ LANGUAGE_GERMAN_LIECHTENSTEIN,
+ LANGUAGE_ICELANDIC,
+ LANGUAGE_SLOVAK,
+ LANGUAGE_SLOVENIAN ) &&
+!lcl_HasPrecedingChar( rTxt, nInsPos, 
aStopSingleQuoteEnd[0],  aStopSingleQuoteEnd + 1 ) ) ||
+  ( eLang.anyOf (
+ LANGUAGE_RUSSIAN,
+ LANGUAGE_UKRAINIAN ) &&
+!lcl_HasPrecedingChar( rTxt, nInsPos, 
aStopSingleQuoteEndRuUa[0],  aStopSingleQuoteEndRuUa + 1 ) ) ) )
 {
 LocaleDataWrapper& rLcl = GetLocaleDataWrapper( eLang 
);
 CharClass& rCC = GetCharClass( eLang );
-if ( rLcl.getQuotationMarkStart() == 
OUStringChar(aStopSingleQuoteEnd[0]) &&
+if ( ( rLcl.getQuotationMarkStart() == 
OUStringChar(aStopSingleQuoteEnd[0]) ||
+ rLcl.getQuotationMarkStart() == 
OUStringChar(aStopSingleQuoteEndRuUa[0]) ) &&
  // use apostrophe only after letters, not after 
digits or punctuation
  rCC.isLetter(rTxt, nInsPos-1) )
 {
diff --git a/sw/qa/extras/uiwriter/data/tdf123786.fodt 
b/sw/qa/extras/uiwriter/data/tdf123786.fodt
new file mode 100644
index ..8eb85164bb5e
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf123786.fodt
@@ -0,0 +1,14 @@
+
+http://openoffice.org/2009/office"; 
xmlns:loext="urn:org:documentfoundation:name

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

2020-06-26 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 70ee8666edb0851222550029e445ef61434a0376
Author: László Németh 
AuthorDate: Tue Jun 23 19:20:24 2020 +0200
Commit: László Németh 
CommitDate: Fri Jun 26 09:02:46 2020 +0200

tdf#133524 AutoCorrect angle quotes for fr-CH and gl-ES

Note: << and >> replaced with single angle quotation mark
‹ and › in Swiss French, according to the apostrophe related
changes in tdf#116062, see

commit b9910e87de4eea1cb3684bb7af8e58d681cbe809
(Resolves: tdf#116062 revert [fr-CH] to use previous single
quote characters)

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 4f55ea951167..58878e41f9fa 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -314,6 +314,8 @@ static constexpr sal_Unicode cEnDash = 0x2013;
 static constexpr sal_Unicode cApostrophe = 0x2019;
 static constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB;
 static constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB;
+static constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039;
+static constexpr sal_Unicode cRightSingleAngleQuote = 0x203A;
 // stop characters for searching preceding quotes
 // (the first character is also the opening quote we are looking for)
 const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
@@ -1208,9 +1210,10 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 
 if ( eType == ACQuotes::DoubleAngleQuote )
 {
+bool bSwiss = eLang == LANGUAGE_FRENCH_SWISS;
 cRet = ( '<' == cInsChar || ('\"' == cInsChar && !bSttQuote) )
-? cLeftDoubleAngleQuote
-: cRightDoubleAngleQuote;
+? ( bSwiss ? cLeftSingleAngleQuote : cLeftDoubleAngleQuote )
+: ( bSwiss ? cRightSingleAngleQuote : cRightDoubleAngleQuote );
 }
 else if ( eType == ACQuotes::UseApostrophe )
 cRet = cApostrophe;
@@ -1389,6 +1392,8 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 const LanguageType eLang = GetDocLanguage( rDoc, nInsPos );
 if ( eLang.anyOf(
 LANGUAGE_FINNISH,  // alternative primary 
level
+LANGUAGE_FRENCH_SWISS, // second level
+LANGUAGE_GALICIAN,
 LANGUAGE_HUNGARIAN,// second level
 LANGUAGE_POLISH,   // second level
 LANGUAGE_PORTUGUESE,   // primary level
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-24 Thread Stephan Bergmann (via logerrit)
 editeng/source/uno/unotext.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c3cd2daa572d66d9a03c176573494b11ae388c60
Author: Stephan Bergmann 
AuthorDate: Wed Jun 24 15:02:19 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jun 24 17:15:48 2020 +0200

Remove obsolete comments about '\r' on old Mac OS

(and where sticking to numeric '\x0D' is probably cleaner anyway)

Change-Id: I614c57a4de74bf688c498e9bff043ca2eee04cb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97033
Tested-by: Stephan Bergmann 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 53f3088b19be..75854d802f42 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1774,7 +1774,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( 
const uno::Reference< text
 {
 case text::ControlCharacter::PARAGRAPH_BREAK:
 {
-const OUString aText( u'\x000D' );  // '\r' does not work on Mac
+const OUString aText( u'\x000D' );
 insertString( xRange, aText, bAbsorb );
 
 return;
@@ -1824,7 +1824,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( 
const uno::Reference< text
 aRange.nEndPos  = aRange.nStartPos;
 
 pRange->SetSelection( aRange );
-const OUString aText( u'\x000D' );  // '\r' does not work on Mac
+const OUString aText( u'\x000D' );
 pRange->setString( aText );
 
 aRange.nStartPos = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-14 Thread Andrea Gelmini (via logerrit)
 editeng/source/misc/svxacorr.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 15bf1b3935366450a86e80d7ece918ea81706437
Author: Andrea Gelmini 
AuthorDate: Mon Jun 1 08:31:32 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 14 09:23:35 2020 +0200

Fix typo

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index c6a0fd9da25d..4b271993cd68 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -435,7 +435,7 @@ void SvxAutoCorrect::FnCapitalStartWord( SvxAutoCorrDoc& 
rDoc, const OUString& r
 OUString sWord( rTxt.copy( nSttPos - 1, nEndPos - nSttPos + 1 ));
 if( !FindInWrdSttExceptList(eLang, sWord) )
 {
-// Check that word isn't correctly spelled before correcting:
+// Check that word isn't correctly spelt before correcting:
 css::uno::Reference< css::linguistic2::XSpellChecker1 > 
xSpeller =
 LinguMgr::GetSpellChecker();
 if( xSpeller->hasLanguage(static_cast(eLang)) )
@@ -1379,7 +1379,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 InsertQuote( rDoc, nInsPos, cChar, bSttQuote, bInsert, eLang, 
eType );
 break;
 }
-// tdf#133524 change "<<" and ">>" to double angle quoation marks
+// tdf#133524 change "<<" and ">>" to double angle quotation marks
 else if ( IsAutoCorrFlag( ACFlags::ChgQuotes ) && ('<' == cChar || 
'>' == cChar) &&
 nInsPos > 0 && cChar == rTxt[ nInsPos-1 ] )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-02 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx   |8 +++-
 sw/qa/extras/uiwriter/uiwriter.cxx |6 ++
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 967d1ba1f2a3f551c23ba4d9902632a0dc581224
Author: László Németh 
AuthorDate: Tue Jun 2 10:12:27 2020 +0200
Commit: László Németh 
CommitDate: Tue Jun 2 18:40:38 2020 +0200

tdf#132301 AutoCorrect: fix ’« in French qu’« word »

instead of using the bad ’" -> ’» autocorrection.

Also limit this for abbreviated single-letter form of
French words ce, de, je, la, le, ne, me, te, se and si.

See commit 8039c9eb27170a162830f0ecd2086010a7a5858f
(tdf#38394 AutoCorrect: fix ’« in French l’« word »).

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 51fdf5c30746..c776cb45aae7 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1326,7 +1326,13 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& 
rDoc, const OUString& rTxt,
 // tdf#38394 use opening quotation mark << in French 
l'<>
 if ( !bSingle && !bSttQuote && cPrev == cApostrophe &&
 primary(eLang) == primary(LANGUAGE_FRENCH) &&
-(nInsPos == 2 || (nInsPos > 2 && IsWordDelim( rTxt[ 
nInsPos-3 ] ))) )
+( ( ( nInsPos == 2 || ( nInsPos > 2 && IsWordDelim( 
rTxt[ nInsPos-3 ] ) ) ) &&
+   // abbreviated form of ce, de, je, la, le, ne, 
me, te, se or si
+   OUString("cdjlnmtsCDJLNMTS").indexOf( rTxt[ 
nInsPos-2 ] ) > -1 ) ||
+  ( ( nInsPos == 3 || (nInsPos > 3 && IsWordDelim( 
rTxt[ nInsPos-4 ] ) ) ) &&
+   // abbreviated form of que
+   ( rTxt[ nInsPos-2 ] == 'u' || rTxt[ nInsPos-2 ] 
== 'U' ) &&
+   ( rTxt[ nInsPos-3 ] == 'q' || rTxt[ nInsPos-3 ] 
== 'Q' ) ) ) )
 {
 bSttQuote = true;
 }
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 92c4201bce24..bb0d12aa7804 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -7186,6 +7186,12 @@ void SwUiWriterTest::testTdf38394()
 sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
 OUString sReplaced(u"l\u2019« ");
 CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+// tdf#132301 autocorrect of qu'«
+pWrtShell->Insert(u" qu\u2019");
+pWrtShell->AutoCorrect(corr, cChar);
+nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+sReplaced += u" qu\u2019« ";
+CPPUNIT_ASSERT_EQUAL(sReplaced, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
 }
 
 void SwUiWriterTest::testTdf59666()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-31 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx  |   74 +-
 include/editeng/svxacorr.hxx  |1 
 sw/qa/extras/uiwriter/data/tdf133524.fodt |   14 +
 sw/qa/extras/uiwriter/uiwriter.cxx|   49 +++
 4 files changed, 137 insertions(+), 1 deletion(-)

New commits:
commit 57f07b1d7378d218648667c5b1315cc8ad905875
Author: László Németh 
AuthorDate: Thu May 28 08:50:39 2020 +0200
Commit: László Németh 
CommitDate: Sun May 31 23:13:23 2020 +0200

tdf#133524 AutoCorrect: support double angle quotes

Add two methods to support double angle quotes,
as part of "Double quotes" replacement:

1. Correct ">>" and "<<" to » and « in several languages,
where double angle quotes are default or alternative
primary or second level quotation marks, but actual
LibreOffice locale settings don't contain double angle
quotes.

2. Correct " to double angle quotes, if the cursor
is there in a primary level quotation (i.e. there
is a preceding primary level opening quote, but not
other quotes). For example, it's possible to type
Hungarian or Romanian quotation marks in

„... »quote« ...”

pressing only Shift + 2 (") for them. (These languages,
where "Single quotes" replacement is used for apostrophe
and third level quotes instead of the standard second
level quotation marks.)

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ebc0ec810a60..24a5235e9c1a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -259,6 +259,7 @@ bool SvxAutoCorrect::IsAutoCorrectChar( sal_Unicode cChar )
 cChar == '*'  || cChar == '_'  || cChar == '%' ||
 cChar == '.'  || cChar == ','  || cChar == ';' ||
 cChar == ':'  || cChar == '?' || cChar == '!' ||
+cChar == '<'  || cChar == '>' ||
 cChar == '/'  || cChar == '-';
 }
 
@@ -309,6 +310,12 @@ ACFlags SvxAutoCorrect::GetDefaultFlags()
 static constexpr sal_Unicode cEmDash = 0x2014;
 static constexpr sal_Unicode cEnDash = 0x2013;
 static constexpr sal_Unicode cApostrophe = 0x2019;
+static constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB;
+static constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB;
+// stop characters for searching preceding quotes
+// (the first character is also the opening quote we are looking for)
+const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
+const sal_Unicode aStopDoubleAngleQuoteEnd[] = { cRightDoubleAngleQuote, 
cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }; // preceding >>
 
 SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile,
 const OUString& rUserAutocorrFile )
@@ -1194,7 +1201,16 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 sal_Unicode cInsChar, bool bSttQuote,
 bool bIns, LanguageType eLang, ACQuotes 
eType ) const
 {
-sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang );
+sal_Unicode cRet;
+
+if ( eType == ACQuotes::DoubleAngleQuote )
+{
+cRet = ( '<' == cInsChar || ('\"' == cInsChar && !bSttQuote) )
+? cLeftDoubleAngleQuote
+: cRightDoubleAngleQuote;
+}
+else
+cRet = GetQuote( cInsChar, bSttQuote, eLang );
 
 OUString sChg( cInsChar );
 if( bIns )
@@ -1213,6 +1229,11 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 ++nInsPos;
 }
 }
+else if( eType == ACQuotes::DoubleAngleQuote && cInsChar != '\"' )
+{
+rDoc.Delete( nInsPos-1, nInsPos);
+--nInsPos;
+}
 
 rDoc.Replace( nInsPos, sChg );
 
@@ -1242,6 +1263,26 @@ OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc const 
& rDoc, sal_Int32 nInsPo
 return sRet;
 }
 
+// search preceding opening quote in the paragraph before the insert position
+static bool lcl_HasPrecedingChar( const OUString& rTxt, sal_Int32 nPos,
+const sal_Unicode sPrecedingChar, const sal_Unicode* 
aStopChars )
+{
+sal_Unicode cTmpChar;
+
+do {
+cTmpChar = rTxt[ --nPos ];
+if ( cTmpChar == sPrecedingChar )
+return true;
+
+for ( const sal_Unicode* pCh = aStopChars; *pCh; ++pCh )
+if ( cTmpChar == *pCh )
+return false;
+
+} while ( nPos > 0 );
+
+return false;
+}
+
 // WARNING: rText may become invalid, see comment below
 void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
 sal_Int32 nInsPos, sal_Unicode cChar,
@@ -1292,6 +1333,14 @@ void SvxAutoCor

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

2020-05-31 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx  |   22 ++
 include/editeng/svxacorr.hxx  |1 +
 sw/qa/extras/uiwriter/data/tdf128860.fodt |   14 ++
 sw/qa/extras/uiwriter/uiwriter.cxx|   27 +++
 4 files changed, 64 insertions(+)

New commits:
commit a0c90f1bccd9b5a349d3199746facab549f27dba
Author: László Németh 
AuthorDate: Fri May 29 16:46:44 2020 +0200
Commit: László Németh 
CommitDate: Sun May 31 23:13:59 2020 +0200

tdf#128860 AutoCorrect: fix apostrophe in Czech, German,

Icelandic, Slovak and Slovene at "Single quotes"
replacement outside of second level quotations.

For example:

‚quote' -> ‚quote‘

but now

apostrophe' -> apostrophe’

instead of the bad

apostrophe' -> apostrophe‘

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 24a5235e9c1a..b381b1726f45 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -316,6 +316,7 @@ static constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB;
 // (the first character is also the opening quote we are looking for)
 const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0 }; // 
preceding ,,
 const sal_Unicode aStopDoubleAngleQuoteEnd[] = { cRightDoubleAngleQuote, 
cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }; // preceding >>
+const sal_Unicode aStopSingleQuoteEnd[] = { 0x201A, 0x2018, 0x201C, 0x201E, 0 
};
 
 SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile,
 const OUString& rUserAutocorrFile )
@@ -1209,6 +1210,8 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 ? cLeftDoubleAngleQuote
 : cRightDoubleAngleQuote;
 }
+else if ( eType == ACQuotes::UseApostrophe )
+cRet = cApostrophe;
 else
 cRet = GetQuote( cInsChar, bSttQuote, eLang );
 
@@ -1341,6 +1344,25 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& 
rDoc, const OUString& rTxt,
 {
 eType = ACQuotes::DoubleAngleQuote;
 }
+// tdf#128860 use apostrophe outside of second level 
quotation in Czech, German, Icelandic,
+// Slovak and Slovenian instead of the – in this case, bad 
– closing quotation mark U+2018.
+else if ( bSingle && nInsPos && !bSttQuote &&
+( primary(eLang) == primary(LANGUAGE_GERMAN) || 
eLang.anyOf (
+ LANGUAGE_CZECH,
+ LANGUAGE_ICELANDIC,
+ LANGUAGE_SLOVAK,
+ LANGUAGE_SLOVENIAN ) ) &&
+!lcl_HasPrecedingChar( rTxt, nInsPos, 
aStopSingleQuoteEnd[0],  aStopSingleQuoteEnd + 1 ) )
+{
+LocaleDataWrapper& rLcl = GetLocaleDataWrapper( eLang 
);
+CharClass& rCC = GetCharClass( eLang );
+if ( rLcl.getQuotationMarkStart() == 
OUStringChar(aStopSingleQuoteEnd[0]) &&
+ // use apostrophe only after letters, not after 
digits or punctuation
+ rCC.isLetter(rTxt, nInsPos-1) )
+{
+eType = ACQuotes::UseApostrophe;
+}
+}
 }
 
 if ( eType == ACQuotes::NONE && !bSingle &&
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index c9d9a866a949..697ac614f76d 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -86,6 +86,7 @@ enum class ACQuotes
 NonBreakingSpace,
 CapitalizeIAm,
 DoubleAngleQuote,
+UseApostrophe,
 };
 
 // TODO: handle code points > U+ and check users of this class
diff --git a/sw/qa/extras/uiwriter/data/tdf128860.fodt 
b/sw/qa/extras/uiwriter/data/tdf128860.fodt
new file mode 100644
index ..5e93b60f667b
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf128860.fodt
@@ -0,0 +1,14 @@
+
+http://openoffice.org/2009/office"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+  
+   
+  
+ 
+ 
+  
+   
+  
+ 
+
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 9ba5cb946328..1cdc40cc43a6 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -369,6 +369,7 @@ public:
 void testTdf38394();
 void testTdf59666();
 void testTdf133524();
+void testTdf128860();
 void testInconsistentBookmark();

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

2020-05-31 Thread László Németh (via logerrit)
 editeng/source/misc/svxacorr.cxx |   55 +--
 include/editeng/svxacorr.hxx |   10 ++-
 2 files changed, 33 insertions(+), 32 deletions(-)

New commits:
commit c87c7ddca46ae093a703ca673a204e4593402c38
Author: László Németh 
AuthorDate: Wed May 27 18:15:26 2020 +0200
Commit: László Németh 
CommitDate: Sun May 31 23:12:44 2020 +0200

AutoCorrect: clean-up InsertQuote

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 71f6efc2e33f..ebc0ec810a60 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1192,9 +1192,8 @@ sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode 
cInsChar, bool bSttQuote,
 
 void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos,
 sal_Unicode cInsChar, bool bSttQuote,
-bool bIns, bool b_iApostrophe ) const
+bool bIns, LanguageType eLang, ACQuotes 
eType ) const
 {
-const LanguageType eLang = GetDocLanguage( rDoc, nInsPos );
 sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang );
 
 OUString sChg( cInsChar );
@@ -1205,36 +1204,21 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 
 sChg = OUString(cRet);
 
-if( '\"' == cInsChar )
+if( eType == ACQuotes::NonBreakingSpace )
 {
-if (primary(eLang) == primary(LANGUAGE_FRENCH) && eLang != 
LANGUAGE_FRENCH_SWISS)
+OUString s( cNonBreakingSpace ); // UNICODE code for no break space
+if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
 {
-OUString s( cNonBreakingSpace ); // UNICODE code for no break space
-if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
-{
-if( !bSttQuote )
-++nInsPos;
-}
+if( !bSttQuote )
+++nInsPos;
 }
 }
 
 rDoc.Replace( nInsPos, sChg );
 
-// i' -> I' in English (last step for the undo)
-if( b_iApostrophe && eLang.anyOf(
-LANGUAGE_ENGLISH,
-LANGUAGE_ENGLISH_US,
-LANGUAGE_ENGLISH_UK,
-LANGUAGE_ENGLISH_AUS,
-LANGUAGE_ENGLISH_CAN,
-LANGUAGE_ENGLISH_NZ,
-LANGUAGE_ENGLISH_EIRE,
-LANGUAGE_ENGLISH_SAFRICA,
-LANGUAGE_ENGLISH_JAMAICA,
-LANGUAGE_ENGLISH_CARIBBEAN))
-{
+// i' -> I' in English (last step for the Undo)
+if( eType == ACQuotes::CapitalizeIAm )
 rDoc.Replace( nInsPos-1, "I" );
-}
 }
 
 OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc const & rDoc, sal_Int32 
nInsPos,
@@ -1285,7 +1269,8 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 {
 sal_Unicode cPrev;
 bool bSttQuote = !nInsPos;
-bool b_iApostrophe = false;
+ACQuotes eType = ACQuotes::NONE;
+const LanguageType eLang = GetDocLanguage( rDoc, nInsPos );
 if (!bSttQuote)
 {
 cPrev = rTxt[ nInsPos-1 ];
@@ -1295,17 +1280,25 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& 
rDoc, const OUString& rTxt,
 ( cEnDash == cPrev );
 // tdf#38394 use opening quotation mark << in French 
l'<>
 if ( !bSingle && !bSttQuote && cPrev == cApostrophe &&
+primary(eLang) == primary(LANGUAGE_FRENCH) &&
 (nInsPos == 2 || (nInsPos > 2 && IsWordDelim( rTxt[ 
nInsPos-3 ] ))) )
 {
-const LanguageType eLang = GetDocLanguage( rDoc, 
nInsPos );
-if ( primary(eLang) == primary(LANGUAGE_FRENCH) )
-bSttQuote = true;
+bSttQuote = true;
 }
 // tdf#108423 for capitalization of English i'm
-b_iApostrophe = bSingle && ( cPrev == 'i' ) &&
-(( nInsPos == 1 ) || IsWordDelim( rTxt[ nInsPos-2 ] ));
+else if ( bSingle && ( cPrev == 'i' ) &&
+primary(eLang) == primary(LANGUAGE_ENGLISH) &&
+( nInsPos == 1 || IsWordDelim( rTxt[ nInsPos-2 ] ) ) )
+{
+eType = ACQuotes::CapitalizeIAm;
+}
 }
-InsertQuote( rDoc, nInsPos, cChar, bSttQuote, bInsert, 
b_iApostrophe );
+
+if ( eType == ACQuotes::NONE && !bSingle &&
+( primary(eLang) == primary(LANGUAGE_FRENCH) && eLang != 
LANGUAGE_FRENCH_SWISS ) )
+eType = ACQuotes::NonBreakingSpace;
+
+I

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

2020-05-18 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit2.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit d6fce28dea6e1e51ec5de88ef17cc56180b8c2db
Author: Caolán McNamara 
AuthorDate: Mon May 18 12:21:09 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 18 15:47:57 2020 +0200

Resolves: tdf#129620 crash because there is no associated window

only an outputdevice in this editeng-in-a-widget case

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

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 124b310ca249..eb9ef5eca2c3 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -478,13 +478,17 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 if ( nInputEnd > rLine.GetEnd() )
 nInputEnd = rLine.GetEnd();
 tools::Rectangle aR2 = PaMtoEditCursor( EditPaM( 
aPaM.GetNode(), nInputEnd ), GetCursorFlags::EndOfLine );
-tools::Rectangle aRect = 
pView->GetImpEditView()->GetWindowPos( aR1 );
-pView->GetWindow()->SetCursorRect( &aRect, 
aR2.Left()-aR1.Right() );
+if (vcl::Window* pWindow = pView->GetWindow())
+{
+tools::Rectangle aRect = 
pView->GetImpEditView()->GetWindowPos( aR1 );
+pWindow->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
+}
 }
 }
 else
 {
-pView->GetWindow()->SetCursorRect();
+if (vcl::Window* pWindow = pView->GetWindow())
+  pWindow->SetCursorRect();
 }
 }
 else if ( rCEvt.GetCommand() == CommandEventId::SelectionChange )
@@ -545,7 +549,8 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 tools::Rectangle aR2 = GetEditCursor( pParaPortion, 
nInputPos );
 aRects[ i ] = pView->GetImpEditView()->GetWindowPos( aR2 );
 }
-pView->GetWindow()->SetCompositionCharRect( aRects.get(), 
mpIMEInfos->nLen );
+if (vcl::Window* pWindow = pView->GetWindow())
+pWindow->SetCompositionCharRect( aRects.get(), 
mpIMEInfos->nLen );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-13 Thread Julien Nabet (via logerrit)
 editeng/source/items/frmitems.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 6edcbde02520500812d969dd5bcba5ff68d59c58
Author: Julien Nabet 
AuthorDate: Mon May 11 19:59:16 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed May 13 15:16:09 2020 +0200

Related tdf#132945: fix warning

I noticed this log:
warn:sw.uno:555419:555419:sw/source/core/unocore/unostyle.cxx:2303: error 
getting attribute from RES_BACKGROUND

Git history provides:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=7a8ed362eb163ac15a000ba1cfc74b58315800a1
[API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphic
*BackGraphicURL include the following properties:
- BackGraphicURL
- FooterBackGraphicURL
- HeaderBackGraphicURL
- ParaBackGraphicURL

This were removed, but for backwards compatibility this commit
adds them back again and depreactes them in the UNO API. The
behaviour also changes as internal vnd.sun.star.GraphicObject
scheme URLs aren't supported so this properties can only be set
and only if a external URL is provided. If getting such a property
then a RuntimeException will be thrown.

But why "MID_GRAPHIC_URL" wouldn't be dealt in SvxBrushItem::QueryValue
whereas:
1) we got this code
   2892 case MID_GRAPHIC:
   2893 {
   2894 uno::Reference xGraphic;
   2895 if (!maStrLink.isEmpty())
   2896 {
   2897 Graphic 
aGraphic(vcl::graphic::loadFromURL(maStrLink));
   2898 xGraphic = aGraphic.GetXGraphic();
   2899 }
   2900 else if (xGraphicObject)
   2901 {
   2902 xGraphic = 
xGraphicObject->GetGraphic().GetXGraphic();
   2903 }
   2904 rVal <<= xGraphic;
   2905 }

=> so dealt in 2895 "if" block
See 
https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2892

2) MID_GRAPHIC_URL is dealt in SvxBrushItem::PutValue
   2974 case MID_GRAPHIC_URL:
   2975 case MID_GRAPHIC:
   2976 {
   2977 Graphic aGraphic;
   2978
   2979 if (rVal.getValueType() == 
::cppu::UnoType::get())
   2980 {
   2981 OUString aURL = rVal.get();
   2982 aGraphic = vcl::graphic::loadFromURL(aURL);
   2983 }
   2984 else if (rVal.getValueType() == 
cppu::UnoType::get())
   2985 {
   2986 auto xGraphic = 
rVal.get>();
   2987 aGraphic = Graphic(xGraphic);
   2988 }
...
See 
https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2974

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 8c0a44be5911..d931ed6f839f 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2884,11 +2884,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 break;
 
 case MID_GRAPHIC_URL:
-{
-SAL_INFO("editeng.items", "Getting GraphicURL property is not 
supported");
-return false;
-}
-break;
 case MID_GRAPHIC:
 {
 uno::Reference xGraphic;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-10 Thread Marco Cecchetti (via logerrit)
 editeng/source/editeng/impedit.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 2ce5938b38c5080e5ac7f200afa1446abe53db28
Author: Marco Cecchetti 
AuthorDate: Thu Apr 9 18:51:46 2020 +0200
Commit: Andras Timar 
CommitDate: Sun May 10 11:17:01 2020 +0200

lok: calc: formula bar: improve selection handling

This patch provides some improvements for the single input line case
with a multi-line text selection:

- selection rectangles are correct when selection is expanded to the
previous or the next line

- two flag parameters for notifying the client if the start/end
selection handles should be visible or they don't

Change-Id: Ica0428786183c4b5a15870c43490bc69452c2a49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92121
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93344
Tested-by: Jenkins

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index b5be152d6ece..e087305effd1 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -278,6 +278,10 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 const sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos(pEndNode);
 if (nStartPara == EE_PARA_NOT_FOUND || nEndPara == EE_PARA_NOT_FOUND)
 return;
+
+bool bStartHandleVisible = false;
+bool bEndHandleVisible = false;
+
 for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
 {
 ParaPortion* pTmpPortion = 
pEditEngine->GetParaPortions().SafeGetObject( nPara );
@@ -341,6 +345,11 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 if ( aBottomRight.Y() < GetVisDocTop() )
 continue;
 
+if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
+bStartHandleVisible = true;
+if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
+bEndHandleVisible = true;
+
 // Now that we have Bidi, the first/last index doesn't have to be 
the 'most outside' position
 if ( !bPartOfLine )
 {
@@ -405,6 +414,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 const OUString rAction("text_selection");
 std::vector aItems;
 aItems.emplace_back("rectangles", sRectangle);
+aItems.emplace_back("startHandleVisible", 
OString::boolean(bStartHandleVisible));
+aItems.emplace_back("endHandleVisible", 
OString::boolean(bEndHandleVisible));
 pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, 
aItems);
 pPolyPoly.reset();
 return;
@@ -1384,6 +1395,11 @@ Pair ImpEditView::Scroll( long ndX, long ndY, 
ScrollRangeCheck nRangeCheck )
 EENotify aNotify( EE_NOTIFY_TEXTVIEWSCROLLED );
 pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
 }
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+DrawSelectionXOR();
+}
 }
 
 return Pair( nRealDiffX, nRealDiffY );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-08 Thread Julien Nabet (via logerrit)
 editeng/source/editeng/impedit2.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 23efced60cb7e08bf17b10e3e1ea5802e68a0cc6
Author: Julien Nabet 
AuthorDate: Thu May 7 22:47:06 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri May 8 11:02:15 2020 +0200

tdf#102625: fix Formula editor breaks surrogate pairs

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

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index ffa93a144efd..124b310ca249 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -49,6 +49,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -3829,6 +3831,13 @@ sal_Int32 ImpEditEngine::GetChar(
 nChar = ( std::abs( nRight - nChar ) < std::abs( 
nLeft - nChar ) ) ? nRight : nLeft;
 }
 }
+else
+{
+OUString aStr(pParaPortion->GetNode()->GetString());
+// tdf#102625: don't select middle of a pair of 
surrogates with mouse cursor
+if (rtl::isSurrogate(aStr[nChar]))
+--nChar;
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-05 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editdbg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1138adc105e18cc0ef6af5de7529fba1723e960b
Author: Caolán McNamara 
AuthorDate: Mon May 4 20:45:30 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 5 09:40:44 2020 +0200

use SfxStyleSheetIterator::Count directly

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

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 3dba4a206b4c..b2753839fad0 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -426,12 +426,12 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool 
bInfoBox )
 
 if ( pEE->pImpEditEngine->GetStyleSheetPool() )
 {
-sal_uInt16 nStyles = pEE->pImpEditEngine->GetStyleSheetPool() ? 
pEE->pImpEditEngine->GetStyleSheetPool()->Count() : 0;
+SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), 
SfxStyleFamily::All );
+sal_uInt16 nStyles = aIter.Count();
 fprintf( fp, 
"\n\n"
 );
 fprintf( fp, "\n==   Stylesheets   
=" );
 fprintf( fp, 
"\n"
 );
 fprintf( fp, "\n#Template:   %" SAL_PRIuUINT32 "\n", 
sal_uInt32(nStyles) );
-SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), 
SfxStyleFamily::All );
 SfxStyleSheetBase* pStyle = aIter.First();
 while ( pStyle )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-27 Thread Vasily Melenchuk (via logerrit)
 editeng/source/items/numitem.cxx |8 -
 include/editeng/numitem.hxx  |3 
 sw/inc/unoprnms.hxx  |1 
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |5 
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx   |   22 ---
 sw/qa/extras/rtfexport/rtfexport.cxx |8 -
 sw/qa/extras/rtfimport/rtfimport.cxx |  156 +--
 sw/source/core/doc/number.cxx|  116 ++---
 sw/source/core/unocore/unosett.cxx   |   15 ++
 sw/source/filter/ww8/wrtw8num.cxx|8 +
 writerfilter/source/dmapper/NumberingManager.cxx |   73 +-
 writerfilter/source/dmapper/NumberingManager.hxx |5 
 writerfilter/source/dmapper/PropertyIds.cxx  |1 
 writerfilter/source/dmapper/PropertyIds.hxx  |1 
 14 files changed, 191 insertions(+), 231 deletions(-)

New commits:
commit 7459b9ecb54a298f02d19089620149718f8d8d48
Author: Vasily Melenchuk 
AuthorDate: Mon Apr 13 11:06:29 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Mon Apr 27 22:36:12 2020 +0200

tdf#116883: sw: support for lists level format string

Multilevel lists are more flexible in case of DOCX. There is
supported custom format for any level in DOCX unlike in LO
and ODT where we are limited only with prefix and suffix
for hardcoded list levels separated by dot. At the same time
DOCX can have lists not only "1.2.3.4", but "1/2/3/4" or even
"1!2>3)4" and such format can vary on each list level.

Here is basic implementation for list format as a core feature
for all documents and old way (prefix-suffix + ".") is left
as fallback.

Practically its usage is currently implemented only in DOCX
import/export.

Some RTF/OOXML unittests were redesigned: since we are not creating
prefix/suffix for these formats conditions should be checked in
a different way.

Change-Id: I1ec58bcc5874d4fa19aee6a1f42bf1671d853b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92106
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 82d511b00715..d6f1769d11ac 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -347,9 +347,10 @@ SvxNumberFormat& SvxNumberFormat::operator=( const 
SvxNumberFormat& rFormat )
 mnListtabPos = rFormat.mnListtabPos;
 mnFirstLineIndent = rFormat.mnFirstLineIndent;
 mnIndentAt = rFormat.mnIndentAt;
-eVertOrient = rFormat.eVertOrient ;
-sPrefix = rFormat.sPrefix ;
-sSuffix = rFormat.sSuffix ;
+eVertOrient = rFormat.eVertOrient;
+sPrefix = rFormat.sPrefix;
+sSuffix = rFormat.sSuffix;
+sListFormat = rFormat.sListFormat;
 aGraphicSize= rFormat.aGraphicSize  ;
 nBulletColor= rFormat.nBulletColor   ;
 nBulletRelSize  = rFormat.nBulletRelSize;
@@ -384,6 +385,7 @@ bool  SvxNumberFormat::operator==( const SvxNumberFormat& 
rFormat) const
 eVertOrient != rFormat.eVertOrient ||
 sPrefix != rFormat.sPrefix ||
 sSuffix != rFormat.sSuffix ||
+sListFormat != rFormat.sListFormat ||
 aGraphicSize!= rFormat.aGraphicSize  ||
 nBulletColor!= rFormat.nBulletColor   ||
 nBulletRelSize  != rFormat.nBulletRelSize ||
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 12686b80b2aa..1b8c4b130463 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -107,6 +107,7 @@ public:
 private:
 OUStringsPrefix;
 OUStringsSuffix;
+OUStringsListFormat;// Format string ">%1.%2<" can be 
used instead of prefix/suffix
 
 SvxAdjust   eNumAdjust;
 
@@ -171,6 +172,8 @@ public:
 const OUString& GetPrefix() const { return sPrefix;}
 voidSetSuffix(const OUString& rSet) { sSuffix = rSet;}
 const OUString& GetSuffix() const { return sSuffix;}
+voidSetListFormat(const OUString& rSet) { sListFormat = rSet; }
+const OUString& GetListFormat() const { return sListFormat; }
 
 voidSetCharFormatName(const OUString& rSet){ 
sCharStyleName = rSet; }
 virtual OUStringGetCharFormatName()const;
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 4e1e565868b7..1f79400bb28a 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -77,6 +77,7 @@
 #define UNO_NAME_ANCHOR_CHAR_STYLE_NAME "AnchorCharStyleName"
 #define UNO_NAME_SUFFIX "Suffix"
 #define UNO_NAME_PREFIX "Prefix"
+#define UNO_NAME_LIST_FORMAT "ListFormat"
 #define UNO_NAME_PARENT_NUMBERING "ParentNumbering"
 #define UNO_NAME_CHAR_FONT_NAME "CharFontName"
 #define UNO_NAME_CHAR_FONT_STYLE_NA

[Libreoffice-commits] core.git: editeng/source include/oox include/sax oox/source sax/CppunitTest_sax_parser.mk sax/qa sax/source sw/source unoxml/CppunitTest_unoxml_domtest.mk unoxml/inc unoxml/qa un

2020-04-25 Thread Noel Grandin (via logerrit)
 editeng/source/misc/SvXMLAutoCorrectTokenHandler.hxx |3 --
 include/oox/core/fasttokenhandler.hxx|4 ---
 include/sax/fastattribs.hxx  |   16 ++-
 oox/source/core/fasttokenhandler.cxx |2 -
 oox/source/crypto/AgileEngine.cxx|8 ++-
 sax/CppunitTest_sax_parser.mk|1 
 sax/qa/cppunit/parser.cxx|7 +-
 sax/qa/cppunit/xmlimport.cxx |3 --
 sax/source/fastparser/fastparser.cxx |   17 +---
 sax/source/tools/fastattribs.cxx |   20 ---
 sax/source/tools/fshelper.cxx|2 -
 sw/source/core/inc/SwXMLBlockImport.hxx  |6 +
 unoxml/CppunitTest_unoxml_domtest.mk |1 
 unoxml/inc/node.hxx  |8 +++
 unoxml/qa/unit/domtest.cxx   |9 ++--
 unoxml/source/dom/document.cxx   |2 -
 xmloff/inc/fasttokenhandler.hxx  |3 --
 xmloff/source/core/xmlimp.cxx|3 --
 18 files changed, 54 insertions(+), 61 deletions(-)

New commits:
commit 0dbc76a3ca25f43232073484541504e342380d0a
Author: Noel Grandin 
AuthorDate: Wed Mar 11 14:19:34 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 25 12:13:26 2020 +0200

make FastParser always take a FastTokenHandlerBase subclass

since most of the call sites already do, and we can skip the
slow path this way.

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

diff --git a/editeng/source/misc/SvXMLAutoCorrectTokenHandler.hxx 
b/editeng/source/misc/SvXMLAutoCorrectTokenHandler.hxx
index a6d858119ae0..69030fd38ab4 100644
--- a/editeng/source/misc/SvXMLAutoCorrectTokenHandler.hxx
+++ b/editeng/source/misc/SvXMLAutoCorrectTokenHandler.hxx
@@ -30,8 +30,7 @@ enum SvXMLAutoCorrectToken : sal_Int32
 NAME = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_NAME//66737
 };
 
-class SvXMLAutoCorrectTokenHandler : public
-cppu::WeakImplHelper< css::xml::sax::XFastTokenHandler >,
+class SvXMLAutoCorrectTokenHandler :
 public sax_fastparser::FastTokenHandlerBase
 {
 public:
diff --git a/include/oox/core/fasttokenhandler.hxx 
b/include/oox/core/fasttokenhandler.hxx
index 62f260fd5f5d..a89186c5218c 100644
--- a/include/oox/core/fasttokenhandler.hxx
+++ b/include/oox/core/fasttokenhandler.hxx
@@ -40,9 +40,7 @@ namespace core {
 that provides access to the tokens generated from the internal token name 
list.
  */
 class OOX_DLLPUBLIC FastTokenHandler final :
-public ::cppu::WeakImplHelper< css::lang::XServiceInfo,
-   css::xml::sax::XFastTokenHandler >,
-public sax_fastparser::FastTokenHandlerBase
+public cppu::ImplInheritanceHelper< sax_fastparser::FastTokenHandlerBase, 
css::lang::XServiceInfo >
 {
 public:
 explicitFastTokenHandler();
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 839f4c2b8cfd..60090f88f2f5 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SAX_FASTATTRIBS_HXX
 
 #include 
+#include 
 
 #include 
 #include 
@@ -49,7 +50,8 @@ struct UnknownAttribute
 typedef std::vector< UnknownAttribute > UnknownAttributeList;
 
 /// A native C++ interface to tokenisation
-class SAX_DLLPUBLIC FastTokenHandlerBase
+class SAX_DLLPUBLIC FastTokenHandlerBase :
+public cppu::WeakImplHelper< css::xml::sax::XFastTokenHandler >
 {
  public:
 virtual ~FastTokenHandlerBase();
@@ -57,24 +59,21 @@ class SAX_DLLPUBLIC FastTokenHandlerBase
 
 /**
  * Client method to attempt the use of this interface if possible.
- * @xTokenHandler - the UNO handle for the token lookup interface
- * @pTokenHandler - a dynamic_cast version of @xTokenHandler to this 
interface
+ * @xTokenHandler - the token lookup interface
  * @pStr - string buffer to lookup
  * @nLength - optional length of chars in that buffer
  *
  * @return Tokenized form of pStr
  */
 static sal_Int32 getTokenFromChars(
- const 
css::uno::Reference &xTokenHandler,
- const FastTokenHandlerBase *pTokenHandler /* can be 
NULL */,
+ const FastTokenHandlerBase *pTokenHandler,
  const char *pStr, size_t nLength );
 };
 
 class SAX_DLLPUBLIC FastAttributeList final : public cppu::WeakImplHelper< 
css::xml::sax::XFastAttributeList >
 {
 public:
-FastAttributeList( const css::uno::Reference< 
css::xml::sax::XFastTokenHandler >& xTokenHandler,
-   FastTokenHandlerBase *pOptHandlerBase = nullptr );
+FastAttributeList( FastT

[Libreoffice-commits] core.git: editeng/source i18nlangtag/source include/i18nlangtag svtools/inc

2020-04-24 Thread Julien Nabet (via logerrit)
 editeng/source/misc/svxacorr.cxx   |4 +--
 i18nlangtag/source/isolang/isolang.cxx |   34 -
 include/i18nlangtag/lang.h |2 -
 svtools/inc/langtab.hrc|2 -
 4 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit c73b98684810d96164f15ec5a3c6e44747c6cde2
Author: Julien Nabet 
AuthorDate: Fri Apr 24 20:04:35 2020 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 24 23:58:39 2020 +0200

Typo: LANGUAGE_ENGLISH_CARRIBEAN->LANGUAGE_ENGLISH_CARIBBEAN

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 4fcdb4d37b8d..1242852d6213 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -301,7 +301,7 @@ ACFlags SvxAutoCorrect::GetDefaultFlags()
 LANGUAGE_ENGLISH_EIRE,
 LANGUAGE_ENGLISH_SAFRICA,
 LANGUAGE_ENGLISH_JAMAICA,
-LANGUAGE_ENGLISH_CARRIBEAN))
+LANGUAGE_ENGLISH_CARIBBEAN))
 nRet &= ~ACFlags(ACFlags::ChgQuotes|ACFlags::ChgSglQuotes);
 return nRet;
 }
@@ -1232,7 +1232,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 LANGUAGE_ENGLISH_EIRE,
 LANGUAGE_ENGLISH_SAFRICA,
 LANGUAGE_ENGLISH_JAMAICA,
-LANGUAGE_ENGLISH_CARRIBEAN))
+LANGUAGE_ENGLISH_CARIBBEAN))
 {
 rDoc.Replace( nInsPos-1, "I" );
 }
diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index 67aedf85763d..5abdc085fb11 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -247,7 +247,7 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_CZECH,   "cs", "CZ", k0},
 { LANGUAGE_CZECH,   "cz", ""  , kSAME },
 { LANGUAGE_ENGLISH_JAMAICA, "en", "JM", k0},
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "en", "BS", k0},// not 
100%, because AG is Bahamas
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "en", "BS", k0},// not 
100%, because AG is Bahamas
 { LANGUAGE_ENGLISH_BELIZE,  "en", "BZ", k0},
 { LANGUAGE_ENGLISH_TRINIDAD,"en", "TT", k0},
 { LANGUAGE_ENGLISH_ZIMBABWE,"en", "ZW", k0},
@@ -872,22 +872,22 @@ static IsoLangEngEntry const aImplIsoLangEngEntries[] =
 { LANGUAGE_ENGLISH_US,  "GU" }, // Guam
 { LANGUAGE_ENGLISH_US,  "MH" }, // Marshall Islands
 { LANGUAGE_ENGLISH_US,  "PW" }, // Palau
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "AI" }, // Anguilla
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "AG" }, // Antigua and 
Barbuda
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "BS" }, // Bahamas
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "BB" }, // Barbados
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "BM" }, // Bermuda
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "KY" }, // Cayman Islands
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "GD" }, // Grenada
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "DM" }, // Dominica
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "HT" }, // Haiti
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "MS" }, // Montserrat
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "FM" }, // Micronesia
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "VC" }, // St. Vincent / 
Grenadines
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "LC" }, // Saint Lucia
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "TC" }, // Turks & Caicos 
Islands
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "GY" }, // Guyana
-{ LANGUAGE_ENGLISH_CARRIBEAN,   "TT" }, // Trinidad and 
Tobago
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "AI" }, // Anguilla
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "AG" }, // Antigua and 
Barbuda
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "BS" }, // Bahamas
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "BB" }, // Barbados
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "BM" }, // Bermuda
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "KY" }, // Cayman Islands
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "GD" }, // Grenada
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "DM" }, // Dominica
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "HT" }, // Haiti
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "MS" }, // Montserrat
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "FM" }, // Micronesia
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "VC" }, // St. Vincent / 
Grenadines
+{ LANGUAGE_ENGLISH_CARIBBEAN,   "LC" }, // 

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

2020-04-23 Thread Dennis Francis (via logerrit)
 editeng/source/editeng/editview.cxx |   10 ++
 editeng/source/editeng/impedit.cxx  |   99 +++-
 editeng/source/editeng/impedit.hxx  |   10 ++
 include/editeng/editview.hxx|2 
 sc/source/ui/inc/gridwin.hxx|   15 
 sc/source/ui/view/gridwin4.cxx  |  125 +---
 sc/source/ui/view/viewdata.cxx  |1 
 7 files changed, 224 insertions(+), 38 deletions(-)

New commits:
commit 0aaf94d75410cb41b572a64935db767f586ffa73
Author: Dennis Francis 
AuthorDate: Tue Apr 14 14:49:23 2020 +0530
Commit: Dennis Francis 
CommitDate: Thu Apr 23 09:35:51 2020 +0200

lokit: fix edit-text/view-cursor position

in case of views with heterogeneous zooms.

1. EditText render position fix

The EditView has an 'output-area' which is used to clip the rectangle
we pass to the Paint() call. It also holds on to the ScGridWindow
instance where the edit started. The 'output-area' of the EditView is in
the coordinates/units of the MapMode of the ScGridWindow it holds. So we
need to temporarily change the MapMode and 'output-area' of the EditView
in agreement to the device(with the current view's zoom settings) where
we are going to paint to. After we call the Paint(), we rollback the
original settings of the EditView.

2. EditViewCursor position fix

Before this change the cursor position in twips (calculated based on
pixel aligned cell position in the view where editing occurred) is
broadcasted to all the client-views. If the clients have different zooms, 
then
simply scaling this common cursor position in the client for its zoom
is not going to be accurate enough (due to the non-linear 
Logic->Pixel->Logic
transformation involving pixel rounding). This is very visible if you are
editing far away from A1 (like Z50).
The fix is to turn off this broadcast for calc-cell editing and send
view specific edit-cursor invalidation messages.

This is accompanied by a online.git patch that removes unnessecary
broadcast of view-cursor invalidation messages which messes up things again.
"Do not broadcast view-cursor invalidation messages"

(cherry picked from commit d58f1e334245f9e136750fbba267c2a941a213cc)

Conflicts:
editeng/source/editeng/impedit.cxx
editeng/source/editeng/impedit.hxx

Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92721
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 531fad3e12c2..34509b4d4e74 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -470,6 +470,16 @@ void EditView::Command( const CommandEvent& rCEvt )
 pImpEditView->Command( rCEvt );
 }
 
+void EditView::SetBroadcastLOKViewCursor(bool bSet)
+{
+pImpEditView->SetBroadcastLOKViewCursor(bSet);
+}
+
+tools::Rectangle EditView::GetEditCursor() const
+{
+return pImpEditView->GetEditCursor();
+}
+
 void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool 
bActivate )
 {
 if ( !pImpEditView->pEditEngine->HasView( this ) )
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index e0ee7a52b24d..b5be152d6ece 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -81,7 +81,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, 
vcl::Window* pWindo
 aOutArea( Point(), pEng->GetPaperSize() ),
 eSelectionMode(EESelectionMode::Std),
 eAnchorMode(EEAnchorMode::TopLeft),
-mpEditViewCallbacks(nullptr)
+mpEditViewCallbacks(nullptr),
+mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive())
 {
 aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM();
 aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM();
@@ -913,6 +914,69 @@ OString buildHyperlinkJSON(const OUString& sText, const 
OUString& sLink)
 
 } // End of anon namespace
 
+tools::Rectangle ImpEditView::ImplGetEditCursor(EditPaM& aPaM, GetCursorFlags 
nShowCursorFlags, sal_Int32& nTextPortionStart,
+const ParaPortion* pParaPortion) const
+{
+tools::Rectangle aEditCursor = 
pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, nShowCursorFlags );
+if ( !IsInsertMode() && !aEditSelection.HasRange() )
+{
+if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < 
aPaM.GetNode()->Len() ) )
+{
+// If we are behind a portion, and the next portion has other 
direction, we must change position...
+aEditCursor.SetLeft( pEditEngine->pImpEditEngine->PaMtoEditCursor( 
aPaM, GetCursorFlags::TextOnly|GetCursorFlags::PreferPortionStart ).Left() );
+

[Libreoffice-commits] core.git: editeng/source extensions/source

2020-04-15 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/editdoc.cxx |5 -
 editeng/source/editeng/eehtml.cxx  |5 -
 editeng/source/items/numitem.cxx   |   19 ++-
 editeng/source/misc/svxacorr.cxx   |   30 --
 editeng/source/rtf/svxrtf.cxx  |5 -
 extensions/source/scanner/sane.cxx |   12 
 6 files changed, 50 insertions(+), 26 deletions(-)

New commits:
commit 52528a42892dbe7da7aad3bcf52971e02ec55999
Author: Noel Grandin 
AuthorDate: Wed Apr 15 09:02:32 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 15 14:01:15 2020 +0200

loplugin:buriedassign in e*

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

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 6fa39bbddaf4..ebc55808da25 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -665,7 +665,10 @@ sal_Int32 FastGetPos(const Array& rArray, const Val* p, 
sal_Int32& rLastPos)
 // The world's lamest linear search from svarray...
 for (sal_Int32 nIdx = 0; nIdx < nArrayLen; ++nIdx)
 if (rArray.at(nIdx).get() == p)
-return rLastPos = nIdx;
+{
+rLastPos = nIdx;
+return rLastPos;
+}
 
 // XXX "not found" condition for sal_Int32 indexes
 return EE_PARA_NOT_FOUND;
diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index ff84bfe4a260..ce5721787ef3 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -669,8 +669,11 @@ void EditHTMLParser::SkipGroup( HtmlTokenId nEndToken )
 // for example:lacks a closing 
 sal_uInt8 nCellLevel = nInCell;
 HtmlTokenId nToken;
-while( nCellLevel <= nInCell && ( (nToken = GetNextToken() ) != nEndToken 
) && nToken != HtmlTokenId::NONE )
+while( nCellLevel <= nInCell )
 {
+nToken = GetNextToken();
+if (nToken == nEndToken || nToken == HtmlTokenId::NONE)
+break;
 switch ( nToken )
 {
 case HtmlTokenId::TABLEHEADER_ON:
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index ca26e800f9f0..7f76e830ff25 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -894,16 +894,17 @@ void SvxNumRule::UnLinkGraphics()
 const SvxBrushItem* pBrush = aFmt.GetBrush();
 if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
 {
-const Graphic* pGraphic = nullptr;
-if(pBrush &&
-!pBrush->GetGraphicLink().isEmpty() &&
-nullptr != (pGraphic = pBrush->GetGraphic()))
+if(pBrush && !pBrush->GetGraphicLink().isEmpty())
 {
-SvxBrushItem aTempItem(*pBrush);
-aTempItem.SetGraphicLink("");
-aTempItem.SetGraphic(*pGraphic);
-sal_Int16eOrient = aFmt.GetVertOrient();
-aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), 
&eOrient );
+const Graphic* pGraphic = pBrush->GetGraphic();
+if (pGraphic)
+{
+SvxBrushItem aTempItem(*pBrush);
+aTempItem.SetGraphicLink("");
+aTempItem.SetGraphic(*pGraphic);
+sal_Int16eOrient = aFmt.GetVertOrient();
+aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), 
&eOrient );
+}
 }
 }
 else if((SVX_NUM_BITMAP|LINK_TOKEN) == 
static_cast(aFmt.GetNumberingType()))
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 4ea7eb901a97..4fcdb4d37b8d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -661,8 +661,12 @@ bool SvxAutoCorrect::FnAddNonBrkSpace(
 // Get the last word delimiter position
 sal_Int32 nSttWdPos = nEndPos;
 bool bWasWordDelim = false;
-while( nSttWdPos && !(bWasWordDelim = IsWordDelim( rTxt[ 
--nSttWdPos ])))
-;
+while( nSttWdPos )
+{
+bWasWordDelim = IsWordDelim( rTxt[ --nSttWdPos ]);
+if (bWasWordDelim)
+break;
+}
 
 //See if the text is the start of a protocol string, e.g. have 
text of
 //"http" see if it is the start of "http:" and if so leave it alone
@@ -898,8 +902,12 @@ void SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 {
 if (NonFieldWordDelim(*pStr))
 {
-while (!(bAtStart = (pStart == pStr--)) && 
NonFieldWordDelim(*pStr))
-;
+for (;;)
+{
+bAtStart = (pStart == pStr--);
+if (bAtStart || !NonFieldWordDelim(*pStr))
+   

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

2020-04-14 Thread Noel Grandin (via logerrit)
 editeng/source/accessibility/AccessibleContextBase.cxx  |   98 -
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |  106 -
 editeng/source/accessibility/AccessibleImageBullet.cxx  |   24 
 editeng/source/editeng/editdoc.cxx  |   22 
 editeng/source/editeng/editeng.cxx  |  150 +-
 editeng/source/editeng/editobj.cxx  |   40 
 editeng/source/editeng/editview.cxx |  550 +-
 editeng/source/editeng/eehtml.cxx   |   66 -
 editeng/source/editeng/impedit.cxx  |  649 +---
 editeng/source/editeng/impedit2.cxx |  354 +++---
 editeng/source/editeng/impedit3.cxx |  256 ++--
 editeng/source/editeng/impedit4.cxx |  355 +++---
 editeng/source/editeng/impedit5.cxx |   68 -
 editeng/source/items/legacyitem.cxx |   64 -
 editeng/source/items/numitem.cxx|   48 
 editeng/source/items/svxfont.cxx|   28 
 editeng/source/misc/acorrcfg.cxx|  431 +++
 editeng/source/misc/hangulhanja.cxx |  158 +-
 editeng/source/misc/splwrap.cxx |   26 
 editeng/source/misc/svxacorr.cxx|   64 -
 editeng/source/misc/txtrange.cxx|   55 -
 editeng/source/misc/unolingu.cxx|   22 
 editeng/source/outliner/outleeng.cxx|   26 
 editeng/source/outliner/outliner.cxx|  414 +++
 editeng/source/outliner/outlvw.cxx  |   44 
 editeng/source/rtf/rtfitem.cxx  |  168 +--
 editeng/source/rtf/svxrtf.cxx   |  276 ++---
 editeng/source/uno/unoedhlp.cxx |  104 -
 editeng/source/uno/unotext.cxx  |  413 +++
 editeng/source/uno/unotext2.cxx |   86 -
 30 files changed, 2580 insertions(+), 2585 deletions(-)

New commits:
commit d72f963c0de0c2e48f1dc999cd8687e13a1f676f
Author: Noel Grandin 
AuthorDate: Tue Apr 14 15:58:10 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 14 20:45:59 2020 +0200

loplugin:flatten in editeng

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

diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx 
b/editeng/source/accessibility/AccessibleContextBase.cxx
index d99cfa031d76..72ac002c9940 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -347,19 +347,19 @@ lang::Locale SAL_CALL
 void SAL_CALL AccessibleContextBase::addAccessibleEventListener (
 const uno::Reference& rxListener)
 {
-if (rxListener.is())
+if (!rxListener.is())
+return;
+
+if (rBHelper.bDisposed || rBHelper.bInDispose)
 {
-if (rBHelper.bDisposed || rBHelper.bInDispose)
-{
-uno::Reference x (static_cast(this), uno::UNO_QUERY);
-rxListener->disposing (lang::EventObject (x));
-}
-else
-{
-if (!mnClientId)
-mnClientId = 
comphelper::AccessibleEventNotifier::registerClient( );
-comphelper::AccessibleEventNotifier::addEventListener( mnClientId, 
rxListener );
-}
+uno::Reference x (static_cast(this), uno::UNO_QUERY);
+rxListener->disposing (lang::EventObject (x));
+}
+else
+{
+if (!mnClientId)
+mnClientId = comphelper::AccessibleEventNotifier::registerClient( 
);
+comphelper::AccessibleEventNotifier::addEventListener( mnClientId, 
rxListener );
 }
 }
 
@@ -368,18 +368,18 @@ void SAL_CALL 
AccessibleContextBase::removeAccessibleEventListener (
 const uno::Reference& rxListener )
 {
 ThrowIfDisposed ();
-if (rxListener.is() && mnClientId)
+if (!(rxListener.is() && mnClientId))
+return;
+
+sal_Int32 nListenerCount = 
comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, 
rxListener );
+if ( !nListenerCount )
 {
-sal_Int32 nListenerCount = 
comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, 
rxListener );
-if ( !nListenerCount )
-{
-// no listeners anymore
-// -> revoke ourself. This may lead to the notifier thread dying 
(if we were the last client),
-// and at least to us not firing any events anymore, in case 
somebody calls
-// NotifyAccessibleEvent, again
-comphelper::AccessibleEventNotifier::revokeClient( mnClientId );
-mnClientId = 0;
-}
+// 

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

2020-04-12 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/impedit3.cxx |2 +-
 editeng/source/misc/txtrange.cxx|   28 ++--
 include/editeng/txtrange.hxx|   24 +++-
 sw/source/core/text/txtfly.cxx  |2 +-
 4 files changed, 27 insertions(+), 29 deletions(-)

New commits:
commit f6a1859704bf7f29d6cb55e37ac82affba9da1e5
Author: Noel Grandin 
AuthorDate: Sun Apr 12 13:22:20 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Apr 12 14:55:42 2020 +0200

small cleanups in TextRanger

- no need for mpPolyPolygon to be allocated out of line.
- expand out LongDqPtr typedef, not much longer and makes the code
easier to read
- allocate mpBound inline using std::optional
- rename RangeCache to RangeCacheItem

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

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 05ab3ccf6823..b9a33ceec64d 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -809,7 +809,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 long nTmpWidth = 0;
 long nXWidth = nMaxLineWidth;
 
-LongDqPtr pTextRanges = nullptr;
+std::deque* pTextRanges = nullptr;
 long nTextExtraYOffset = 0;
 long nTextXOffset = 0;
 long nTextLineHeight = 0;
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index cc4417498721..42d674c42780 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -31,6 +31,7 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& 
rPolyPolygon,
 const basegfx::B2DPolyPolygon* pLinePolyPolygon,
 sal_uInt16 nCacheSz, sal_uInt16 nLft, sal_uInt16 nRght,
 bool bSimpl, bool bInnr, bool bVert ) :
+maPolyPolygon( rPolyPolygon.count() ),
 nCacheSize( nCacheSz ),
 nRight( nRght ),
 nLeft( nLft ),
@@ -42,13 +43,12 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& 
rPolyPolygon,
 bVertical( bVert )
 {
 sal_uInt32 nCount(rPolyPolygon.count());
-mpPolyPolygon.reset( new tools::PolyPolygon( 
static_cast(nCount) ) );
 
 for(sal_uInt32 i(0); i < nCount; i++)
 {
 const basegfx::B2DPolygon 
aCandidate(rPolyPolygon.getB2DPolygon(i).getDefaultAdaptiveSubdivision());
 nPointCount += aCandidate.count();
-mpPolyPolygon->Insert( tools::Polygon(aCandidate), 
static_cast(i) );
+maPolyPolygon.Insert( tools::Polygon(aCandidate), 
static_cast(i) );
 }
 
 if( pLinePolyPolygon )
@@ -93,7 +93,7 @@ namespace {
 class SvxBoundArgs
 {
 std::vector aBoolArr;
-LongDqPtr pLongArr;
+std::deque* pLongArr;
 TextRanger *pTextRanger;
 long nMin;
 long nMax;
@@ -126,7 +126,7 @@ class SvxBoundArgs
 long A( const Point& rP ) const { return bRotate ? rP.Y() : rP.X(); }
 long B( const Point& rP ) const { return bRotate ? rP.X() : rP.Y(); }
 public:
-SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong, const Range& rRange );
+SvxBoundArgs( TextRanger* pRanger, std::deque* pLong, const Range& 
rRange );
 void NotePoint( const long nA ) { NoteMargin( nA - nStart, nA + nEnd ); }
 void NoteMargin( const long nL, const long nR )
 { if( nMin > nL ) nMin = nL; if( nMax < nR ) nMax = nR; }
@@ -142,7 +142,7 @@ public:
 
 }
 
-SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong,
+SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, std::deque* pLong,
 const Range& rRange )
 : pLongArr(pLong)
 , pTextRanger(pRanger)
@@ -489,7 +489,7 @@ void SvxBoundArgs::Concat( const tools::PolyPolygon* pPoly )
 {
 SetConcat( true );
 DBG_ASSERT( pPoly, "Nothing to do?" );
-LongDqPtr pOld = pLongArr;
+std::deque* pOld = pLongArr;
 pLongArr = new std::deque;
 aBoolArr.clear();
 bInner = false;
@@ -631,7 +631,7 @@ void SvxBoundArgs::NoteUpLow( long nA, const sal_uInt8 
nArea )
 }
 }
 
-LongDqPtr TextRanger::GetTextRanges( const Range& rRange )
+std::deque* TextRanger::GetTextRanges( const Range& rRange )
 {
 DBG_ASSERT( rRange.Min() || rRange.Max(), "Zero-Range not allowed, Bye 
Bye" );
 //Can we find the result we need in the cache?
@@ -641,23 +641,23 @@ LongDqPtr TextRanger::GetTextRanges( const Range& rRange )
 return &(elem.results);
 }
 //Calculate a new result
-RangeCache rngCache(rRange);
+RangeCacheItem rngCache(rRange);
 SvxBoundArgs aArg( this, &(rngCache.results), rRange );
-aArg.Calc( *mpPolyPolygon );
+aArg.Calc( maPolyPolygon );
 if( mpLinePolyPolygon )
 aArg.Concat( mpLinePolyPolygon.get() );
 //Add new result to the cache
-mRangeCache.push_back(rngCache);
+mRangeCache.push_back(std::move(rngCache));
 if (m

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

2020-04-03 Thread Justin Luth (via logerrit)
 editeng/source/editeng/editattr.cxx |8 ++--
 editeng/source/editeng/editdoc.cxx  |6 +-
 editeng/source/editeng/impedit4.cxx |   14 --
 editeng/source/items/svxfont.cxx|   31 +++
 include/editeng/svxfont.hxx |2 ++
 5 files changed, 48 insertions(+), 13 deletions(-)

New commits:
commit 0f29d36aa9e6ac7d0914a6e1749c16ecec216904
Author: Justin Luth 
AuthorDate: Sat Mar 14 14:45:39 2020 +0300
Commit: Miklos Vajna 
CommitDate: Fri Apr 3 10:04:56 2020 +0200

tdf#80194 autoEsc: use fontmetrics in calculation

This replaces the previous 7.0 patch in
commit 2940d1905b921d9909b08b1e32014d3c44474ef0
where the following is still true:
THIS WILL CHANGE THE POSITION OF EDITENG SUBSCRIPTS
AND SUPERSCRIPTS IN EXISTING DOCUMENTS!
That is because they were very poorly placed
before - using a formula that is very different
from how Writer does it. Everyone in the bug reports
indicates that Writer does it good, but Impress
does it really bad. (tdf#89849, tdf#63083).

Instead of using the previous patch's 80%/20%
generalization, copy Writer's use of the actual
ascent and descent of the font to determine
the best position for the subscript or superscript.

Change-Id: I0f10f6174b0709f3bc3b9acdc54b7b1fd59c5ee2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90489
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Tested-by: Justin Luth 

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index a99e4d496f74..e48445c27c30 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -266,17 +266,13 @@ EditCharAttribEscapement::EditCharAttribEscapement( const 
SvxEscapementItem& rAt
 assert(rAttr.Which() == EE_CHAR_ESCAPEMENT);
 }
 
-void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* )
+void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
 {
 sal_uInt16 const nProp = static_cast(GetItem())->GetProportionalHeight();
 rFont.SetPropr( static_cast(nProp) );
 
 short nEsc = static_cast(GetItem())->GetEsc();
-if ( nEsc == DFLT_ESC_AUTO_SUPER )
-nEsc =  .8 * (100 - nProp);
-else if ( nEsc == DFLT_ESC_AUTO_SUB )
-nEsc =  .2 * -(100 - nProp);
-rFont.SetEscapement( nEsc );
+rFont.SetNonAutoEscapement( nEsc, pOutDev );
 }
 
 
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 42fc1f3cc22c..9e9eb17e6177 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2007,11 +2007,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, 
bool bSearchInParent, S
 rFont.SetPropr( static_cast(nProp) );
 
 short nEsc = rEsc.GetEsc();
-if ( nEsc == DFLT_ESC_AUTO_SUPER )
-nEsc = .8 * (100 - nProp);
-else if ( nEsc == DFLT_ESC_AUTO_SUB )
-nEsc = .2 * -(100 - nProp);
-rFont.SetEscapement( nEsc );
+rFont.SetNonAutoEscapement( nEsc );
 }
 if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == 
SfxItemState::SET ) )
 rFont.SetKerning( rSet.Get( EE_CHAR_PAIRKERNING ).GetValue() ? 
FontKerning::FontSpecific : FontKerning::NONE );
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 25d7ecc0aa8a..050eed8667f4 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -69,6 +69,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -928,14 +929,23 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& 
rItem, SvStream& rOutput,
 sal_uInt16 const nProp = static_cast(rItem).GetProportionalHeight();
 sal_uInt16 nProp100 = nProp*100;// For SWG-Token Prop in 100th 
percent.
 short nEsc = static_cast(rItem).GetEsc();
+const FontMetric& rFontMetric = GetRefDevice()->GetFontMetric();
+double fFontHeight = rFontMetric.GetAscent() + 
rFontMetric.GetDescent();
+double fAutoAscent = .8;
+double fAutoDescent = .2;
+if ( fFontHeight )
+{
+fAutoAscent = rFontMetric.GetAscent() / fFontHeight;
+fAutoDescent = rFontMetric.GetDescent() / fFontHeight;
+}
 if ( nEsc == DFLT_ESC_AUTO_SUPER )
 {
-nEsc =  .8 * (100 - nProp);
+nEsc =  fAutoAscent * (100 - nProp);
 nProp100++; // A 1 afterwards means 'automatic'.
 }
 else if ( nEsc == DFLT_ESC_AUTO_SUB )
 {
-nEsc =  .2 * -(100 - nProp);
+nEsc =  fAutoDescent * -(100 - nProp);
 nProp100++;
 }
 // SWG:
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/sv

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

2020-03-30 Thread Johnny_M (via logerrit)
 editeng/source/misc/svxacorr.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1422466fcbd4f1dc716d5680e220f0a0538a9f35
Author: Johnny_M 
AuthorDate: Fri Mar 27 13:23:48 2020 +0100
Commit: Michael Weghorn 
CommitDate: Mon Mar 30 11:51:44 2020 +0200

Translate German variable names

Ende -> End

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

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 6fffdb37f1b0..724902d31120 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1558,7 +1558,7 @@ OUString 
SvxAutoCorrect::GetPrevAutoCorrWord(SvxAutoCorrDoc const& rDoc, const O
 if( !nPos )
 return sRet;
 
-sal_Int32 nEnde = nPos;
+sal_Int32 nEnd = nPos;
 
 // it must be followed by a blank or tab!
 if( ( nPos < rTxt.getLength() &&
@@ -1576,20 +1576,20 @@ OUString 
SvxAutoCorrect::GetPrevAutoCorrWord(SvxAutoCorrDoc const& rDoc, const O
 --nCapLttrPos;  // Beginning of pargraph and no Blank!
 
 while( lcl_IsInAsciiArr( sImplSttSkipChars, rTxt[ nCapLttrPos ]) )
-if( ++nCapLttrPos >= nEnde )
+if( ++nCapLttrPos >= nEnd )
 return sRet;
 
-if( 3 > nEnde - nCapLttrPos )
+if( 3 > nEnd - nCapLttrPos )
 return sRet;
 
 const LanguageType eLang = GetDocLanguage( rDoc, nCapLttrPos );
 
 CharClass& rCC = GetCharClass(eLang);
 
-if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nEnde ))
+if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nEnd ))
 return sRet;
 
-sRet = rTxt.copy( nCapLttrPos, nEnde - nCapLttrPos );
+sRet = rTxt.copy( nCapLttrPos, nEnd - nCapLttrPos );
 return sRet;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-18 Thread Andrea Gelmini (via logerrit)
 editeng/source/editeng/editview.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 08ee22ba5b9e42c8f1834a816b7e41c8166aa637
Author: Andrea Gelmini 
AuthorDate: Tue Mar 17 23:08:15 2020 +0100
Commit: Julien Nabet 
CommitDate: Wed Mar 18 22:13:41 2020 +0100

Fix typo

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index e8a2b3dce0d0..bbe64366e408 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -857,7 +857,7 @@ static void LOKSendSpellPopupMenu(Menu* pMenu, LanguageType 
nGuessLangWord,
 if (!comphelper::LibreOfficeKit::isActive())
 return;
 
-// First we need to set item commends for the context menu.
+// First we need to set item commands for the context menu.
 OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
 OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng sd/sdi sd/source

2020-03-17 Thread Tamás Zolnai (via logerrit)
 editeng/source/editeng/editview.cxx |5 +
 include/editeng/editview.hxx|1 +
 sd/sdi/_docsh.sdi   |6 ++
 sd/source/ui/docshell/docshel3.cxx  |   21 +
 4 files changed, 33 insertions(+)

New commits:
commit 268327c2fb37ff553a2c348a6beca4e309b0653f
Author: Tamás Zolnai 
AuthorDate: Mon Mar 16 17:14:33 2020 +0100
Commit: Tamás Zolnai 
CommitDate: Tue Mar 17 11:17:09 2020 +0100

sd lok: Implement execution of SID_SPELLCHECK_IGNORE_ALL

Used by online spellchecking context menu.

Change-Id: Iad3dafedbfed1605ba06f7f87ed91117c9b1a8e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90597
Tested-by: Tamás Zolnai 
Reviewed-by: Tamás Zolnai 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 655a0ec370db..e8a2b3dce0d0 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1198,6 +1198,11 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkSpellIgnoreWord();
+}
+
 void EditView::SelectCurrentWord( sal_Int16 nWordType )
 {
 EditSelection aCurSel( pImpEditView->GetEditSelection() );
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 6fb972182357..fdbfd8a08fff 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -270,6 +270,7 @@ public:
 boolIsCursorAtWrongSpelledWord();
 boolIsWrongSpelledWordAtPos( const Point& rPosPixel, bool 
bMarkIfWrong = false );
 voidExecuteSpellPopup( const Point& rPosPixel, 
Link const * pCallBack );
+OUStringSpellIgnoreWord();
 
 voidInsertField( const SvxFieldItem& rFld );
 const SvxFieldItem* GetFieldUnderMousePointer() const;
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 29db81db02d2..8644b752702c 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -77,5 +77,11 @@ interface DrawDocument
 ExecMethod = Execute;
 StateMethod = GetState;
 ]
+
+SID_SPELLCHECK_IGNORE_ALL
+[
+ExecMethod = Execute ;
+StateMethod = GetState ;
+]
 }
 
diff --git a/sd/source/ui/docshell/docshel3.cxx 
b/sd/source/ui/docshell/docshel3.cxx
index 8f1c597328a2..66b0daaa0736 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -360,6 +360,27 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 Broadcast(SfxHint(SfxHintId::LanguageChanged));
 }
 break;
+case SID_SPELLCHECK_IGNORE_ALL:
+{
+SdrView* pSdrView = mpViewShell->GetDrawView();
+if (!pSdrView)
+return;
+
+EditView& rEditView = 
pSdrView->GetTextEditOutlinerView()->GetEditView();
+OUString sIgnoreText;
+const SfxStringItem* pItem2 = 
rReq.GetArg(FN_PARAM_1);
+if (pItem2)
+sIgnoreText = pItem2->GetValue();
+
+const OUString sSpellingType("Spelling");
+if(sIgnoreText == sSpellingType)
+{
+ESelection aOldSel = rEditView.GetSelection();
+rEditView.SpellIgnoreWord();
+rEditView.SetSelection( aOldSel );
+}
+}
+break;
 
 case SID_NOTEBOOKBAR:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-17 Thread Tamás Zolnai (via logerrit)
 editeng/source/editeng/editview.cxx |   49 +++-
 1 file changed, 48 insertions(+), 1 deletion(-)

New commits:
commit d7fa4fc8b64769f0d25b87ff33b8d1b8e96572d9
Author: Tamás Zolnai 
AuthorDate: Mon Mar 16 15:49:29 2020 +0100
Commit: Tamás Zolnai 
CommitDate: Tue Mar 17 11:08:21 2020 +0100

lok: Send spelling popup menu structure for mobile (calc and impress).

Similar to how writer behaves. Instead of using tunneling,
we send the menu structure with the commands.
By now this commands are not executed by the document shell
of calc / impress. I'll implement that in separate commits.


Change-Id: If342c83143a9a7c2ec74b99027f6d4ba8b44ef08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90595
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 3848553cf4d9..655a0ec370db 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -66,6 +66,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -848,6 +851,41 @@ bool EditView::IsWrongSpelledWordAtPos( const Point& 
rPosPixel, bool bMarkIfWron
 return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
 }
 
+static void LOKSendSpellPopupMenu(Menu* pMenu, LanguageType nGuessLangWord,
+  LanguageType nGuessLangPara, sal_uInt16 
nSuggestions)
+{
+if (!comphelper::LibreOfficeKit::isActive())
+return;
+
+// First we need to set item commends for the context menu.
+OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
+OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
+
+pMenu->SetItemCommand(pMenu->GetItemId("ignore"), 
".uno:SpellCheckIgnoreAll?Type:string=Spelling");
+pMenu->SetItemCommand(MN_WORDLANGUAGE, 
".uno:LanguageStatus?Language:string=Current_" + aTmpWord);
+pMenu->SetItemCommand(MN_PARALANGUAGE, 
".uno:LanguageStatus?Language:string=Paragraph_" + aTmpPara);
+
+for(int i = 0; i < nSuggestions; ++i)
+{
+sal_uInt16 nItemId = MN_ALTSTART + i;
+OUString sCommandString = 
".uno:SpellCheckApplySuggestion?ApplyRule:string=Spelling_" + 
pMenu->GetItemText(nItemId);
+pMenu->SetItemCommand(nItemId, sCommandString);
+}
+
+// Then we generate the menu structure and send it to the client code.
+if (SfxViewShell* pViewShell = SfxViewShell::Current())
+{
+boost::property_tree::ptree aMenu = 
SfxDispatcher::fillPopupMenu(pMenu);
+boost::property_tree::ptree aRoot;
+aRoot.add_child("menu", aMenu);
+
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aRoot, true);
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, 
aStream.str().c_str());
+return;
+ }
+}
+
 void EditView::ExecuteSpellPopup( const Point& rPosPixel, 
Link const * pCallBack )
 {
 Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
@@ -1032,7 +1070,16 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkSetLOKNotifier(SfxViewShell::Current());
+{
+// For mobile, send the context menu structure
+if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+{
+LOKSendSpellPopupMenu(aPopupMenu, nGuessLangWord, 
nGuessLangPara, nWords);
+return;
+}
+else // For desktop, we use the tunneled dialog
+aPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+}
 sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), 
aTempRect, PopupMenuFlags::NoMouseUpClose);
 
 aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng sd/qa

2020-03-15 Thread Ashod Nakashian (via logerrit)
 editeng/source/editeng/editeng.cxx   |9 -
 editeng/source/editeng/editview.cxx  |2 
 editeng/source/editeng/impedit3.cxx  |6 
 editeng/source/outliner/outliner.cxx |7 -
 include/editeng/editeng.hxx  |6 
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  185 ++-
 6 files changed, 203 insertions(+), 12 deletions(-)

New commits:
commit 8c3af6240d5765fb8954025226477670e1d2a7c7
Author: Ashod Nakashian 
AuthorDate: Sun Mar 1 14:08:20 2020 -0500
Commit: Ashod Nakashian 
CommitDate: Sun Mar 15 18:50:08 2020 +0100

editeng: lok: send cursor visibility event when restoring update mode

When the default text is removed from a TextBox within a slide,
the cursor visibility is inadvertendly set to false and never
restored (because the LOK notification is disabled due to treating
the ShowCursor during SetUpdateMode as an activation of the TextBox,
and that is supressed to avoid messing up the cursor when creating
a new view).

We add a new flag to SetUpdateMode to flag whether this is an
activation or we are restoring a previously active window (TextBox)
due to a temporary disabling (to clear the default text).

Four unit-tests added not just to check and validate the fix,
but to also simulate two different ways of entering edit mode,
first by single-clicking on the text and then double-clicking
outside the text, but within the TextBox.

Change-Id: Icaaabc2a897f614f5ce162b71fadccff22ecda02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90301
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 6b84dfabbb5f6930f9ac582f8c1dd9f467fd068c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90298
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 9871e502316f..5a6aee022a80 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1449,11 +1449,14 @@ sal_uInt32 EditEngine::CalcTextWidth()
 return nWidth;
 }
 
-void EditEngine::SetUpdateMode( bool bUpdate )
+void EditEngine::SetUpdateMode(bool bUpdate, bool bRestoring)
 {
 pImpEditEngine->SetUpdateMode( bUpdate );
-if ( pImpEditEngine->pActiveView )
-pImpEditEngine->pActiveView->ShowCursor( false, false, 
/*bActivate=*/true );
+if (pImpEditEngine->pActiveView)
+{
+// Not an activation if we are restoring the previous update mode.
+pImpEditEngine->pActiveView->ShowCursor(false, false, 
/*bActivate=*/!bRestoring);
+}
 }
 
 bool EditEngine::GetUpdateMode() const
diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 315f9ef6716f..3848553cf4d9 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -482,7 +482,7 @@ void EditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor, bool bActivat
 if (pParent && pParent->GetLOKWindowId() != 0)
 return;
 
-OString aPayload = OString::boolean(true);
+static const OString aPayload = OString::boolean(true);
 
pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE,
 aPayload.getStr());
 
pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, 
"visible", aPayload);
 }
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 6ec2a6152ee6..05ab3ccf6823 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3939,12 +3939,12 @@ EditPaM ImpEditEngine::ConnectContents( sal_Int32 
nLeftNode, bool bBackward )
 
 void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, bool 
bForceUpdate )
 {
-bool bChanged = ( GetUpdateMode() != bUp );
+const bool bChanged = (GetUpdateMode() != bUp);
 
-// When switching from sal_True to sal_False, all selections were visible,
+// When switching from true to false, all selections were visible,
 // => paint over
 // the other hand, were all invisible => paint
-// If !bFormatted, e.g. after SetText, then if UpdateMode=sal_True
+// If !bFormatted, e.g. after SetText, then if UpdateMode=true
 // formatting is not needed immediately, probably because more text is 
coming.
 // At latest it is formatted at a Paint/CalcTextWidth.
 bUpdate = bUp;
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 072851d2702f..f7f8cc316ad1 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -399,7 +399,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* 
pPara )
 {
 DBG_ASSERT(pPara,"SetText:No Para");
 
-sal_Int32 nPara = pParaList->GetAbsPos( pPara );
+const sal_Int32 nPara = pPa

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

2020-03-12 Thread Justin Luth (via logerrit)
 editeng/source/items/svxfont.cxx|8 
 svx/source/svdraw/svdotextdecomposition.cxx |7 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 888cff8bb0326153415b1d64d1ca6a45ac3ae84c
Author: Justin Luth 
AuthorDate: Wed Feb 19 08:49:07 2020 +0300
Commit: Justin Luth 
CommitDate: Fri Mar 13 05:33:10 2020 +0100

tdf#80194 proof search: assert to find proof of code correctness.

I'm sure that these functions need to change because they
just seem very wrong. I think these are fall-back, safety
sections because usually the nEsc is already converted
away from _AUTO_ prior to reaching this point.

But this is all just based on code-reading.
It would be nice to have proof of this - especially
since the values for subscript are unexpected. I would
have expected it to use a value comparable to DFLT_ESC_SUB,
and not some random/magical -20.

(Note: the _AUTO_SUPER historically refered to an absolute 33
and not DFLT_ESC_SUPER until I recently changed that...)

Change-Id: I3bef0841f9a20f09994b2372e9a7db5941b29c9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88997
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 891f3e2ab7c0..a8792df4c729 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -510,9 +510,17 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* 
pPrinter,
 {
 short nTmpEsc;
 if( DFLT_ESC_AUTO_SUPER == nEsc )
+{
+nTmpEsc = .8 * (100 - nPropr);
+assert (nTmpEsc == DFLT_ESC_SUPER && "I'm sure this formula needs 
to be changed, but how to confirm that???");
 nTmpEsc = DFLT_ESC_SUPER;
+}
 else if( DFLT_ESC_AUTO_SUB == nEsc )
+{
+nTmpEsc = .2 * -(100 - nPropr);
+assert (nTmpEsc == -20 && "I'm sure this formula needs to be 
changed, but how to confirm that???");
 nTmpEsc = -20;
+}
 else
 nTmpEsc = nEsc;
 Size aSize = GetFontSize();
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 36734264f185..8769b16b8ddc 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -171,7 +171,8 @@ namespace
 aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY());
 
 // look for proportional font scaling, if necessary, scale accordingly
-if(100 != rInfo.mrFont.GetPropr())
+sal_Int8 nPropr(rInfo.mrFont.GetPropr());
+if(100 != nPropr)
 {
 const double fFactor(rInfo.mrFont.GetPropr() / 100.0);
 aNewTransform.scale(fFactor, fFactor);
@@ -190,10 +191,14 @@ namespace
 
 if(DFLT_ESC_AUTO_SUPER == nEsc)
 {
+nEsc = .8 * (100 - nPropr);
+assert (nEsc == DFLT_ESC_SUPER && "I'm sure this formula needs 
to be changed, but how to confirm that???");
 nEsc = DFLT_ESC_SUPER;
 }
 else if(DFLT_ESC_AUTO_SUB == nEsc)
 {
+nEsc = .2 * -(100 - nPropr);
+assert (nEsc == -20 && "I'm sure this formula needs to be 
changed, but how to confirm that???");
 nEsc = -20;
 }
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 67745700cc04..45d7c26addeb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -273,7 +273,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript2, 
"tdf99602_charStyleSu
 // subscript custom: Proportional size is 80%, lower by 25%.
 uno::Reference 
xStyle(getStyles("CharacterStyles")->getByName("subscript custom"), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("CharStyle has 12pt font size", 12.f, 
getProperty(xStyle, "CharHeight"));
-// subscript larger font: Proportional size is 80%, lowered by 
DFLT_ESC_SUB_AUTO
+// subscript larger font: Proportional size is 80%, lowered by 
DFLT_ESC_AUTO_SUB
 xStyle.set(getStyles("CharacterStyles")->getByName("subscript larger 
font"), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Auto CharStyle has 12pt font size", 12.f, 
getProperty(xStyle, "CharHeight"));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-11 Thread Justin Luth (via logerrit)
 editeng/source/editeng/impedit3.cxx |7 +++
 svx/source/svdraw/svdotextdecomposition.cxx |8 
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit ba09d436dfd1f0b07b95aad3d375e7cd7318440b
Author: Justin Luth 
AuthorDate: Fri Feb 21 14:21:08 2020 +0300
Commit: Justin Luth 
CommitDate: Wed Mar 11 20:28:09 2020 +0100

tdf#89849 editeng: adjust escapement before resetting Propr

THIS IS A LAYOUT REGRESSION FIX FOR SUBSCRIPTS/SUPERSCRIPTS.

The position of subscripts and superscripts is a percentage
based on the 100% fontsize. When LO 4.1 tricked the font
into thinking it was 100%, it failed to adjust the escapement
to be relative to the new fake size. In the default case,
this meant that the superscript was only raised about half
as much as it should have.

THIS CHANGE WILL AFFECT EXISTING DOCUMENTS WHERE THE
TEXTBOX IS SET TO "AUTOFIT THE TEXT". This will primarily
be Impress documents, since many of the templates enable
autofit text.

As a result of this bug, users creating new documents since
4.1 using autofit-text will have specified highly exaggerated
subscript/superscript positioning in order to look nice.
This fix will expose the exaggerated percentages and make the
document look poor. I don't know how that can be avoided.

Nor do I know how to create a unit test for a layout bug.
I guess QA's PDF compare tests will suffice for this. A
clearly exaggerated unit test is attached to the bug report.

The new ability to have a larger-than-100% escapement in
LO 6.3 comes in handy here, so that small superscripts can
gain a fake escapment big enough to put them in the proper
position.

Change-Id: I0f8dcff8741eb05d8657235930a4eb684629b9d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89214
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Jan Holesovsky 

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 9e82076b1c99..6ec2a6152ee6 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -30,6 +30,7 @@
 #include "impedit.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2757,6 +2758,12 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, 
sal_Int32 nPos, SvxFont& rFo
 rFont.SetPhysFont( pDev );
 FontMetric aMetric( pDev->GetFontMetric() );
 
+// before forcing nPropr to 100%, calculate a new escapement relative 
to this fake size.
+sal_uInt8 nPropr = rFont.GetPropr();
+sal_Int16 nEsc = rFont.GetEscapement();
+if ( nPropr && nEsc && nPropr != 100 && abs(nEsc) != 
DFLT_ESC_AUTO_SUPER )
+rFont.SetEscapement( 100.0/nPropr * nEsc );
+
 // Set the font as we want it to look like & reset the Propr attribute
 // so that it is not counted twice.
 Size aRealSz( aMetric.GetFontSize() );
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 9f56c2730eb3..36734264f185 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -197,13 +197,13 @@ namespace
 nEsc = -20;
 }
 
-if(nEsc > 100)
+if(nEsc > MAX_ESC_POS)
 {
-nEsc = 100;
+nEsc = MAX_ESC_POS;
 }
-else if(nEsc < -100)
+else if(nEsc < -MAX_ESC_POS)
 {
-nEsc = -100;
+nEsc = -MAX_ESC_POS;
 }
 
 const double fEscapement(nEsc / -100.0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-06 Thread Marco Cecchetti (via logerrit)
 editeng/source/editeng/editview.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 538dc87c56cd5c796c67d2be60be007e519505c9
Author: Marco Cecchetti 
AuthorDate: Wed Jan 29 12:09:27 2020 +0100
Commit: Marco Cecchetti 
CommitDate: Fri Mar 6 10:43:20 2020 +0100

lok: avoid to send visible cursor msg for formula bar edit view

Cursor visible msg should be sent only if the window linked to the
edit view is the document window.

Change-Id: Ib4001dbddd191b06fa02d5b8ddab14460270b327
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87680
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90070
Tested-by: Jenkins

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index b793a68b071f..315f9ef6716f 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -478,6 +478,10 @@ void EditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor, bool bActivat
 
 if (pImpEditView->mpViewShell && !bActivate)
 {
+VclPtr pParent = 
pImpEditView->pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId() != 0)
+return;
+
 OString aPayload = OString::boolean(true);
 
pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE,
 aPayload.getStr());
 
pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, 
"visible", aPayload);
@@ -491,6 +495,10 @@ void EditView::HideCursor(bool bDeactivate)
 
 if (pImpEditView->mpViewShell && !bDeactivate)
 {
+VclPtr pParent = 
pImpEditView->pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId() != 0)
+return;
+
 OString aPayload = OString::boolean(false);
 
pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE,
 aPayload.getStr());
 
pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, 
"visible", aPayload);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-06 Thread Marco Cecchetti (via logerrit)
 editeng/source/editeng/impedit.cxx |   40 +
 sc/source/ui/app/inputwin.cxx  |5 
 2 files changed, 45 insertions(+)

New commits:
commit 6fdd5e3ec95712d03b30fc32acffa358b7fef46e
Author: Marco Cecchetti 
AuthorDate: Tue Jan 14 14:35:11 2020 +0100
Commit: Marco Cecchetti 
CommitDate: Fri Mar 6 10:42:46 2020 +0100

lok: calc: send text selection rectangles for the input bar

Change-Id: I3caeaddd7a5ddc6e496650539b88e2fd81b37e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86790
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90069
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 53900c16aa76..0162856b0e36 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -382,6 +382,33 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 
 if (comphelper::LibreOfficeKit::isActive() && mpViewShell && 
!pOldRegion && pOutWin)
 {
+VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId() != 0)
+{
+const long nX = pOutWin->GetOutOffXPixel() - 
pParent->GetOutOffXPixel();
+const long nY = pOutWin->GetOutOffYPixel() - 
pParent->GetOutOffYPixel();
+
+std::vector aRectangles;
+pRegion->GetRegionRectangles(aRectangles);
+
+std::vector v;
+for (tools::Rectangle & rRectangle : aRectangles)
+{
+rRectangle = pOutWin->LogicToPixel(rRectangle);
+rRectangle.Move(nX, nY);
+v.emplace_back(rRectangle.toString().getStr());
+}
+OString sRectangle = comphelper::string::join("; ", v);
+
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
+const OUString rAction("text_selection");
+std::vector aItems;
+aItems.emplace_back("rectangles", sRectangle);
+pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, 
aItems);
+pPolyPoly.reset();
+return;
+}
+
 pOutWin->Push(PushFlags::MAPMODE);
 if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
 {
@@ -1743,6 +1770,19 @@ void ImpEditView::DeselectAll()
 aNewSelection.Min() = aNewSelection.Max();
 SetEditSelection(aNewSelection);
 // const_cast(GetEditSelection().Min()) = 
GetEditSelection().Max();
+
+if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
+{
+VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
+if (pParent && pParent->GetLOKWindowId())
+{
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
+const OUString rAction("text_selection");
+std::vector aItems;
+aItems.emplace_back("rectangles", "");
+pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, 
aItems);
+}
+}
 }
 
 bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2108f1c9dd8d..2702bb2705f1 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1500,6 +1500,9 @@ void ScTextWnd::InitEditEngine()
 mpEditView = std::make_unique(mpEditEngine.get(), this);
 mpEditView->SetInsertMode(bIsInsertMode);
 
+if (comphelper::LibreOfficeKit::isActive())
+mpEditView->RegisterViewShell(mpViewShell);
+
 // Text from Clipboard is taken over as ASCII in a single row
 EVControlBits n = mpEditView->GetControlWord();
 mpEditView->SetControlWord( n | EVControlBits::SINGLELINEPASTE );
@@ -2016,6 +2019,8 @@ void ScTextWnd::MakeDialogEditView()
 mpEditEngine->SetUpdateMode( true );
 
 mpEditView = std::make_unique(mpEditEngine.get(), this);
+if (comphelper::LibreOfficeKit::isActive())
+mpEditView->RegisterViewShell(mpViewShell);
 mpEditEngine->InsertView( mpEditView.get(), EE_APPEND );
 
 Resize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-04 Thread Noel Grandin (via logerrit)
 editeng/source/xml/xmltxtimp.cxx |   18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

New commits:
commit bd1ef206d37eee556f5b4a0b1437b5c1b2d1a037
Author: Noel Grandin 
AuthorDate: Wed Mar 4 13:05:26 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 4 14:17:59 2020 +0100

use FastParser in SvxXMLTextImportContext

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

diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index f0bb5d171ceb..fdfc588c2679 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -53,6 +53,9 @@ public:
 SvxXMLTextImportContext( SvXMLImport& rImport, const uno::Reference< XText 
>& xText );
 
 virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, 
const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) 
override;
+virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(
+sal_Int32 nElement,
+const uno::Reference< xml::sax::XFastAttributeList >& xAttrList) 
override;
 virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/,
 const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) 
override {}
 
@@ -67,18 +70,29 @@ SvxXMLTextImportContext::SvxXMLTextImportContext( 
SvXMLImport& rImport, const un
 {
 }
 
+css::uno::Reference< css::xml::sax::XFastContextHandler > 
SvxXMLTextImportContext::createFastChildContext(
+sal_Int32 nElement,
+const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/)
+{
+SvXMLImportContext* pContext = nullptr;
+if(nElement == XML_ELEMENT(OFFICE, XML_BODY ))
+{
+pContext = new SvxXMLTextImportContext( GetImport(), mxText );
+}
+return pContext;
+}
+
 SvXMLImportContextRef SvxXMLTextImportContext::CreateChildContext( sal_uInt16 
nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& 
xAttrList )
 {
 SvXMLImportContext* pContext = nullptr;
 if(XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_BODY ) )
 {
-pContext = new SvxXMLTextImportContext( GetImport(), mxText );
+// dealt with in createFastChildContext
 }
 else if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, 
XML_AUTOMATIC_STYLES ) )
 {
 pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, 
xAttrList );
 GetImport().GetTextImport()->SetAutoStyles( 
static_cast(pContext) );
-
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-03 Thread Justin Luth (via logerrit)
 editeng/source/editeng/editattr.cxx |4 
 editeng/source/editeng/editdoc.cxx  |4 
 editeng/source/editeng/impedit4.cxx |4 
 sd/qa/unit/data/tdf80194_defaultSubscripts.fodg |  407 
 sd/qa/unit/export-tests.cxx |   17 +
 5 files changed, 430 insertions(+), 6 deletions(-)

New commits:
commit 2940d1905b921d9909b08b1e32014d3c44474ef0
Author: Justin Luth 
AuthorDate: Mon Feb 17 20:20:31 2020 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Tue Mar 3 16:20:03 2020 +0100

tdf#80194 editeng: fix auto subscript calculations

...and auto superscript too (although not as noticably).

THIS WILL CHANGE THE POSITION OF EDITENG SUBSCRIPTS
AND SUPERSCRIPTS IN EXISTING DOCUMENTS!
That is because they were very poorly placed
before - using a formula that is very different
from how Writer does it. Everyone in the bug reports
indicates that Writer does it good, but Impress
does it really bad. (tdf#89849, tdf#63083)

FOR EXAMPLE, when the char-size is reduced to
the default OF 58%, it will now be raised by 33%, not 42%.
Likewise, the subscript will now be lowered by 8%, not 42%.

THIS AFFECTS/FIXES Writer textboxes, Calc, Draw/Impress.

"Automatic" indicates that there is not a
"correct" answer, but that the computer should make
it "look good", so the user should be able to accept
this change in positioning, as long as it looks good.

The number of documents affected might be less than
one would expect. By default .uno:SuperScript
does NOT set auto mode (although Format-Character does).
Since most people would use the toolbar instead of the
format menu to create a superscript, auto will be rare.
So there will be relatively few cases where
subscripts are automatic in editeng, especially since
it looks so poor that most people probably turned
automatic off...

This patch has no effect on non-automatic escapement.

It uses the same fomula that calculated DFLT_ESC_SUB
(since it isn't an arbitrarily chosen value).
This is an approximation of the formula that Writer
uses (since Writer does exact calculations based
on each font's metrics).
This Writer-inspired formula was introduced in LO 6.4
for more accurate exporting to MSO
word processing formats (tdf#127316).

Change-Id: I0267810efe31a2b3be41bf2d39e2278ce9bc99e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88911
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 
Reviewed-by: Justin Luth 

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index f000cf793560..a99e4d496f74 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -273,9 +273,9 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, 
OutputDevice* )
 
 short nEsc = static_cast(GetItem())->GetEsc();
 if ( nEsc == DFLT_ESC_AUTO_SUPER )
-nEsc = 100 - nProp;
+nEsc =  .8 * (100 - nProp);
 else if ( nEsc == DFLT_ESC_AUTO_SUB )
-nEsc = sal::static_int_cast< short >( -( 100 - nProp ) );
+nEsc =  .2 * -(100 - nProp);
 rFont.SetEscapement( nEsc );
 }
 
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f3f55edf60c1..42fc1f3cc22c 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2008,9 +2008,9 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, 
bool bSearchInParent, S
 
 short nEsc = rEsc.GetEsc();
 if ( nEsc == DFLT_ESC_AUTO_SUPER )
-nEsc = 100 - nProp;
+nEsc = .8 * (100 - nProp);
 else if ( nEsc == DFLT_ESC_AUTO_SUB )
-nEsc = sal::static_int_cast< short >( -( 100 - nProp ) );
+nEsc = .2 * -(100 - nProp);
 rFont.SetEscapement( nEsc );
 }
 if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == 
SfxItemState::SET ) )
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 67e924653618..25d7ecc0aa8a 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -930,12 +930,12 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& 
rItem, SvStream& rOutput,
 short nEsc = static_cast(rItem).GetEsc();
 if ( nEsc == DFLT_ESC_AUTO_SUPER )
 {
-nEsc = 100 - nProp;
+nEsc =  .8 * (100 - nProp);
 nProp100++; // A 1 afterwards means 'automatic'.
 }
 else if ( nEsc == DFLT_ESC_AUTO_SUB )
 {
-nEsc = sal::static_int_cast< short >( -( 100 - nProp ) );
+nEsc =  .2 * -(100 - nProp);
 nProp100++;
 }
 // SWG:
diff --git a/sd/qa/unit/data/tdf80194_defaultSubscripts.fodg 
b/sd/qa/

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

2020-03-02 Thread Miklos Vajna (via logerrit)
 editeng/source/items/numitem.cxx |7 +++
 include/editeng/numitem.hxx  |5 +
 sw/source/core/doc/number.cxx|   11 +++
 3 files changed, 23 insertions(+)

New commits:
commit f807c8bbbc041a7896838fc213d30f2f30768b4a
Author: Miklos Vajna 
AuthorDate: Mon Mar 2 11:45:37 2020 +0100
Commit: Miklos Vajna 
CommitDate: Tue Mar 3 07:57:40 2020 +0100

sw doc model xml dump: show numbering type

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

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 67b4dcadafd9..00af4303064a 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -152,6 +152,13 @@ OUString SvxNumberType::GetNumStr( sal_Int32 nNo, const 
css::lang::Locale& rLoca
 return OUString();
 }
 
+void SvxNumberType::dumpAsXml( xmlTextWriterPtr pWriter ) const
+{
+xmlTextWriterStartElement(pWriter, BAD_CAST("SvxNumberType"));
+xmlTextWriterWriteAttribute(pWriter, BAD_CAST("NumType"), 
BAD_CAST(OString::number(nNumType).getStr()));
+xmlTextWriterEndElement(pWriter);
+}
+
 SvxNumberFormat::SvxNumberFormat( SvxNumType eType )
 : SvxNumberType(eType),
   eNumAdjust(SvxAdjust::Left),
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 399250c9c13a..e70281c7b0a1 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -52,6 +52,9 @@ namespace com::sun::star::lang { struct Locale; }
 
 
 #define LINK_TOKEN  0x80 //indicate linked bitmaps - for use in dialog only
+
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
+
 class EDITENG_DLLPUBLIC SvxNumberType
 {
 static sal_Int32 nRefCount;
@@ -81,6 +84,8 @@ public:
css::style::NumberingType::CHAR_SPECIAL != 
nNumType &&
css::style::NumberingType::BITMAP != nNumType;
 }
+
+void dumpAsXml(xmlTextWriterPtr w) const;
 };
 
 class EDITENG_DLLPUBLIC SvxNumberFormat : public SvxNumberType
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 0db3e7820bc3..26540353ddba 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1029,6 +1029,17 @@ void SwNumRule::dumpAsXml(xmlTextWriterPtr pWriter) const
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("msName"), 
BAD_CAST(msName.toUtf8().getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mnPoolFormatId"), 
BAD_CAST(OString::number(mnPoolFormatId).getStr()));
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mbAutoRuleFlag"), 
BAD_CAST(OString::boolean(mbAutoRuleFlag).getStr()));
+
+for (const auto& pFormat : maFormats)
+{
+if (!pFormat)
+{
+continue;
+}
+
+pFormat->dumpAsXml(pWriter);
+}
+
 xmlTextWriterEndElement(pWriter);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-29 Thread Muhammet Kara (via logerrit)
 editeng/source/editeng/impedit.cxx |   41 +++--
 1 file changed, 35 insertions(+), 6 deletions(-)

New commits:
commit 7ce29004934ae7b75dce492bde5602358eb3dc5f
Author: Muhammet Kara 
AuthorDate: Thu Dec 19 08:32:57 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Feb 29 17:22:07 2020 +0100

lok: Resolves: Calc - selecting a hyperlink doesn't show link in dialog

Change-Id: Ic4264fad8035029ba6593c91fa57efa772d394ca
Reviewed-on: https://gerrit.libreoffice.org/85468
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89705
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 842119a5b4ae..53900c16aa76 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -869,6 +869,23 @@ void ImpEditView::CalcAnchorPoint()
 }
 }
 
+namespace
+{
+
+// Build JSON message to be sent to Online
+OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink)
+{
+boost::property_tree::ptree aTree;
+aTree.put("text", sText);
+aTree.put("link", sLink);
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree, false);
+
+return OString(aStream.str().c_str()).trim();
+}
+
+} // End of anon namespace
+
 void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
 {
 // No ShowCursor in an empty View ...
@@ -,12 +1128,24 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 {
 if (auto pUrlField = dynamic_cast(pFld->GetField()))
 {
-boost::property_tree::ptree aTree;
-aTree.put("text", pUrlField->GetRepresentation());
-aTree.put("link", pUrlField->GetURL());
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree, 
false);
-sHyperlink = OString(aStream.str().c_str()).trim();
+sHyperlink = 
buildHyperlinkJSON(pUrlField->GetRepresentation(), pUrlField->GetURL());
+}
+}
+else if (GetEditSelection().HasRange())
+{
+EditView* pActiveView = GetEditViewPtr();
+
+if (pActiveView)
+{
+const SvxFieldItem* pFieldItem = 
pActiveView->GetFieldAtSelection();
+if (pFieldItem)
+{
+const SvxFieldData* pField = 
pFieldItem->GetField();
+if ( auto pUrlField = dynamic_cast( pField) )
+{
+sHyperlink = 
buildHyperlinkJSON(pUrlField->GetRepresentation(), pUrlField->GetURL());
+}
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-28 Thread Grzegorz Araminowicz (via logerrit)
 editeng/source/editeng/impedit.cxx |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 79f1490f93c3ebe933baba52c6a3eacf1e37fb61
Author: Grzegorz Araminowicz 
AuthorDate: Tue Oct 29 21:56:16 2019 +0100
Commit: Muhammet Kara 
CommitDate: Fri Feb 28 19:08:41 2020 +0100

lok: send hyperlink info also in editeng

Change-Id: I64691497778a59b519cafd656772d5e79cb132f3
Reviewed-on: https://gerrit.libreoffice.org/81719
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89679
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 6107f950608a..842119a5b4ae 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1105,7 +1106,21 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pEditEngine->pImpEditEngine->GetSpeller() );
 bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, 
/*bMarkIfWrong*/ false);
 
-SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, 
bIsWrong);
+OString sHyperlink;
+if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
+{
+if (auto pUrlField = dynamic_cast(pFld->GetField()))
+{
+boost::property_tree::ptree aTree;
+aTree.put("text", pUrlField->GetRepresentation());
+aTree.put("link", pUrlField->GetURL());
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree, 
false);
+sHyperlink = OString(aStream.str().c_str()).trim();
+}
+}
+
+SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, 
bIsWrong, sHyperlink);
 
mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", 
sRect);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-24 Thread Samuel Mehrbrodt (via logerrit)
 editeng/source/editeng/impedit2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5e8b6d3b721ba8730bc7a5b335418340e3f89c3e
Author: Samuel Mehrbrodt 
AuthorDate: Mon Feb 24 11:13:36 2020 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Feb 24 12:05:12 2020 +0100

tdf#130760 Fix crash when clicking link to other slide

Change-Id: Ie8b0cfb852fe1abc49b80b1d2d9d2c3be1241701
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89332
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index f159c3e71b33..9c04370d9f08 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -588,7 +588,7 @@ bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, 
EditView* pView )
 css::system::SystemShellExecute::create(
 comphelper::getProcessComponentContext()));
 exec->execute(pUrlField->GetURL(), OUString(),
-  
css::system::SystemShellExecuteFlags::URIS_ONLY);
+  
css::system::SystemShellExecuteFlags::DEFAULTS);
 }
 }
 GetEditEnginePtr()->FieldClicked( *pFld );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    1   2   3   4   5   6   7   8   9   10   >