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

2022-02-17 Thread Vasily Melenchuk (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |  765 +++
 sw/source/filter/ww8/docxattributeoutput.hxx |   73 +-
 2 files changed, 356 insertions(+), 482 deletions(-)

New commits:
commit c3206d877c17e980ac0dcab8e890349c23b4d249
Author: Vasily Melenchuk 
AuthorDate: Tue Nov 16 18:12:39 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Feb 18 08:23:46 2022 +0100

sw: refactoring for docx sdt blocks output

Previous approach with almost duplicate storage and processing
for paragraph-level and run-level sdt blocks was very bulky.
Especially this became visible once supported std elements list
start to grow.

Paragraph-level sdt block and run-level sdt block data are almost
identical, so they can be kept in one standard class
(SdtBlockHelper) and use the same methods for collecting data
from grabbags and writing to output without passing huge amount
of parameters.

Change-Id: I4e1183eddf20317e954cb8aca72e97a4fc45ac68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125372
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-by: Vasily Melenchuk 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127158
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130040
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 79d31da2e575..84269fc05f5a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -312,6 +312,28 @@ static bool lcl_isOnelinerSdt(const OUString& rName)
 return rName == "Title" || rName == "Subtitle" || rName == "Company";
 }
 
+static void AddToAttrList(rtl::Reference& 
pAttrList, sal_Int32 nAttrs, ...)
+{
+if (!pAttrList.is())
+pAttrList = FastSerializerHelper::createAttrList();
+
+va_list args;
+va_start(args, nAttrs);
+for (sal_Int32 i = 0; i < nAttrs; i++)
+{
+sal_Int32 nName = va_arg(args, sal_Int32);
+const char* pValue = va_arg(args, const char*);
+if (pValue)
+pAttrList->add(nName, pValue);
+}
+va_end(args);
+}
+
+static void AddToAttrList(rtl::Reference& 
pAttrList, sal_Int32 nAttrName, const char* sAttrValue)
+{
+AddToAttrList(pAttrList, 1, nAttrName, sAttrValue);
+}
+
 // write a floating table directly to docx without the surrounding frame
 void DocxAttributeOutput::WriteFloatingTable(ww8::Frame const* pParentFrame)
 {
@@ -450,7 +472,7 @@ sal_Int32 
DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p
 // would normally arrive, it would be too late (would be after the
 // paragraph start has been written).
 bool bEndParaSdt = false;
-if (m_bStartedParaSdt)
+if (m_aParagraphSdt.m_bStartedSdt)
 {
 SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
 if (pTextNode && pTextNode->GetpSwAttrSet())
@@ -460,17 +482,16 @@ sal_Int32 
DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p
 {
 const SfxGrabBagItem& rParaGrabBag = static_cast(*pItem);
 const std::map& rMap = 
rParaGrabBag.GetGrabBag();
-bEndParaSdt = m_bStartedParaSdt && 
rMap.find("ParaSdtEndBefore") != rMap.end();
+bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && 
rMap.find("ParaSdtEndBefore") != rMap.end();
 }
 }
 }
 // TODO also avoid multiline paragraphs in those SDT types for shape text
-bool bOneliner = m_bStartedParaSdt && 
!m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() && 
lcl_isOnelinerSdt(m_aStartedParagraphSdtPrAlias);
-if (bEndParaSdt || (m_bStartedParaSdt && m_bHadSectPr) || bOneliner)
+bool bOneliner = m_aParagraphSdt.m_bStartedSdt && 
!m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() && 
lcl_isOnelinerSdt(m_aStartedParagraphSdtPrAlias);
+if (bEndParaSdt || (m_aParagraphSdt.m_bStartedSdt && m_bHadSectPr) || 
bOneliner)
 {
 // This is the common case: "close sdt before the current paragraph" 
was requested by the next paragraph.
-EndSdtBlock();
-m_bStartedParaSdt = false;
+m_aParagraphSdt.EndSdtBlock(m_pSerializer);
 m_aStartedParagraphSdtPrAlias.clear();
 }
 m_bHadSectPr = false;
@@ -574,24 +595,265 @@ static OString convertToOOXMLHoriOrientRel(sal_Int16 
nOrientRel)
 }
 }
 
-static void lcl_deleteAndResetTheLists(
-rtl::Reference& pSdtPrTokenChildren,
-rtl::Reference& pSdtPrDataBindingAttrs,
-rtl::Reference& pSdtPrTextAttrs,
-OUString& rSdtPrAlias, OUString& rSdtPrPlaceholderDocPart, OUString& 
rColor)
+void SdtBlockHelper::DeleteAndResetTheLists()
 {
-if( pSdtPrTokenChildren.is() )
-pSdtPrTokenChildren.clear();
-if( pSdtPrDataBindingAttrs.is() )
-

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

2021-12-09 Thread Miklos Vajna (via logerrit)
 sw/source/core/frmedt/feshview.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 1a651f925090afd69b78ab0311e53ab85b48d8e2
Author: Miklos Vajna 
AuthorDate: Wed Dec 8 12:58:22 2021 +0100
Commit: Miklos Vajna 
CommitDate: Thu Dec 9 10:28:10 2021 +0100

sw: fix crash in SwFEShell::SelectObj()

Crashreport signature:

SwContact::GetFormat()
sw/inc/dcontact.hxx:112
SwFEShell::SelectObj(Point const&, unsigned char, SdrObject*)
sw/source/core/frmedt/feshview.cxx:292
SwWrtShell::UnSelectFrame()
sw/source/uibase/wrtsh/select.cxx:326
SwWrtShell::DelRight()
sw/source/uibase/wrtsh/delete.cxx:467
SwBaseShell::ExecDelete(SfxRequest&)
sw/source/uibase/shells/basesh.cxx:198

I.e. it seems that in case we're in the middle of a delete, then it's
possible that the mark list contains an SdrObject that doesn't have a
matching SwClient anymore. Ignore such SdrObjects when looking for the
textbox of a draw shape.

Change-Id: I065b2ea44d39220184a5f604c3ea13f6a106ddb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126537
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2a6fde04a7ad716117118e5dada895ec87e24de3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126564

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 8935aea0c62b..2a810d87225f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -298,7 +298,13 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 
nFlag, SdrObject *pObj )
 for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i)
 {
 SdrObject* pObject = rMrkList.GetMark(i)->GetMarkedSdrObj();
-SwFrameFormat* pFormat = GetUserCall(pObject)->GetFormat();
+SwContact* pContact = GetUserCall(pObject);
+if (!pContact)
+{
+continue;
+}
+
+SwFrameFormat* pFormat = pContact->GetFormat();
 if (SwFrameFormat* pShapeFormat = 
SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT))
 {
 SdrObject* pShape = pShapeFormat->FindSdrObject();


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

2021-11-21 Thread Michael Meeks (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 39a17e3f1d700798c2bf8b30c755f04e550d5587
Author: Michael Meeks 
AuthorDate: Wed Nov 17 17:18:16 2021 +
Commit: Miklos Vajna 
CommitDate: Mon Nov 22 08:24:59 2021 +0100

Crash when fetching clipboard data.

Seems like some unusual corner-case around HTML export.

sw::DocumentContentOperationsManager::CopyImplImpl(SwPaM&, 
SwPosition&, bool, SwPaM*, bool) const

/sw/source/core/doc/DocumentContentOperationsManager.cxx:5068
sw::DocumentContentOperationsManager::CopyImpl(SwPaM&, SwPosition&, 
bool, SwPaM*, bool) const

/sw/source/core/doc/DocumentContentOperationsManager.cxx:4609
sw::DocumentContentOperationsManager::CopyRange(SwPaM&, 
SwPosition&, bool, bool, bool) const

/sw/source/core/doc/DocumentContentOperationsManager.cxx:1936
SwEditShell::CopySelToDoc(SwDoc*)
/sw/inc/pam.hxx:193 (discriminator 2)
SwFEShell::Copy(SwDoc*, rtl::OUString const*)
/sw/source/core/frmedt/fecopy.cxx:224
(anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&)
/sw/source/uibase/dochdl/swdtflvr.cxx:413
SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor 
const&, rtl::OUString const&)
/include/sfx2/objsh.hxx:866

TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor 
const&, rtl::OUString const&)
/include/com/sun/star/uno/Type.h:121

TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor 
const&)
/include/rtl/ustring.hxx:438
getFromTransferrable.isra.0
/include/com/sun/star/uno/Any.hxx:151
encodeImageAsHTML
/desktop/source/lib/init.cxx:4382
doc_getTextSelection

Change-Id: I1af52d827ebdc9bbc5278f56547d1b3fd1b87e7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125547
Tested-by: Michael Meeks 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 99233fee6df8..5f4e0c3b7f29 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5065,8 +5065,11 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
 //  and not the source has the page break
 if (pDoc->IsClipBoard() && (rPam.GetPageNum(pStt == rPam.GetPoint()) == 1) 
&& !bCopyPageSource)
 {
-pDestTextNd->ResetAttr(RES_BREAK);// remove the page-break
-pDestTextNd->ResetAttr(RES_PAGEDESC);
+if (pDestTextNd)
+{
+pDestTextNd->ResetAttr(RES_BREAK);// remove the page-break
+pDestTextNd->ResetAttr(RES_PAGEDESC);
+}
 }
 
 


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

2021-11-13 Thread Henry Castro (via logerrit)
 sw/source/ui/fldui/fldtdlg.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit ead2aa7a7088aa2b41a90746351fdf74822dbbe0
Author: Henry Castro 
AuthorDate: Fri Nov 12 11:30:13 2021 -0400
Commit: Andras Timar 
CommitDate: Sat Nov 13 20:23:34 2021 +0100

lok: sw: remove database tab

It is not functional the database feature yet.

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

diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 8c1bb998fb85..5a0a8022262a 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -93,6 +94,9 @@ SwFieldDlg::SwFieldDlg(SfxBindings* pB, SwChildWinWrapper* 
pCW, weld::Window *pP
 RemoveTabPage("functions");
 RemoveTabPage("database");
 }
+
+if (comphelper::LibreOfficeKit::isActive())
+RemoveTabPage("database");
 }
 
 SwFieldDlg::~SwFieldDlg()


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

2021-10-29 Thread Michael Meeks (via logerrit)
 sw/source/uibase/shells/langhelper.cxx |5 +++--
 sw/source/uibase/shells/textsh1.cxx|5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a613204272151bc533ace9c2794dc812e06aba27
Author: Michael Meeks 
AuthorDate: Fri Oct 29 19:39:21 2021 +0100
Commit: Aron Budea 
CommitDate: Fri Oct 29 22:45:23 2021 +0200

tdf#145386 Avoid LANGUAGE_PROCESS_OR_USER_DEFAULT messing up the status bar.

Importing a simple .doc gives this language code in various bits
of logic, unexpectedly - which then results in very odd
FeatureStateEvents containing state like this:

  uno::Sequence of length 4 = {"{en-US};en-US", "1", "", "Doc.doc"}

where really they should be:

  uno::Sequence of length 4 = {"English (USA);en-US", "1", "", "Doc.doc"}

and worse - that looks like JSON.

Change-Id: I8d9e4171bee6bbe9d1c9dcfb7a5fa8fc92ea1a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124448
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sw/source/uibase/shells/langhelper.cxx 
b/sw/source/uibase/shells/langhelper.cxx
index 32a6cb1a5793..27326c973fb0 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -75,14 +76,14 @@ namespace SwLangHelper
 
 vcl::Window* pWin = rEditView.GetWindow();
 if(pWin)
-nLang = pWin->GetInputLanguage();
+nLang = MsLangId::getRealLanguage( pWin->GetInputLanguage() );
 if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
 aKeyboardLang = SvtLanguageTable::GetLanguageString( nLang );
 
 // get the language that is in use
 OUString aCurrentLang("*");
 SfxItemSet aSet(pOLV->GetAttribs());
-nLang = SwLangHelper::GetCurrentLanguage( aSet,nScriptType );
+nLang = MsLangId::getRealLanguage( SwLangHelper::GetCurrentLanguage( 
aSet,nScriptType ) );
 if (nLang != LANGUAGE_DONTKNOW)
 aCurrentLang = SvtLanguageTable::GetLanguageString( nLang );
 
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 630d54a2efc6..e7747e36db76 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1623,13 +1624,13 @@ void SwTextShell::GetState( SfxItemSet  )
 // get keyboard language
 OUString aKeyboardLang;
 SwEditWin& rEditWin = GetView().GetEditWin();
-LanguageType nLang = rEditWin.GetInputLanguage();
+LanguageType nLang = MsLangId::getRealLanguage( 
rEditWin.GetInputLanguage() );
 if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
 aKeyboardLang = SvtLanguageTable::GetLanguageString( nLang 
);
 
 // get the language that is in use
 OUString aCurrentLang = "*";
-nLang = SwLangHelper::GetCurrentLanguage( rSh );
+nLang = MsLangId::getRealLanguage( 
SwLangHelper::GetCurrentLanguage( rSh ) );
 if (nLang != LANGUAGE_DONTKNOW)
 {
 aCurrentLang = SvtLanguageTable::GetLanguageString( nLang 
);


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

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

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

sw: fix crash in SwXTextDocument::postMouseEvent()

From crashreport:

SIG   Fatal signal received: SIGSEGV

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

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

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

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


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

2021-10-04 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 07838aad2b9b58510b6bb978ad0bd5df6c42acd1
Author: Caolán McNamara 
AuthorDate: Mon Aug 23 16:55:27 2021 +0100
Commit: Michael Meeks 
CommitDate: Mon Oct 4 10:15:49 2021 +0200

rhbz#1996735 SwEditShell::GetCorrection can return null

Though the exact steps to reproduce are unknown. From the text seen in
the backtrace the language is possibly Finnish in which case voikko is
probably the spellchecking backend in use.

(cherry picked from commit ccc30eda6774eb99adc537f9747097e1e8a74b21)

Change-Id: I9b3186e4699946235ccc161575bba7d4a3820565
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123036
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 3ea93b2c5ee4..630d54a2efc6 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1488,7 +1488,9 @@ void SwTextShell::Execute(SfxRequest )
 else if (sApplyText == sSpellingType)
 {
 SwRect aToFill;
-uno::Reference< linguistic2::XSpellAlternatives >  xSpellAlt( 
rWrtSh.GetCorrection(nullptr, aToFill) );
+uno::Reference  
xSpellAlt(rWrtSh.GetCorrection(nullptr, aToFill));
+if (!xSpellAlt.is())
+return;
 uno::Reference< linguistic2::XDictionary > xDictionary = 
LinguMgr::GetIgnoreAllList();
 OUString sWord(xSpellAlt->getWord());
 linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( 
xDictionary,


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

2021-09-17 Thread Szymon Kłos (via logerrit)
 sw/source/core/doc/extinput.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit d8dbd123bfa7f39489ceb15ac83142635531fd43
Author: Szymon Kłos 
AuthorDate: Thu Sep 16 16:53:40 2021 +0200
Commit: Andras Timar 
CommitDate: Fri Sep 17 13:37:04 2021 +0200

lok: IME: directly copy formatting for inserted text

This is a fix for online where after:

lok: IME: preserve formatting when inserting at the end of paragraph


https://cgit.freedesktop.org/libreoffice/core/commit/?h=distro/collabora/cp-6.4=bf96d1f23e5c12f9263643dfdab94fd1361bb098

text formatting is lost.

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

diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 4795862e9e1a..9f60ec1fabcf 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -102,18 +102,17 @@ SwExtTextInput::~SwExtTextInput()
 {
 // we need to keep correct formatting
 // ie. when we erase first, then we will lost information 
about format
-// so:
-// 0. initial status:  | OLD
-// 1. insert new content using Doc interface at the end so we 
will use the same formatting
-//status:  | OLD | NEW
-// 2. erase old content which is placed at "start" position 
and before recently inserted text
-//status:  | NEW
 
 sal_Int32 nLenghtOfOldString = nEndCnt - nSttCnt;
 
 if( bInsText )
 {
 pDoc->getIDocumentContentOperations().InsertString( *this, 
sText );
+
+// Copy formatting to the inserted string
+SfxItemSet aSet(pTNd->GetDoc()->GetAttrPool(), 
aCharFormatSetRange);
+pTNd->GetParaAttr( aSet, nSttCnt + nLenghtOfOldString, 
nEndCnt + nLenghtOfOldString );
+pTNd->SetAttr( aSet, nSttCnt, nEndCnt );
 }
 
 pTNd->EraseText( rIdx, nLenghtOfOldString );


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

2021-09-03 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/uiview/view2.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7c2893de81a25db4279ae8da0ef030a596f36b56
Author: Miklos Vajna 
AuthorDate: Fri Sep 3 09:28:39 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 3 12:13:21 2021 +0200

sw: fix crash in SwView::Execute()

Crashreport:

program/../program/libswlo.so
SwView::Execute(SfxRequest&)
sw/source/uibase/uiview/view2.cxx:1312
program/libmergedlo.so
SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, 
SfxRequest&, bool)
sfx2/source/control/dispatch.cxx:263
/opt/collaboraoffice6.4/program/libmergedlo.so
SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, 
SfxRequest&, SfxCallMode)
sfx2/source/control/dispatch.cxx:760 (discriminator 
3)
/opt/collaboraoffice6.4/program/libmergedlo.so
SfxDispatcher::Execute(unsigned short, SfxCallMode, 
SfxItemSet const*, SfxItemSet const*, unsigned short)
sfx2/source/control/dispatch.cxx:819

Change-Id: I2e7b27f458971dbd33971589f71337c59981ee83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121547
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 1e2356884137..9820b695d7cb 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1309,6 +1309,11 @@ void SwView::Execute(SfxRequest )
 const sal_uLong newPosY = newPosYTwips->GetValue();
 const Point mPoint(newPosX, newPosY);
 const SdrHdl* handle = 
pSdrView->GetHdlList().GetHdl(handleNum);
+if (!handle)
+{
+break;
+}
+
 if (handle->GetKind() == SdrHdlKind::Anchor || 
handle->GetKind() == SdrHdlKind::Anchor_TR)
 m_pWrtShell->FindAnchorPos(mPoint, /*bMoveIt=*/true);
 else


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

2021-08-23 Thread Pranam Lashkari (via logerrit)
 sw/source/uibase/uiview/viewtab.cxx |   51 +---
 1 file changed, 30 insertions(+), 21 deletions(-)

New commits:
commit 2e1ee0ccb1c9b58fa98e618484ca5e4eecdcea51
Author: Pranam Lashkari 
AuthorDate: Thu Aug 19 18:49:59 2021 +0530
Commit: Mike Kaganski 
CommitDate: Mon Aug 23 08:58:20 2021 +0200

LOK make sure single row/column table are resizable

First row/column are treated as heading in the table,
that's why need some special case handling for it

First row/column are not counted in regular row/column

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

diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 7a2f8c852625..4edf541aa973 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1112,24 +1112,30 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
 
 if (sType == "column-left")
 {
-auto & rEntry = aTabCols.GetEntry(0);
-long nNewPosition = aTabCols.GetLeft() + long(nOffset);
-long nPosition = std::min(nNewPosition, rEntry.nPos - 
constDistanceOffset);
-aTabCols.SetLeft(nPosition);
+long nNewPosition = aTabCols.GetLeft() + nOffset;
+if(aTabCols.Count() > 0)
+{
+auto & rEntry = aTabCols.GetEntry(0);
+nNewPosition = std::min(nNewPosition, rEntry.nPos 
- constDistanceOffset);
+}
+aTabCols.SetLeft(nNewPosition);
 }
 else if (sType == "column-right")
 {
-auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 
1);
-long nNewPosition = aTabCols.GetRight() + 
long(nOffset);
-long nPosition = std::max(nNewPosition, rEntry.nPos + 
constDistanceOffset);
-aTabCols.SetRight(nPosition);
+long nNewPosition = aTabCols.GetRight() + nOffset;
+if(aTabCols.Count() > 0)
+{
+auto & rEntry = aTabCols.GetEntry(aTabCols.Count() 
- 1);
+nNewPosition = std::max(nNewPosition, rEntry.nPos 
+ constDistanceOffset);
+}
+aTabCols.SetRight(nNewPosition);
 }
 else if (sType == "column-middle" && nIndex < 
aTabCols.Count())
 {
 auto & rEntry = aTabCols.GetEntry(nIndex);
-long nNewPosition = rEntry.nPos + long(nOffset);
-long nPosition = std::clamp(nNewPosition, rEntry.nMin, 
rEntry.nMax - constDistanceOffset);
-rEntry.nPos = nPosition;
+long nNewPosition = rEntry.nPos + nOffset;
+nNewPosition = std::clamp(nNewPosition, rEntry.nMin, 
rEntry.nMax - constDistanceOffset);
+rEntry.nPos = nNewPosition;
 }
 
 rSh.SetTabCols(aTabCols, false);
@@ -1142,23 +1148,26 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
 if (sType == "row-left")
 {
 auto & rEntry = aTabRows.GetEntry(0);
-long nNewPosition = aTabRows.GetLeft() + long(nOffset);
-long nPosition = std::min(nNewPosition, rEntry.nPos - 
constDistanceOffset);
-aTabRows.SetLeft(nPosition);
+long nNewPosition = aTabRows.GetLeft() + nOffset;
+nNewPosition = std::min(nNewPosition, rEntry.nPos - 
constDistanceOffset);
+aTabRows.SetLeft(nNewPosition);
 }
 else if (sType == "row-right")
 {
-auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 
1);
-long nNewPosition = aTabRows.GetRight() + 
long(nOffset);
-long nPosition = std::max(nNewPosition, rEntry.nPos + 
constDistanceOffset);
-aTabRows.SetRight(nPosition);
+long nNewPosition = aTabRows.GetRight() + nOffset;
+if(aTabRows.Count() > 0)
+{
+auto & rEntry = aTabRows.GetEntry(aTabRows.Count() 
- 1);
+nNewPosition = std::max(nNewPosition, rEntry.nPos 
+ constDistanceOffset);
+}
+aTabRows.SetRight(nNewPosition);
 }

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

2021-08-09 Thread Miklos Vajna (via logerrit)
 sw/source/core/view/viewsh.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit d0b5ff42431d8d18ab9b70fd54206f21bbe4316a
Author: Miklos Vajna 
AuthorDate: Wed Aug 4 13:44:24 2021 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 9 17:15:48 2021 +0200

sw lok: avoid expensive DLPre/PostPaint2() around InvalidateWindows()

This shows up on profiles and it's not needed. It was only there,
because Online always needs an invalidation to have updated tiles, so
there the paint was replaced with an invalidate. And then the
drawinglayer setup/teardown was not made conditional by accident.

The PaintTile() case goes via Paint() -> PaintSwFrame(), which still
calls these functions; this commit only speeds up
SwViewShell::ImplEndAction(), which is called synchronously e.g. on
every keypress.

(cherry picked from commit aff28c59816d046d9b74460c1b17101b99b9514e)

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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bf160861ee3c..0a87c1672f97 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -418,7 +418,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
 // seems to work (and does technically) but fails 
with transparent objects. Since the
 // region given to BeginDarwLayers() defines the 
clip region for DrawingLayer paint,
 // transparent objects in the single rectangles 
will indeed be painted multiple times.
-DLPrePaint2(vcl::Region(aRect.SVRect()));
+if (!comphelper::LibreOfficeKit::isActive())
+{
+DLPrePaint2(vcl::Region(aRect.SVRect()));
+}
 
 if ( bPaintsFromSystem )
 PaintDesktop(*GetOut(), aRect);
@@ -428,7 +431,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
 
pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
 
 // #i75172# end DrawingLayer paint
-DLPostPaint2(true);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+DLPostPaint2(true);
+}
 }
 }
 


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

2021-07-28 Thread Tor Lillqvist (via logerrit)
 sw/source/core/layout/layact.cxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit 58c383d40e5cfe5dbdb86c8ce2cab13e1a9b0273
Author: Tor Lillqvist 
AuthorDate: Wed Jul 28 11:01:59 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Jul 28 10:42:42 2021 +0200

Revert "Add a few more ProfileZones"

The output from these are events with zero or one microsecod duration
in the overwhelming majority of cases and thus useless.

This reverts commit ffcca583b856cd9d1f7f6fd373bfa617c49c1ef4.

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

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 0c8ac383c6cb..04201e1c6f5e 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -40,7 +40,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -321,8 +320,6 @@ bool SwLayAction::RemoveEmptyBrowserPages()
 
 void SwLayAction::Action(OutputDevice* pRenderContext)
 {
-comphelper::ProfileZone("SwLayAction::Action");
-
 m_bActionInProgress = true;
 
 //TurboMode? Hands-off during idle-format
@@ -1176,8 +1173,6 @@ bool SwLayAction::IsShortCut( SwPageFrame * )
 // introduce support for vertical layout
 bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame 
*pLay, bool bAddRect )
 {
-comphelper::ProfileZone("SwLayAction::FormatLayout");
-
 // save page for loop control
 if( pLay->IsPageFrame() && static_cast(pLay) != m_pCurPage )
 {
@@ -1601,8 +1596,6 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool 
bAddRect )
 
 bool SwLayAction::FormatContent( const SwPageFrame *pPage )
 {
-comphelper::ProfileZone("SwLayAction::FormatContent");
-
 const SwContentFrame *pContent = pPage->ContainsContent();
 const SwViewShell *pSh = m_pRoot->GetCurrShell();
 const bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -2136,8 +2129,6 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp 
*pI ) :
 , m_bIndicator( false )
 #endif
 {
-comphelper::ProfileZone("SwLayIdle::SwLayIdle");
-
 SAL_INFO("sw.idle", "SwLayIdle() entry");
 
 pImp->m_pIdleAct = this;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-20 Thread Tor Lillqvist (via logerrit)
 sw/source/core/layout/layact.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit ffcca583b856cd9d1f7f6fd373bfa617c49c1ef4
Author: Tor Lillqvist 
AuthorDate: Mon Jul 5 12:22:00 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Jul 20 11:23:59 2021 +0200

Add a few more ProfileZones

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

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 04201e1c6f5e..0c8ac383c6cb 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -40,6 +40,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -320,6 +321,8 @@ bool SwLayAction::RemoveEmptyBrowserPages()
 
 void SwLayAction::Action(OutputDevice* pRenderContext)
 {
+comphelper::ProfileZone("SwLayAction::Action");
+
 m_bActionInProgress = true;
 
 //TurboMode? Hands-off during idle-format
@@ -1173,6 +1176,8 @@ bool SwLayAction::IsShortCut( SwPageFrame * )
 // introduce support for vertical layout
 bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame 
*pLay, bool bAddRect )
 {
+comphelper::ProfileZone("SwLayAction::FormatLayout");
+
 // save page for loop control
 if( pLay->IsPageFrame() && static_cast(pLay) != m_pCurPage )
 {
@@ -1596,6 +1601,8 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool 
bAddRect )
 
 bool SwLayAction::FormatContent( const SwPageFrame *pPage )
 {
+comphelper::ProfileZone("SwLayAction::FormatContent");
+
 const SwContentFrame *pContent = pPage->ContainsContent();
 const SwViewShell *pSh = m_pRoot->GetCurrShell();
 const bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -2129,6 +2136,8 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp 
*pI ) :
 , m_bIndicator( false )
 #endif
 {
+comphelper::ProfileZone("SwLayIdle::SwLayIdle");
+
 SAL_INFO("sw.idle", "SwLayIdle() entry");
 
 pImp->m_pIdleAct = this;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 65e884aa51dc585d0258f9eb87eb0207fa00d0dd
Author: Miklos Vajna 
AuthorDate: Fri Jul 16 09:09:52 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 16 12:15:57 2021 +0200

sw: xDictionary may be an empty reference in SID_SPELLCHECK_IGNORE_ALL

Seen in a crashreport:

handleFatalSignal
./common/SigUtil.cpp:255
/lib/x86_64-linux-gnu/libpthread.so.0
__restore_rt
??:?
program/../program/libswlo.so
SwTextShell::Execute(SfxRequest&)
sw/source/uibase/shells/textsh1.cxx:1496

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

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 44fa64318acb..3ea93b2c5ee4 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1493,7 +1493,7 @@ void SwTextShell::Execute(SfxRequest )
 OUString sWord(xSpellAlt->getWord());
 linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( 
xDictionary,
 sWord, false, OUString() );
-if (linguistic::DictionaryError::NONE != nAddRes && 
!xDictionary->getEntry(sWord).is())
+if (linguistic::DictionaryError::NONE != nAddRes && 
xDictionary.is() && !xDictionary->getEntry(sWord).is())
 {
 SvxDicError(rWrtSh.GetView().GetFrameWeld(), nAddRes);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-15 Thread Miklos Vajna (via logerrit)
 sw/source/core/crsr/crsrsh.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6e6cb89df3ee6b001b94a758920b679e5c4d53b8
Author: Miklos Vajna 
AuthorDate: Wed Jul 14 16:30:49 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Jul 15 10:44:09 2021 +0200

sw lok: guard against half-constructed views in sendLOKCursorUpdates()

Crashreport backtrace is:

SwCursorShell::sendLOKCursorUpdates()
sw/source/core/crsr/crsrsh.cxx:2044
SwCursorShell::UpdateCursor(unsigned short, bool)
sw/source/core/crsr/crsrsh.cxx:2032
SwCursorShell::GotoFieldmark(sw::mark::IFieldmark const*)
sw/source/core/crsr/crbm.cxx:315
SwWrtShell::GotoFieldmark(sw::mark::IFieldmark const*)
sw/source/uibase/wrtsh/wrtsh3.cxx:93 (discriminator 4)
SwWrtShell::SwWrtShell(SwDoc&, vcl::Window*, SwView&, SwViewOption 
const*)
sw/source/uibase/wrtsh/wrtsh1.cxx:1709
SwView::SwView(SfxViewFrame*, SfxViewShell*)

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 7a3c3ec421b8..fd0e4aef29a8 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2035,7 +2035,8 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool 
bIdleEnd )
 void SwCursorShell::sendLOKCursorUpdates()
 {
 SwView* pView = static_cast(GetSfxViewShell());
-if (!pView)
+// The view may not have a writer shell if the view's ctor did not finish 
yet.
+if (!pView || !pView->GetWrtShellPtr())
 return;
 
 SwWrtShell* pShell = >GetWrtShell();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-04 Thread Noel Grandin (via logerrit)
 sw/source/uibase/uiview/uivwimp.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0c89088b3974ae5c2e0853a2d9971f2fc00d1d5c
Author: Noel Grandin 
AuthorDate: Fri Jul 2 11:19:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 4 09:09:43 2021 +0200

fix potential use-after-free in SwClipboardChangeListener

we think we're seeing this in COOL

Change-Id: I29a287b032158076a99a836d98113d1623ebef99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118277
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 558dface96fbc5f487b16cfa1bf3c3ea20776331)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118264
Reviewed-by: Michael Meeks 
Tested-by: Noel Grandin 

diff --git a/sw/source/uibase/uiview/uivwimp.cxx 
b/sw/source/uibase/uiview/uivwimp.cxx
index 9dc6d467f941..ee6b5d66de1c 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -292,6 +292,8 @@ SwClipboardChangeListener::~SwClipboardChangeListener()
 
 void SAL_CALL SwClipboardChangeListener::disposing( const EventObject& 
/*rEventObject*/ )
 {
+SolarMutexGuard aGuard;
+pView = nullptr; // so we don't touch the view if changedContents somehow 
fires afterwards
 }
 
 void SAL_CALL SwClipboardChangeListener::changedContents( const 
css::datatransfer::clipboard::ClipboardEvent& rEventObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-26 Thread merttumer (via logerrit)
 sw/source/uibase/shells/basesh.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit b11cf78fe322075d7d20945a52d000d86fd79d56
Author: merttumer 
AuthorDate: Wed May 26 10:34:22 2021 +0300
Commit: Mert Tumer 
CommitDate: Wed May 26 19:17:27 2021 +0200

lok: Re-Enable AnchorToPara context menu item

Change-Id: I0f1f4121c06b8f628f4fe49284737cea3d28e4b8
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116141
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 37ec78c3762e..00607bc3eb8c 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1720,8 +1720,7 @@ void SwBaseShell::GetState( SfxItemSet  )
 
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_PARAGRAPH
-|| nWhich == FN_TOOL_ANCHOR_FRAME)
+if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_FRAME)
 {
 rSet.DisableItem(nWhich);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-05 Thread Gülşah Köse (via logerrit)
 sw/source/core/edit/edfcol.cxx |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit 4fb142c13d9cea0290cae05831a3aeea234f821d
Author: Gülşah Köse 
AuthorDate: Tue Apr 27 00:33:18 2021 +0300
Commit: Jan Holesovsky 
CommitDate: Wed May 5 14:22:55 2021 +0200

Fix broken TOX in Online.

1. Open a German file in the Online
2. Insert a new paragraph, and change its style to "Ueberschrift 1"
3. Go to the Table of Content, and choose "Update Index"
4. See the index got destroyed, and when you look at the list of
   styles, the "Ueberschrift 1" has disappeared, and "Heading 1"
   appeared instead.

This reverts part of:
commit ca435be45f316120b9df6c9d547b781ed975817d
writer: handle styles in multiple languages for online

Change-Id: I82e46b3cf7824df6efdbb4b2a16716153ddae0df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114683
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index af77410ccdcf..b6d8f0b4296e 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -2201,16 +2201,6 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl 
*pFormat,
 
 SwRewriter aRewriter;
 
-// in online we can have multiple languages, use universal name then
-if (comphelper::LibreOfficeKit::isActive())
-{
-OUString aName;
-sal_uInt16 nId = 
SwStyleNameMapper::GetPoolIdFromUIName(pLocal->GetName(), 
SwGetPoolIdFromName::TxtColl);
-SwStyleNameMapper::FillProgName(nId, aName);
-if (!aName.isEmpty())
-pLocal->SetName(aName);
-}
-
 aRewriter.AddRule(UndoArg1, pLocal->GetName());
 
 GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::SETFMTCOLL, 
);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-21 Thread Gülşah Köse (via logerrit)
 sw/source/ui/dbui/mmdocselectpage.cxx  |   30 ++--
 sw/source/ui/dbui/mmdocselectpage.hxx  |2 +
 sw/uiconfig/swriter/ui/mmselectpage.ui |   35 -
 3 files changed, 56 insertions(+), 11 deletions(-)

New commits:
commit efc99a06894ab7cd8a16fced93aaafc5fdb5133f
Author: Gülşah Köse 
AuthorDate: Tue Apr 13 08:48:32 2021 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Apr 21 08:40:09 2021 +0200

tdf#139906  Add an option to change data source from mail merge wizard 
dialog.

Change-Id: I52dfd9be82813a1b01c725eab97a7534ae9a05d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114079
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114373
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx 
b/sw/source/ui/dbui/mmdocselectpage.cxx
index 58151d969acf..7d99f8274976 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -30,9 +30,8 @@
 #include 
 #include 
 #include 
-
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -54,6 +53,7 @@ 
SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
 , m_xBrowseTemplatePB(m_xBuilder->weld_button("browsetemplate"))
 , m_xRecentDocLB(m_xBuilder->weld_combo_box("recentdoclb"))
 , m_xDataSourceWarningFT(m_xBuilder->weld_label("datasourcewarning"))
+, m_xExchangeDatabasePB(m_xBuilder->weld_button("exchangedatabase"))
 {
 m_xCurrentDocRB->set_active(true);
 DocSelectHdl(*m_xNewDocRB);
@@ -69,6 +69,9 @@ 
SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
 m_xBrowseDocPB->connect_clicked(aFileSelectHdl);
 m_xBrowseTemplatePB->connect_clicked(aFileSelectHdl);
 
+Link aExchangeDatabaseHdl = LINK(this, 
SwMailMergeDocSelectPage, ExchangeDatabaseHdl);
+m_xExchangeDatabasePB->connect_clicked(aExchangeDatabaseHdl);
+
 const uno::Sequence< OUString >& rDocs =
 m_pWizard->GetConfigItem().GetSavedDocuments();
 for(const auto& rDoc : rDocs)
@@ -105,6 +108,11 @@ IMPL_LINK_NOARG(SwMailMergeDocSelectPage, DocSelectHdl, 
weld::ToggleButton&, voi
 m_xDataSourceWarningFT->hide();
 m_pWizard->enableButtons(WizardButtonFlags::NEXT, 
m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
 }
+
+if(m_xCurrentDocRB->get_active())
+m_xExchangeDatabasePB->set_sensitive(true);
+else
+m_xExchangeDatabasePB->set_sensitive(false);
 }
 
 IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, weld::Button&, rButton, 
void)
@@ -160,6 +168,24 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, 
weld::Button&, rButton, void)
 m_pWizard->enableButtons(WizardButtonFlags::NEXT, 
m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
 }
 
+IMPL_LINK_NOARG(SwMailMergeDocSelectPage, ExchangeDatabaseHdl, weld::Button&, 
void)
+{
+
+SwAbstractDialogFactory& rFact = ::swui::GetFactory();
+ScopedVclPtr 
pDlg(rFact.CreateSwChangeDBDlg(*m_pWizard->GetSwView()));
+pDlg->Execute();
+
+OUString sDataSourceName = m_pWizard->GetSwView()->GetDataSourceName();
+
+if(m_xCurrentDocRB->get_active() &&
+   !sDataSourceName.isEmpty() &&
+   SwView::IsDataSourceAvailable(sDataSourceName))
+{
+m_xDataSourceWarningFT->hide();
+m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
+}
+}
+
 bool SwMailMergeDocSelectPage::commitPage( 
::vcl::WizardTypes::CommitPageReason _eReason )
 {
 bool bReturn = false;
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx 
b/sw/source/ui/dbui/mmdocselectpage.hxx
index eccb3ffdda15..8a2a86a6e400 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -40,9 +40,11 @@ class SwMailMergeDocSelectPage : public vcl::OWizardPage
 std::unique_ptr m_xBrowseTemplatePB;
 std::unique_ptr m_xRecentDocLB;
 std::unique_ptr m_xDataSourceWarningFT;
+std::unique_ptr m_xExchangeDatabasePB;
 
 DECL_LINK(DocSelectHdl, weld::ToggleButton&, void);
 DECL_LINK(FileSelectHdl, weld::Button&, void);
+DECL_LINK(ExchangeDatabaseHdl, weld::Button&, void);
 
 virtual boolcommitPage( ::vcl::WizardTypes::CommitPageReason _eReason 
) override;
 
diff --git a/sw/uiconfig/swriter/ui/mmselectpage.ui 
b/sw/uiconfig/swriter/ui/mmselectpage.ui
index 4f5da744c05c..323af20266fd 100644
--- a/sw/uiconfig/swriter/ui/mmselectpage.ui
+++ b/sw/uiconfig/swriter/ui/mmselectpage.ui
@@ -55,7 +55,7 @@
   
   
 0
-1
+3
   
 
 
@@ -72,7 +72,7 @@
   
   
 0
-2
+4
   
 
 
@@ -89,7 +89,7 @@
   
   

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

2021-04-16 Thread Michael Meeks (via logerrit)
 sw/source/core/doc/DocumentSettingManager.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 87ac748c2f27abb0230e3f866b8638bd64da8243
Author: Michael Meeks 
AuthorDate: Fri Apr 16 15:56:41 2021 +0100
Commit: Michael Meeks 
CommitDate: Fri Apr 16 18:06:40 2021 +0200

lok: force writer web-view off.

A number of callers mutate this, so make the setting un-writable.

Change-Id: I0a3727020309b92543e42730c997168f076e7bfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114178
Reviewed-by: Miklos Vajna 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index d7af55649e62..e69d50d123e6 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -400,7 +401,11 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 // COMPATIBILITY FLAGS END
 
 case DocumentSettingId::BROWSE_MODE: //can be used temporary 
(load/save) when no SwViewShell is available
-mbLastBrowseMode = value;
+// Can't render in webview successfully.
+if (comphelper::LibreOfficeKit::isActive())
+mbLastBrowseMode = false;
+else
+mbLastBrowseMode = value;
 break;
 
 case DocumentSettingId::HTML_MODE:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-12 Thread Miklos Vajna (via logerrit)
 sw/source/core/doc/docfmt.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 332f5479ec30588305b9077eed81a644bbb5d4e8
Author: Miklos Vajna 
AuthorDate: Fri Apr 9 16:40:01 2021 +0200
Commit: Mike Kaganski 
CommitDate: Mon Apr 12 15:37:21 2021 +0200

sw style copy: fix crash when handling a conditional paragraphy style

- "Text body" is normally a conditional style for a full-blown, default
  SwDoc

- SwTransferable::GetData() creates a temporary, stripped down SwDoc,
  which has a "Text body" style, but it's not conditional

- SwDoc::CopyFormatArr() assumes that in case the target already has a
  style with a given name, then either both the source and destination
  styles are conditional, or neither

- in practice this only causes a crash if the style is customized, as we
  skip default styles, probably that's why this was not noticed so far

The Online case invokes this as part of
lok::Document::getSelectionType(), so it was enough to set the paragraph
style to Text body and then select some of that text (with a suitable
document) to hit this.

Based on a patch from Michael Meeks, thanks for that.

(cherry picked from commit ce98bef935dccd79735615a9299b2aa7a1ab0b94)

Conflicts:
sw/qa/extras/tiledrendering/tiledrendering.cxx

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

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index f7a11676594e..e61d27c6a961 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1328,9 +1328,18 @@ void SwDoc::CopyFormatArr( const SwFormatsBase& 
rSourceArr,
 
 //FEATURE::CONDCOLL
 if( RES_CONDTXTFMTCOLL == pSrc->Which() )
+{
+if (pDstColl->Which() != RES_CONDTXTFMTCOLL)
+{
+// Target already had a style with a matching name, but 
it's not a conditional
+// style, then don't copy the conditions.
+continue;
+}
+
 // Copy the conditions, but delete the old ones first!
 
static_cast(pDstColl)->SetConditions(
 
static_cast(pSrc)->GetCondColls() );
+}
 //FEATURE::CONDCOLL
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-22 Thread Mike Kaganski (via logerrit)
 sw/source/ui/dialog/wordcountdialog.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit cdea41e35a6b7aabfe5dca9ab76b567af2a1df24
Author: Mike Kaganski 
AuthorDate: Thu Jul 30 00:43:14 2020 +0300
Commit: Miklos Vajna 
CommitDate: Mon Mar 22 11:42:37 2021 +0100

tdf#135244: don't jump when updating counts

Change-Id: Id1693e420a51a913fa78da7b7f46e076876ffe68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99756
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112829
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/dialog/wordcountdialog.cxx 
b/sw/source/ui/dialog/wordcountdialog.cxx
index 3dd7149b558e..6683215d5f86 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -135,7 +136,9 @@ void SwWordCountFloatDlg::UpdateCounts()
 SwDocStat aCurrCnt;
 SwDocStat aDocStat;
 {
-SwWait aWait( *::GetActiveView()->GetDocShell(), true );
+auto& rDocShell(*GetActiveView()->GetDocShell());
+SwWait aWait(rDocShell, true);
+auto aLock = rDocShell.LockAllViews();
 rSh.StartAction();
 rSh.CountWords( aCurrCnt );
 aDocStat = rSh.GetUpdatedDocStat();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-22 Thread Mike Kaganski (via logerrit)
 sw/source/ui/chrdlg/drpcps.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 77b662189bd092934bcf13612eca632c1993a55a
Author: Mike Kaganski 
AuthorDate: Thu Jul 30 01:10:31 2020 +0300
Commit: Miklos Vajna 
CommitDate: Mon Mar 22 11:41:40 2021 +0100

tdf#135244: prevent jumping when generating drop caps preview

Change-Id: Ifd9ade76384c66312eda8c8ee7cb41891459b3f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99757
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112828
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 0c539a16901d..0d0583f3d05e 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -196,6 +196,9 @@ void SwDropCapsPict::UpdatePaintSettings()
 vcl::Font aFont;
 if (mpPage)
 {
+// tdf#135244: preview generation should not jump document view
+auto aLock(mpPage->rSh.GetView().GetDocShell()->LockAllViews());
+
 if (!mpPage->m_xTemplateBox->get_active())
 {
 // query the Font at paragraph's beginning
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-22 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit bfd1c48fd30c12f05c2d4d8d3da2bf30a90c
Author: Mike Kaganski 
AuthorDate: Wed Jul 29 17:58:15 2020 +0300
Commit: Miklos Vajna 
CommitDate: Mon Mar 22 11:39:04 2021 +0100

tdf#135244: prevent jumping to cursor at document render

This prevents the jumps when printing

Change-Id: I8b6f7d60aa0ed443ec8e05ad5812830a6b655abb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99715
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112827
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 6eeec4395f04..1f9a92724c2c 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2951,6 +2951,11 @@ void SAL_CALL SwXTextDocument::render(
 if (0 > nRenderer)
 throw IllegalArgumentException();
 
+// tdf#135244: prevent jumping to cursor at any temporary modification
+decltype(pDocShell->LockAllViews()) aLock;
+if (pDocShell)
+aLock = pDocShell->LockAllViews();
+
 const bool bHasPDFExtOutDevData = lcl_SeqHasProperty( rxOptions, 
"HasPDFExtOutDevData" );
 const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ) || 
bHasPDFExtOutDevData;
 bool bIsSwSrcView = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-16 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/dbui/dbtree.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 0460f3ee99fc09a336ade6aa88b3d9296e553e39
Author: Mike Kaganski 
AuthorDate: Sun Mar 14 14:33:34 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Mar 16 10:49:50 2021 +0100

tdf#141012: do not try to expand the node if RequestingChildrenHdl failed

Just select the database node itself, so that it's still obvious which
database is associated with this document.

After selecting this node when initializing the tab, another call to
SwDBTreeList::Select will be made, so make sure to handle empty table and
column names.

Change-Id: Ie1d1bd445e18d5900910c780a24102b4dde5c787
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112467
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 351edb44eb0548f7e56464de42c1758a1f5e4ab4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112423
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index eea90633e048..f2aafb77965d 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -333,14 +333,25 @@ void SwDBTreeList::Select(const OUString& rDBName, const 
OUString& rTableName, c
 {
 if (rDBName == m_xTreeView->get_text(*xParent))
 {
+if (rTableName.isEmpty() && rColumnName.isEmpty())
+{
+// Just select the database node, do not expand
+m_xTreeView->scroll_to_row(*xParent);
+m_xTreeView->select(*xParent);
+return;
+}
 if (!m_xTreeView->iter_has_child(*xParent))
 {
 RequestingChildrenHdl(*xParent);
-m_xTreeView->expand_row(*xParent);
+// If successful, it will be expanded in a call to 
scroll_to_row for its children
 }
 std::unique_ptr 
xChild(m_xTreeView->make_iterator(xParent.get()));
 if (!m_xTreeView->iter_children(*xChild))
+{
+m_xTreeView->scroll_to_row(*xParent);
+m_xTreeView->select(*xParent);
 continue;
+}
 do
 {
 if (rTableName == m_xTreeView->get_text(*xChild))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-11 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   61 +
 1 file changed, 42 insertions(+), 19 deletions(-)

New commits:
commit 57cbadcd84bff198811629470f0554396b041f40
Author: Mike Kaganski 
AuthorDate: Tue Mar 9 12:59:41 2021 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 11 09:14:31 2021 +0100

tdf#40427: use node index as position, not Y position on screen

As mentioned in comment to SwContent::nYPosition in
sw/source/uibase/inc/swcont.hxx:

  some subclasses appear to use this for a tools/gen.hxx-style
  geometric Y position, while e.g. SwOutlineContent wants to store
  the index in its subtree

Abusing the nYPosition to store vertical position *on screen* gives
wrong results when a following section is positioned on screen higher
than a previous section - e.g., when multiple-page view is active.

So just use the section's node as Y position of the Navigator entry.
When the section is inside a fly frame, use the frame's anchor node.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 85e6d4559608..06c4795a6531 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -268,6 +268,26 @@ namespace
 
 return false;
 }
+
+// Gets "YPos" for SwRegionContent, i.e. a number used to sort sections in 
Navigator's list
+long getYPosForSection(const SwNodeIndex& rNodeIndex)
+{
+sal_uLong nIndex = rNodeIndex.GetIndex();
+if (rNodeIndex.GetNodes().GetEndOfExtras().GetIndex() >= nIndex)
+{
+// Not a node of BodyText
+// Are we in a fly?
+if (const auto pFlyFormat = rNodeIndex.GetNode().GetFlyFormat())
+{
+// Get node index of anchor
+if (auto pSwPosition = pFlyFormat->GetAnchor().GetContentAnchor())
+{
+nIndex = getYPosForSection(pSwPosition->nNode);
+}
+}
+}
+return static_cast(nIndex);
+}
 } // end of anonymous namespace
 
 SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, 
sal_uInt8 nLevel) :
@@ -359,18 +379,20 @@ void SwContentType::Init(bool* pbInvalidateWindow)
 pOldMember = std::move(m_pMember);
 m_pMember.reset( new SwContentArr );
 }
-const Point aNullPt;
 m_nMemberCount = m_pWrtShell->GetSectionFormatCount();
 for(size_t i = 0; i < m_nMemberCount; ++i)
 {
-const SwSectionFormat* pFormat;
-SectionType eTmpType;
-if( (pFormat = 
_pWrtShell->GetSectionFormat(i))->IsInNodesArr() &&
-(eTmpType = pFormat->GetSection()->GetType()) != 
TOX_CONTENT_SECTION
-&& TOX_HEADER_SECTION != eTmpType )
+const SwSectionFormat* pFormat = 
_pWrtShell->GetSectionFormat(i);
+if (!pFormat->IsInNodesArr())
+continue;
+const SwSection* pSection = pFormat->GetSection();
+if (SectionType eTmpType = pSection->GetType();
+eTmpType == TOX_CONTENT_SECTION || eTmpType == 
TOX_HEADER_SECTION)
+continue;
+const SwNodeIndex* pNodeIndex = 
pFormat->GetContent().GetContentIdx();
+if (pNodeIndex)
 {
-const OUString& rSectionName =
-pFormat->GetSection()->GetSectionName();
+const OUString& rSectionName = pSection->GetSectionName();
 sal_uInt8 nLevel = 0;
 SwSectionFormat* pParentFormat = pFormat->GetParent();
 while(pParentFormat)
@@ -380,8 +402,7 @@ void SwContentType::Init(bool* pbInvalidateWindow)
 }
 
 std::unique_ptr pCnt(new SwRegionContent(this, 
rSectionName,
-nLevel,
-pFormat->FindLayoutRect( false,  ).Top()));
+nLevel, getYPosForSection(*pNodeIndex)));
 
 SwPtrMsgPoolItem aAskItem( RES_CONTENT_VISIBLE, nullptr );
 if( !pFormat->GetInfo( aAskItem ) &&
@@ -664,17 +685,20 @@ void SwContentType::FillMemberList(bool* 
pbLevelOrVisibilityChanged)
 break;
 case ContentTypeId::REGION:
 {
-const Point aNullPt;
 m_nMemberCount = m_pWrtShell->GetSectionFormatCount();
 for(size_t i = 0; i < m_nMemberCount; ++i)
 {
-const SwSectionFormat* pFormat;
-SectionType eTmpType;
-if( (pFormat = 

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

2021-02-23 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   48 ++-
 1 file changed, 25 insertions(+), 23 deletions(-)

New commits:
commit 70bc089fe9bec46ef4ca0417518ee06302c65f4c
Author: Miklos Vajna 
AuthorDate: Tue Feb 23 10:04:03 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 23 12:28:21 2021 +0100

sw lok: simplify SwTransferable::isComplex()

Commit 169a87563a3940299811d874b4df0ad13591771c (LOK: Implement
getSelectionType, 2019-06-24) implemented detecting complex selections
by copying the selection to a new SwDoc, which probably had two
benefits: first, the created SwPaM instance didn't touch the document;
second, this means no bounds has to be set when scanning nodes: the
entire document is the selection.

Later commit 7fe30d1cb00c576469d6cbe5606268a9cdf35bd3 (LOK: detect
Graphics in isComplex for Writer, 2019-06-25) got rid of the SwPaM
(which would register itself into text nodes), so now it's possible to
not touch the document, even if we work on the original document.

Instead, solve the partial scanning by iterating over the list of
selections. This is meant to be faster, and also less likely to crash in
case some internal document model invariant is broken.

No testcase, testComplexSelection in CppunitTest_desktop_lib already
covers thie behavior.

(cherry picked from commit 7a8dc25defee31edbb75a2f8c35f92ee2d3f3a83)

Conflicts:
sw/source/uibase/dochdl/swdtflvr.cxx

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

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index a58d4140ccd1..187332ba64f3 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -134,6 +134,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -434,33 +435,34 @@ namespace
 
 sal_Bool SAL_CALL SwTransferable::isComplex()
 {
-// Copy into a new Doc so we don't mess with the existing one.
-//FIXME: We *should* be able to avoid this and improve the performance.
-m_pClpDocFac.reset(new SwDocFac);
-SwDoc* const pTmpDoc = lcl_GetDoc(*m_pClpDocFac);
-
-pTmpDoc->getIDocumentFieldsAccess()
-.LockExpFields(); // never update fields - leave text as it is
-lclOverWriteDoc(*m_pWrtShell, *pTmpDoc);
-
 sal_Int32 nTextLength = 0;
-const SwNode* pEndOfContent = 
_pWrtShell->GetDoc()->GetNodes().GetEndOfContent();
-SwNodes& aNodes = pTmpDoc->GetNodes();
-for( sal_uLong nIndex = 0; nIndex < aNodes.Count(); ++nIndex)
+SwNodes& aNodes = m_pWrtShell->GetDoc()->GetNodes();
+for (SwPaM& rPaM : m_pWrtShell->GetCursor()->GetRingContainer())
 {
-SwNode& rNd = *aNodes[nIndex];
-if ( == pEndOfContent)
-break;
+for (sal_uLong nIndex = rPaM.GetMark()->nNode.GetIndex();
+ nIndex <= rPaM.GetPoint()->nNode.GetIndex(); ++nIndex)
+{
+SwNode& rNd = *aNodes[nIndex];
 
-if (rNd.IsOLENode() || rNd.IsGrfNode())
-return true; // Complex
+SwTextNode* pTextNode = rNd.GetTextNode();
+if (pTextNode)
+{
+if (pTextNode->HasHints())
+{
+for (size_t nHint = 0; pTextNode->GetSwpHints().Count(); 
++nHint)
+{
+SwTextAttr* pHint = 
pTextNode->GetSwpHints().Get(nHint);
+if (pHint->Which() == RES_TXTATR_FLYCNT)
+{
+return true; // Complex
+}
+}
+}
 
-SwTextNode* pTextNode = rNd.GetTextNode();
-if (pTextNode)
-{
-nTextLength += pTextNode->GetText().getLength();
-if (nTextLength >= 1024 * 512)
-return true; // Complex
+nTextLength += pTextNode->GetText().getLength();
+if (nTextLength >= 1024 * 512)
+return true; // Complex
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-17 Thread Aron Budea (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 934ed8d888abe231c014ce179e5256933b0562ed
Author: Aron Budea 
AuthorDate: Mon Feb 15 21:46:45 2021 +0100
Commit: Miklos Vajna 
CommitDate: Wed Feb 17 09:12:16 2021 +0100

Avoid crash in online on a document with comments

Crashed on a specific doc with the following backtrace:

Thread 1 "kitbroker_001" received signal SIGSEGV, Segmentation fault.
0x7f4807c76d44 in sw::annotation::SwAnnotationWin::GetPostItField
(this=0x0)
at /.../libreoffice/sw/inc/AnnotationWin.hxx:71
71  const SwPostItField* GetPostItField() const { return 
mpField; }

 0  0x7f4807c76d44 in sw::annotation::SwAnnotationWin::GetPostItField()
const (this=0x0)
at /.../libreoffice/sw/inc/AnnotationWin.hxx:71
 1  0x7f4807f0641b in SwXTextDocument::getPostIts(tools::JsonWriter&)
(this=0x557e1d985a10, rJsonWriter=...)
at /.../libreoffice/sw/source/uibase/uno/unotxdoc.cxx:3337
 2  0x7f4823216534 in getPostIts(LibreOfficeKitDocument*)
(pThis=0x557e1d93c890)
at /.../libreoffice/desktop/source/lib/init.cxx:3425
...

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

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index a3f165c1ff61..6eeec4395f04 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3345,6 +3345,11 @@ OUString SwXTextDocument::getPostIts()
 {
 sw::annotation::SwAnnotationWin* pWin = sidebarItem->pPostIt.get();
 
+if (!pWin)
+{
+continue;
+}
+
 const SwPostItField* pField = pWin->GetPostItField();
 const SwRect& aRect = pWin->GetAnchorRect();
 tools::Rectangle aSVRect(aRect.Pos().getX(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-12 Thread Jim Raykowski (via logerrit)
 sw/source/core/frmedt/feshview.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit a7fc4a7f1be6842b0455a50f74d4869788e6018f
Author: Jim Raykowski 
AuthorDate: Mon Nov 16 08:09:11 2020 -0900
Commit: Aron Budea 
CommitDate: Fri Feb 12 22:28:59 2021 +0100

tdf#130629 Don't add object insert undo twice

Change-Id: I074afd4397b6fc4631bd00655de56b8a154d7dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105955
Tested-by: Jenkins
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 
Reviewed-by: Jim Raykowski 
(cherry picked from commit 5110cca39cc55c8977b81f7b09873e626144b29b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105995
(cherry picked from commit 46d6effe3373a39938bde57b43dc45c4a30ce33f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110834
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 2cb024f5..8935aea0c62b 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -3154,7 +3154,12 @@ long SwFEShell::GetSectionWidth( SwFormat const & 
rFormat ) const
 }
 SdrPageView* pPageView = pDrawView->GetSdrPageView();
 SdrCreateView::SetupObjLayer(pPageView, pDrawView->GetActiveLayer(), 
pObj);
+// switch undo off or this combined with ImpEndCreate will cause two 
undos
+// see comment made in SwFEShell::EndCreate (we create our own 
undo-object!)
+const bool bUndo(GetDoc()->GetIDocumentUndoRedo().DoesUndo());
+GetDoc()->GetIDocumentUndoRedo().DoUndo(false);
 pDrawView->InsertObjectAtView(pObj, *pPageView);
+GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
 }
 ImpEndCreate();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-10 Thread Tamás Zolnai (via logerrit)
 sw/source/core/crsr/bookmrk.cxx |   76 +++-
 sw/source/core/doc/docbm.cxx|   10 ++---
 sw/source/core/inc/bookmrk.hxx  |3 +
 3 files changed, 44 insertions(+), 45 deletions(-)

New commits:
commit c591ae91b25fd69e6424434b92894c57671253ca
Author: Tamás Zolnai 
AuthorDate: Wed Feb 10 15:07:08 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Feb 10 16:50:54 2021 +0100

LOK: form field button: split SendLOKMessage() method.

Hiding form fiel button can be static. We don't need to
know which fieldmark has the actual button.

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

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 4a4aad532aaa..9d184f37daa1 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -652,7 +652,7 @@ namespace sw { namespace mark
 }
 }
 
-void DropDownFieldmark::SendLOKMessage(SfxViewShell* pViewShell, const 
OString& sAction)
+void DropDownFieldmark::SendLOKShowMessage(SfxViewShell* pViewShell)
 {
 if (!comphelper::LibreOfficeKit::isActive())
 return;
@@ -660,49 +660,47 @@ namespace sw { namespace mark
 if (!pViewShell || pViewShell->isLOKMobilePhone())
 return;
 
-OStringBuffer sPayload;
-if (sAction == "show")
-{
-if (m_aPortionPaintArea.IsEmpty())
-return;
-
-sPayload = OStringLiteral("{\"action\": \"show\","
-   " \"type\": \"drop-down\", \"textArea\": \"") +
-   m_aPortionPaintArea.SVRect().toString() + "\",";
-// Add field params to the message
-sPayload.append(" \"params\": { \"items\": [");
-
-// List items
-auto pParameters = this->GetParameters();
-auto pListEntriesIter = 
pParameters->find(ODF_FORMDROPDOWN_LISTENTRY);
-css::uno::Sequence vListEntries;
-if (pListEntriesIter != pParameters->end())
-{
-pListEntriesIter->second >>= vListEntries;
-for (const OUString& sItem : std::as_const(vListEntries))
-sPayload.append("\"" + OUStringToOString(sItem, 
RTL_TEXTENCODING_UTF8) + "\", ");
-sPayload.setLength(sPayload.getLength() - 2);
-}
-sPayload.append("], ");
+if (m_aPortionPaintArea.IsEmpty())
+return;
 
-// Selected item
-OUString sResultKey = ODF_FORMDROPDOWN_RESULT;
-auto pSelectedItemIter = pParameters->find(sResultKey);
-sal_Int32 nSelection = -1;
-if (pSelectedItemIter != pParameters->end())
-{
-pSelectedItemIter->second >>= nSelection;
-}
-sPayload.append("\"selected\": \"" + OString::number(nSelection) + 
"\", ");
+OStringBuffer sPayload;
+sPayload = OStringLiteral("{\"action\": \"show\","
+   " \"type\": \"drop-down\", \"textArea\": \"") +
+   m_aPortionPaintArea.SVRect().toString() + "\",";
+// Add field params to the message
+sPayload.append(" \"params\": { \"items\": [");
 
-// Placeholder text
-sPayload.append("\"placeholderText\": \"" + 
OUStringToOString(SwResId(STR_DROP_DOWN_EMPTY_LIST), RTL_TEXTENCODING_UTF8) + 
"\"}}");
+// List items
+auto pParameters = this->GetParameters();
+auto pListEntriesIter = pParameters->find(ODF_FORMDROPDOWN_LISTENTRY);
+css::uno::Sequence vListEntries;
+if (pListEntriesIter != pParameters->end())
+{
+pListEntriesIter->second >>= vListEntries;
+for (const OUString& sItem : std::as_const(vListEntries))
+sPayload.append("\"" + OUStringToOString(sItem, 
RTL_TEXTENCODING_UTF8) + "\", ");
+sPayload.setLength(sPayload.getLength() - 2);
 }
-else
+sPayload.append("], ");
+
+// Selected item
+OUString sResultKey = ODF_FORMDROPDOWN_RESULT;
+auto pSelectedItemIter = pParameters->find(sResultKey);
+sal_Int32 nSelection = -1;
+if (pSelectedItemIter != pParameters->end())
 {
-assert(sAction == "hide");
-sPayload = "{\"action\": \"hide\", \"type\": \"drop-down\"}";
+pSelectedItemIter->second >>= nSelection;
 }
+sPayload.append("\"selected\": \"" + OString::number(nSelection) + 
"\", ");
+
+// Placeholder text
+sPayload.append("\"placeholderText\": \"" + 
OUStringToOString(SwResId(STR_DROP_DOWN_EMPTY_LIST), RTL_TEXTENCODING_UTF8) + 
"\"}}");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, 
sPayload.toString().getStr());
+}
+
+void 

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

2021-02-10 Thread Tamás Zolnai (via logerrit)
 sw/source/core/crsr/bookmrk.cxx |   12 
 sw/source/core/inc/bookmrk.hxx  |2 --
 sw/source/uibase/shells/textsh1.cxx |4 
 3 files changed, 18 deletions(-)

New commits:
commit e8d1504ba7299d78dd825a512e8f04ef33900997
Author: Tamás Zolnai 
AuthorDate: Wed Feb 10 11:04:25 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Feb 10 16:50:22 2021 +0100

Dropdown form field: don't increase code compexity for gen backend.

It's just an internal thing, we don't really need to
optimize the code for it. This HideButton() function is
not use anywhere else.

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

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 097e2dea6bd2..472c0af54557 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -611,12 +611,6 @@ namespace sw { namespace mark
 m_pButton.disposeAndClear();
 }
 
-void FieldmarkWithDropDownButton::HideButton()
-{
-if(m_pButton)
-m_pButton->Show(false);
-}
-
 void FieldmarkWithDropDownButton::RemoveButton()
 {
 if(m_pButton)
@@ -645,12 +639,6 @@ namespace sw { namespace mark
 }
 }
 
-void DropDownFieldmark::HideButton()
-{
-SendLOKMessage("hide");
-FieldmarkWithDropDownButton::HideButton();
-}
-
 void DropDownFieldmark::RemoveButton()
 {
 SendLOKMessage("hide");
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index f0f81bf32c3c..2fe0cf3a0d5e 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -278,7 +278,6 @@ namespace sw {
 virtual ~FieldmarkWithDropDownButton() override;
 
 virtual void ShowButton(SwEditWin* pEditWin) = 0;
-virtual void HideButton();
 virtual void RemoveButton();
 
 protected:
@@ -294,7 +293,6 @@ namespace sw {
 virtual ~DropDownFieldmark() override;
 
 virtual void ShowButton(SwEditWin* pEditWin) override;
-virtual void HideButton() override;
 virtual void RemoveButton() override;
 
 // This method should be called only by the portion so we can now 
the portion's painting area
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 298c6ed4a2c9..44fa64318acb 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1418,8 +1418,6 @@ void SwTextShell::Execute(SfxRequest )
 pFieldBM->Invalidate();
 rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() );
 rWrtSh.UpdateCursor(); // cursor position might be invalid
-// Hide the button here and make it visible later, to make 
transparent background work with SAL_USE_VCLPLUGIN=gen
-
dynamic_cast<::sw::mark::DropDownFieldmark&>(*pFieldBM).HideButton();
 }
 }
 else if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDATE )
@@ -1432,8 +1430,6 @@ void SwTextShell::Execute(SfxRequest )
 rDateField.Invalidate();
 rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() );
 rWrtSh.UpdateCursor(); // cursor position might be invalid
-// Hide the button here and make it visible later, to make 
transparent background work with SAL_USE_VCLPLUGIN=gen
-rDateField.HideButton();
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-10 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/uiview/viewdraw.cxx |   15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit acda15662abfad136d7fc0165f32fd25e775d728
Author: Szymon Kłos 
AuthorDate: Wed Feb 10 07:21:30 2021 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Feb 10 10:13:42 2021 +0100

fontwork: center in online in writer

Avoid unnecessary position change

Change-Id: I338b9a28653569e1b7c19ba3a1f590363fb2f94c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110664
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/sw/source/uibase/uiview/viewdraw.cxx 
b/sw/source/uibase/uiview/viewdraw.cxx
index 233d1cfcff95..d5c2ff4284c7 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -169,18 +169,17 @@ void SwView::ExecDraw(SfxRequest& rReq)
 const SwRect&   rVisArea = 
comphelper::LibreOfficeKit::isActive() ?
 
m_pWrtShell->getLOKVisibleArea() : m_pWrtShell->VisArea();
 Point   aPos( rVisArea.Center() );
+tools::Rectangle aObjRect( pObj->GetLogicRect() );
 
-if( rVisArea.Width() > aDocSize.Width())
+if ( rVisArea.Width() > aDocSize.Width())
 aPos.setX( aDocSize.Width() / 2 + rVisArea.Left() );
+else if (aPos.getX() > aObjRect.GetWidth() / 2)
+ aPos.AdjustX( -(aObjRect.GetWidth() / 2) );
 
-if(rVisArea.Height() > aDocSize.Height())
+if (rVisArea.Height() > aDocSize.Height())
 aPos.setY( aDocSize.Height() / 2 + rVisArea.Top() );
-
-tools::Rectangle aObjRect( pObj->GetLogicRect() );
-if (aPos.getX() > aObjRect.GetWidth() / 2)
-aPos.AdjustX( -(aObjRect.GetWidth() / 2) );
-if (aPos.getY() > aObjRect.GetHeight() / 2)
-aPos.AdjustY( -(aObjRect.GetHeight() / 2) );
+else if (aPos.getY() > aObjRect.GetHeight() / 2)
+ aPos.AdjustY( -(aObjRect.GetHeight() / 2) );
 
 m_pWrtShell->EnterStdMode();
 m_pWrtShell->SwFEShell::InsertDrawObj( *pObj, aPos );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit b982d0e6f94ca70765231ff4242c829f5bec5def
Author: Miklos Vajna 
AuthorDate: Mon Feb 1 17:44:39 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 2 09:50:14 2021 +0100

sw lok: disable field shadings

There are two problems with it:

First, the field shading is rendered behind bullet portions depending on
the cursor position (if the cursor is before the bullet, then we
render it; but not if the cursor is after the bullet), and tiled
rendering assumes that the render result is independent from the cursor
position.

Second, field shading is always painted directly (not going via
invalidation), so it's possible to end up with one tile showing field
shadings and another not, which is inconsistent. And even if it would be
there consistently, that would mean a lot of unnecessary invalidations.

The alternative would be to disable this from online.git's
loolconfig.xcu, but the item's path would end with something like
"ColorScheme['LibreOfficeDev']/WriterFieldShadings", which means it's
not easy to do this in a way that's independent from the product name.

(cherry picked from commit 876da94619d561e4b4c6c7d12a8d6726eb857df8)

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

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 42d872352e92..a3f165c1ff61 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3479,6 +3479,10 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::SequenceGetViewOptions());
 aViewOption.SetHardBlank(false);
+
+// Disable field shadings: the result would depend on the cursor position.
+SwViewOption::SetAppearanceFlag(ViewOptFlags::FieldShadings, false);
+
 for (const beans::PropertyValue& rValue : rArguments)
 {
 if (rValue.Name == ".uno:HideWhitespace" && rValue.Value.has())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-22 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/inc/olesh.hxx|4 +++
 sw/source/uibase/shells/olesh.cxx |   48 ++
 2 files changed, 52 insertions(+)

New commits:
commit 2fbd667ae34cb848e0c455a0d8f61a30ee72566c
Author: Tamás Zolnai 
AuthorDate: Fri Jan 22 11:55:25 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Fri Jan 22 16:16:31 2021 +0100

tdf#139830: keep the right context for chart after view switch (writer).

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

diff --git a/sw/source/uibase/inc/olesh.hxx b/sw/source/uibase/inc/olesh.hxx
index 30979029ed16..be3bb7305a98 100644
--- a/sw/source/uibase/inc/olesh.hxx
+++ b/sw/source/uibase/inc/olesh.hxx
@@ -30,6 +30,10 @@ private:
 /// SfxInterface initializer.
 static void InitInterface_Impl();
 
+protected:
+virtual void Activate(bool bMDI) override;
+virtual void Deactivate(bool bMDI) override;
+
 public:
 SwOleShell(SwView );
 };
diff --git a/sw/source/uibase/shells/olesh.cxx 
b/sw/source/uibase/shells/olesh.cxx
index c688072f9094..a373e2b1ae58 100644
--- a/sw/source/uibase/shells/olesh.cxx
+++ b/sw/source/uibase/shells/olesh.cxx
@@ -29,11 +29,29 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
 
 #define ShellClass_SwOleShell
 #include 
 #include 
 
+using namespace css::uno;
+
+namespace {
+
+bool inChartContext(SwView& rViewShell)
+{
+sfx2::sidebar::SidebarController* pSidebar = 
sfx2::sidebar::Tools::GetSidebarController();
+if (pSidebar)
+return pSidebar->hasChartContextCurrently();
+
+return false;
+}
+
+} // anonymous namespace
+
 SFX_IMPL_INTERFACE(SwOleShell, SwFrameShell)
 
 void SwOleShell::InitInterface_Impl()
@@ -43,6 +61,36 @@ void SwOleShell::InitInterface_Impl()
 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, 
SfxVisibilityFlags::Invisible, ToolbarId::Ole_Toolbox);
 }
 
+void SwOleShell::Activate(bool bMDI)
+{
+if(!inChartContext(GetView()))
+SwFrameShell::Activate(bMDI);
+else
+{
+// Avoid context changes for chart during activation / deactivation.
+const bool bIsContextBroadcasterEnabled 
(SfxShell::SetContextBroadcasterEnabled(false));
+
+SwFrameShell::Activate(bMDI);
+
+SfxShell::SetContextBroadcasterEnabled(bIsContextBroadcasterEnabled);
+}
+}
+
+void SwOleShell::Deactivate(bool bMDI)
+{
+if(!inChartContext(GetView()))
+SwFrameShell::Deactivate(bMDI);
+else
+{
+// Avoid context changes for chart during activation / deactivation.
+const bool bIsContextBroadcasterEnabled 
(SfxShell::SetContextBroadcasterEnabled(false));
+
+SwFrameShell::Deactivate(bMDI);
+
+SfxShell::SetContextBroadcasterEnabled(bIsContextBroadcasterEnabled);
+}
+}
+
 SwOleShell::SwOleShell(SwView &_rView) :
 SwFrameShell(_rView)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-12 Thread Tamás Zolnai (via logerrit)
 sw/source/core/crsr/crsrsh.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7f150d63253e171e87c09225291c4e059aaf2476
Author: Tamás Zolnai 
AuthorDate: Tue Jan 12 16:00:46 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Jan 13 03:02:39 2021 +0100

tdf#139566: Fix select all (table + text) when document window looses focus.

Without setting mbSelectAll properly the selection cursor
is converted to a SwShellTableCursor, which can't handle
if a selection is extended outside of the table.

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9df9af2501e4..7d3b70dbf363 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2415,6 +2415,8 @@ void SwCursorShell::ShellLoseFocus()
 
 void SwCursorShell::ShellGetFocus()
 {
+comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && 
ExtendedSelectedAll());
+
 m_bHasFocus = true;
 if( !m_bBasicHideCursor && VisArea().Width() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-28 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2d7152efbe4420b9ff192d0eccb47b674a8bb666
Author: Tamás Zolnai 
AuthorDate: Mon Dec 28 14:28:06 2020 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Dec 28 15:49:02 2020 +0100

Fix crash in SwXTextDocument::getSelection() method.

pWrtShell was nullptr. This crash was triggered by
an collaborative editing use case.

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

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 156f0b0d629c..9a0ebcafcc1e 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3602,7 +3602,7 @@ uno::Reference 
SwXTextDocument::getSelection()
 uno::Reference xTransferable;
 
 SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
-if (SdrView* pSdrView = pWrtShell->GetDrawView())
+if (SdrView* pSdrView = pWrtShell ? pWrtShell->GetDrawView() : nullptr)
 {
 if (pSdrView->GetTextEditObject())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-24 Thread Jan Holesovsky (via logerrit)
 sw/source/core/doc/docredln.cxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 8f44a939ad09d0365607ae8960e2abfe77e3fe72
Author: Jan Holesovsky 
AuthorDate: Tue Nov 24 15:34:55 2020 +0100
Commit: Miklos Vajna 
CommitDate: Tue Nov 24 16:40:01 2020 +0100

lok: Don't even iterate through the redlines when they are disabled.

It is not necessary, when we are not issuing any output anyway.

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

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index b3a1e6d6337b..3987957d920a 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -339,14 +339,22 @@ void lcl_LOKInvalidateStartEndFrames(SwShellCursor& 
rCursor)
 FRM_CNTNT, ());
 }
 
+bool lcl_LOKRedlineNotificationEnabled()
+{
+static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
+if (comphelper::LibreOfficeKit::isActive() && !bDisableRedlineComments)
+return true;
+
+return false;
+}
+
 } // anonymous namespace
 
 /// Emits LOK notification about one addition / removal of a redline item.
 void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, 
SwRangeRedline* pRedline)
 {
 // Disable since usability is very low beyond some small number of changes.
-static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
-if (!comphelper::LibreOfficeKit::isActive() || bDisableRedlineComments)
+if (!lcl_LOKRedlineNotificationEnabled())
 return;
 
 boost::property_tree::ptree aRedline;
@@ -1031,7 +1039,7 @@ SwRangeRedline::~SwRangeRedline()
 
 void MaybeNotifyRedlineModification(SwRangeRedline* pRedline, SwDoc* pDoc)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+if (!lcl_LOKRedlineNotificationEnabled())
 return;
 
 const SwRedlineTable& rRedTable = 
pDoc->getIDocumentRedlineAccess().GetRedlineTable();
@@ -1047,7 +1055,7 @@ void MaybeNotifyRedlineModification(SwRangeRedline* 
pRedline, SwDoc* pDoc)
 
 void SwRangeRedline::MaybeNotifyRedlinePositionModification(long nTop)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+if (!lcl_LOKRedlineNotificationEnabled())
 return;
 
 if(!m_oLOKLastNodeTop || *m_oLOKLastNodeTop != nTop)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-11 Thread László Németh (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 024a39100f7d19505886c4dafd9fba4948b86b52
Author: László Németh 
AuthorDate: Tue Nov 10 17:16:59 2020 +0100
Commit: Miklos Vajna 
CommitDate: Wed Nov 11 14:28:37 2020 +0100

DOCX: fix memory leak of cell formula export

clean-up of commit cf596c43315bb96b5e7256a82256f1ccb8c9c4d0
(tdf#133163 DOCX: export formula cell).

The problem was reported by Miklós Vajna.

(cherry picked from commit b0b5812bc6b74369c7909313fcb7fd86c535aea3)

Conflicts:
sw/source/filter/ww8/wrtw8nds.cxx

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

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 2f6ff3c14cef..2d31a2f52aed 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2255,7 +2255,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 if ( pBox->IsFormulaOrValueBox() == RES_BOXATR_FORMULA &&
  GetExportFormat() == MSWordExportBase::ExportFormat::DOCX )
 {
-auto pFormula = 
static_cast(pBox->GetFrameFormat()->GetTableBoxFormula().Clone());
+std::unique_ptr 
pFormula(static_cast(pBox->GetFrameFormat()->GetTableBoxFormula().Clone()));
 pFormula->PtrToBoxNm( >GetTable() );
 OutputField( nullptr, ww::eEquals, " = " + 
pFormula->GetFormula(),
 FieldFlags::Start | FieldFlags::CmdStart | 
FieldFlags::CmdEnd | FieldFlags::Close );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-31 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/fly.cxx |   49 --
 1 file changed, 47 insertions(+), 2 deletions(-)

New commits:
commit f7f1dee0a5e016a61bf6d36a6a6b758d81ec6fa6
Author: Michael Stahl 
AuthorDate: Thu Oct 22 19:17:24 2020 +0200
Commit: Andras Timar 
CommitDate: Sat Oct 31 22:54:57 2020 +0100

tdf#131679 sw: fix crash when copying fly via context menu

sw::DocumentContentOperationsManager::CopyImplImpl() is called with a
rPam that's on an SwOLENode.

The problem (which i can't reproduce in --enable-dbgutil build,
presumably for timing reasons) is that after the context menu pops up,
some idle layout runs and reformats the document and deletes a
SwFlyFrame and that calls SdrMarkView::UnmarkAllObj().

Then when SwFEShell::Copy() is called, it finds IsFrameSelected()
returns false, and it tries to copy normal text when the cursor is on
an SwOLENode.

Fix this in SwFlyFrame::FinitDrawObj() by first moving the cursor out
of any selected flys.

(regression from 81ec0039b2085faab49380c7a56af0c562d4c9e4
 - previously CopyImplImpl() would return early)

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

tdf#131679 sw: follow-up: Unmark before SetSelection()

Backporting this to 6.4, it crashes in CppunitTest_desktop_lib because
some sidebar is loaded from SwView::AttrChangedNotify()/SelectShell()
and that ends up calling SwView::StateTabWin() about 40 stack frames
later and this calls SwFEShell::GetAnyCurRect() which gets the still
selected fly but its page frame is null.

So make sure shells don't see the deleted fly.

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

Change-Id: Id135fcc002c03c07c34fbdc0355f2895d8b6565b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104682
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105095
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index b5f364511f6e..190e799dbc56 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -377,6 +377,32 @@ void SwFlyFrame::InitDrawObj()
 : nHellId );
 }
 
+static SwPosition ResolveFlyAnchor(SwFrameFormat const& rFlyFrame)
+{
+SwFormatAnchor const& rAnch(rFlyFrame.GetAnchor());
+if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE)
+{   // arbitrarily pick last node
+return 
SwPosition(SwNodeIndex(rFlyFrame.GetDoc()->GetNodes().GetEndOfContent(), -1));
+}
+else
+{
+SwPosition const*const pPos(rAnch.GetContentAnchor());
+assert(pPos);
+if (SwFrameFormat const*const pParent = 
pPos->nNode.GetNode().GetFlyFormat())
+{
+return ResolveFlyAnchor(*pParent);
+}
+else if (pPos->nContent.GetIdxReg())
+{
+return *pPos;
+}
+else
+{
+return SwPosition(*pPos->nNode.GetNode().GetContentNode(), 0);
+}
+}
+}
+
 void SwFlyFrame::FinitDrawObj()
 {
 if(!GetVirtDrawObj() )
@@ -391,8 +417,27 @@ void SwFlyFrame::FinitDrawObj()
 for(SwViewShell& rCurrentShell : p1St->GetRingContainer())
 {   // At the moment the Drawing can do just do an Unmark on 
everything,
 // as the Object was already removed
-if(rCurrentShell.HasDrawView() )
-rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
+if (rCurrentShell.HasDrawView() &&
+
rCurrentShell.Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount())
+{
+if (SwFEShell *const pFEShell = 
dynamic_cast())
+{   // tdf#131679 move any cursor out of fly
+SwFlyFrame const*const pOldSelFly = 
::GetFlyFromMarked(nullptr,  pFEShell);
+rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
+if (pOldSelFly)
+{
+SwPosition const 
pos(ResolveFlyAnchor(*pOldSelFly->GetFormat()));
+SwPaM const temp(pos);
+pFEShell->SetSelection(temp);
+// could also call SetCursor() like 
SwFEShell::SelectObj()
+// does, but that would access layout a bit much...
+}
+}
+else
+{
+rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
+  

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

2020-10-31 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   10 --
 sw/source/uibase/wrtsh/wrtsh1.cxx   |4 
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 0338a2a18d3252251439210ff737e9fa7f07c10a
Author: Michael Stahl 
AuthorDate: Wed Oct 14 12:42:54 2020 +0200
Commit: Andras Timar 
CommitDate: Sat Oct 31 22:53:39 2020 +0100

tdf#135260 sw_redlinehide: fix insert-with-delete differently

The problem with the fix for tdf#127635 is that now the cursor doesn't
move left on backspace if change tracking is on.

(regression from 398ba26077f9029bdf6f7378bfc9ce8376b6f02d)

Revert that and fix the autocorrect position in SwWrtShell::Insert()
instead.

Change-Id: I5989a589b654fc6e5ba3dd66922af15eff758ecc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104280
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit be4616d6b49b8c9cf1a90b212b24ead3dabcab6c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104299
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105093
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index ecebb3d000b6..909c88632f5e 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2007,11 +2007,6 @@ void DocumentContentOperationsManager::DeleteRange( 
SwPaM & rPam )
 {
 lcl_DoWithBreaks( *this, rPam, 
::DeleteRangeImpl );
 
-if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
-{
-rPam.Normalize(false); // tdf#127635 put point at the end of deletion
-}
-
 if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline()
 && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty())
 {
@@ -2188,11 +2183,6 @@ bool DocumentContentOperationsManager::DeleteAndJoin( 
SwPaM & rPam,
 : ::DeleteAndJoinImpl,
 bForceJoinNext );
 
-if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
-{
-rPam.Normalize(false); // tdf#127635 put point at the end of deletion
-}
-
 return ret;
 }
 
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 045ea5ceed7b..077a1b5f2968 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -243,7 +243,11 @@ void SwWrtShell::Insert( const OUString  )
 
 StartUndo(SwUndoId::REPLACE, );
 bStarted = true;
+Push();
 bDeleted = DelRight();
+Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore selection (if 
tracking changes)
+NormalizePam(false); // tdf#127635 put point at the end of deletion
+ClearMark();
 }
 
 bCallIns ?
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-26 Thread Tamás Zolnai (via logerrit)
 sw/source/core/crsr/bookmrk.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5117dc8d657729e36e363c7adc9b60a895509437
Author: Tamás Zolnai 
AuthorDate: Mon Oct 26 14:36:44 2020 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Oct 26 16:54:14 2020 +0100

lok: Send form field events to the correct view.

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

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index e12cd66dadc1..097e2dea6bd2 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -671,7 +671,7 @@ namespace sw { namespace mark
 void DropDownFieldmark::SendLOKMessage(const OString& sAction)
 {
 const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (pViewShell && pViewShell->isLOKMobilePhone())
+if (!pViewShell || pViewShell->isLOKMobilePhone())
 {
   return;
 }
@@ -729,7 +729,7 @@ namespace sw { namespace mark
 }
 if (sPayload.toString() != m_sLastSentLOKMsg) {
 m_sLastSentLOKMsg = sPayload.toString();
-
pEditWin->GetView().GetWrtShell().GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON,
 m_sLastSentLOKMsg.getStr());
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, 
m_sLastSentLOKMsg.getStr());
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-25 Thread Tomaž Vajngerl (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   46 +++
 sw/source/filter/ww8/docxattributeoutput.hxx |8 +++-
 2 files changed, 40 insertions(+), 14 deletions(-)

New commits:
commit 0120fecc22b36a55a2a25573a7a9632319b2b0ff
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 22 07:29:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Fri Sep 25 18:57:25 2020 +0200

docx export: Use checksum as key to cache graphic, not Graphic*

The problem is when we have multiple identical images in the
document and try to export. Without this change, the images will
be duplicated because the cache is using Graphic*, for which the
instance changes all the time (is not unique). Using the checksum
will make sure that all the images with the same content will be
saved as one image into the document.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103132
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 8679bf3ec608aec277fd677082aa5c38e63a65ce)

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 90a427ce30ed..eefa7b25fd51 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4819,8 +4819,8 @@ void DocxAttributeOutput::PopRelIdCache()
 
 void DocxAttributeOutput::PushRelIdCache()
 {
-m_aRelIdCache.push(std::map());
-m_aSdrRelIdCache.push(std::map());
+m_aRelIdCache.emplace();
+m_aSdrRelIdCache.emplace();
 }
 
 OUString DocxAttributeOutput::FindRelId(BitmapChecksum nChecksum)
@@ -4839,6 +4839,29 @@ void DocxAttributeOutput::CacheRelId(BitmapChecksum 
nChecksum, const OUString& r
 m_aSdrRelIdCache.top()[nChecksum] = rRelId;
 }
 
+OString DocxAttributeOutput::getExistingGraphicRelId(BitmapChecksum nChecksum)
+{
+OString aResult;
+
+if (m_aRelIdCache.empty())
+return aResult;
+
+auto pIterator = m_aRelIdCache.top().find(nChecksum);
+
+if (pIterator != m_aRelIdCache.top().end())
+{
+aResult = pIterator->second;
+}
+
+return aResult;
+}
+
+void DocxAttributeOutput::cacheGraphicRelId(BitmapChecksum nChecksum, OString 
const & rRelId)
+{
+if (!m_aRelIdCache.empty())
+m_aRelIdCache.top().emplace(nChecksum, rRelId);
+}
+
 void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const 
Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat, SwOLENode* pOLENode, 
const SdrObject* pSdrObj )
 {
 SAL_INFO("sw.ww8", "TODO DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* 
pOLEFrameFormat, SwOLENode* pOLENode, const SdrObject* pSdrObj  ) - some stuff 
still missing" );
@@ -4878,25 +4901,24 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 else
 {
 // inline, we also have to write the image itself
-const Graphic* pGraphic = nullptr;
+Graphic aGraphic;
 if (pGrfNode)
-pGraphic = >GetGrf();
+aGraphic = pGrfNode->GetGrf();
 else
-pGraphic = pOLENode->GetGraphic();
+aGraphic = *pOLENode->GetGraphic();
 
-if (!m_aRelIdCache.empty() && m_aRelIdCache.top().find(pGraphic) != 
m_aRelIdCache.top().end())
-// We already have a RelId for this Graphic.
-aRelId = m_aRelIdCache.top()[pGraphic];
-else
+BitmapChecksum aChecksum = aGraphic.GetChecksum();
+aRelId = getExistingGraphicRelId(aChecksum);
+
+if (aRelId.isEmpty())
 {
 // Not in cache, then need to write it.
 m_rDrawingML.SetFS( m_pSerializer ); // to be sure that we write 
to the right stream
 
-OUString aImageId = m_rDrawingML.WriteImage( *pGraphic );
+OUString aImageId = m_rDrawingML.WriteImage(aGraphic);
 
 aRelId = OUStringToOString( aImageId, RTL_TEXTENCODING_UTF8 );
-if (!m_aRelIdCache.empty())
-m_aRelIdCache.top()[pGraphic] = aRelId;
+cacheGraphicRelId(aChecksum, aRelId);
 }
 
 nImageType = XML_embed;
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index b87d5e4efd9e..a6d5d1e88d62 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -950,8 +950,12 @@ private:
 
 bool m_setFootnote;
 
-/// RelId <-> Graphic* cache, so that in case of alternate content, the 
same graphic only gets written once.
-std::stack< std::map > m_aRelIdCache;
+OString getExistingGraphicRelId(BitmapChecksum aChecksum);
+void cacheGraphicRelId(BitmapChecksum nChecksum, OString const & rRelId);
+
+

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

2020-09-22 Thread Pranam Lashkari (via logerrit)
 sw/source/uibase/docvw/AnnotationWin.cxx  |   19 +--
 sw/source/uibase/docvw/AnnotationWin2.cxx |   13 ++---
 sw/source/uibase/docvw/PostItMgr.cxx  |   27 ++-
 sw/source/uibase/shells/textfld.cxx   |4 ++--
 4 files changed, 51 insertions(+), 12 deletions(-)

New commits:
commit fc0493e59be95f101d26144e622998c38ac3fd45
Author: Pranam Lashkari 
AuthorDate: Sun Sep 13 17:30:21 2020 +0530
Commit: Andras Timar 
CommitDate: Tue Sep 22 09:36:57 2020 +0200

changed FN_RESOLVE_NOTE behaviour to resolve single note

Earlier it used to resolve the entire thread
and there was no way to resolve a single comment in thread

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

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 7bd3ae6f4e3b..2c9ee46f7127 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -262,8 +262,23 @@ bool SwAnnotationWin::IsResolved() const
 
 bool SwAnnotationWin::IsThreadResolved()
 {
-// Not const because GetTopReplyNote isn't.
-return GetTopReplyNote()->IsResolved();
+// First Get the top note
+// then itereate downwards checking resolved status
+SwAnnotationWin *pTopNote, *TopNote;
+pTopNote = TopNote = GetTopReplyNote();
+if (!pTopNote->IsResolved())
+return false;
+
+SwAnnotationWin* pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pTopNote);
+
+while (pSidebarWin && pSidebarWin->GetTopReplyNote() == TopNote)
+{
+pTopNote = pSidebarWin;
+if (!pTopNote->IsResolved())
+return false;
+pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pSidebarWin);
+}
+return true;
 }
 
 void SwAnnotationWin::UpdateData()
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index f723b7e7ac49..5ac9317ecd39 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -179,7 +179,7 @@ void SwAnnotationWin::Paint(vcl::RenderContext& 
rRenderContext, const tools::Rec
 }
 
 sal_uInt32 boxHeight = mpMetadataAuthor->GetSizePixel().Height() + 
mpMetadataDate->GetSizePixel().Height();
-boxHeight += IsThreadResolved() ? 
mpMetadataResolved->GetSizePixel().Height() : 0;
+boxHeight += IsResolved() ? 
mpMetadataResolved->GetSizePixel().Height() : 0;
 
 rRenderContext.SetLineColor();
 tools::Rectangle aRectangle(Point(mpMetadataAuthor->GetPosPixel().X() 
+ mpMetadataAuthor->GetSizePixel().Width(),
@@ -583,7 +583,7 @@ void SwAnnotationWin::InitControls()
 mpSidebarTextControl->Show();
 mpMetadataAuthor->Show();
 mpMetadataDate->Show();
-if(IsThreadResolved()) { mpMetadataResolved->Show(); }
+if(IsResolved()) { mpMetadataResolved->Show(); }
 mpVScrollbar->Show();
 }
 
@@ -905,7 +905,7 @@ void SwAnnotationWin::DoResize()
 
 aHeight -= GetMetaHeight();
 mpMetadataAuthor->Show();
-if(IsThreadResolved()) { mpMetadataResolved->Show(); }
+if(IsResolved()) { mpMetadataResolved->Show(); }
 mpMetadataDate->Show();
 mpSidebarTextControl->SetQuickHelpText(OUString());
 unsigned int numFields = GetNumFields();
@@ -930,7 +930,7 @@ void SwAnnotationWin::DoResize()
  aHeight + 
aSizeOfMetadataControls.Height(),
  aSizeOfMetadataControls.Width(),
  aSizeOfMetadataControls.Height() );
-if(IsThreadResolved()) {
+if(IsResolved()) {
 mpMetadataResolved->setPosSizePixel( 0,
  aHeight + 
aSizeOfMetadataControls.Height()*2,
  
aSizeOfMetadataControls.Width(),
@@ -1267,8 +1267,7 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
 mnEventId = Application::PostUserEvent( LINK( this, 
SwAnnotationWin, DeleteHdl), nullptr, true );
 break;
 case FN_RESOLVE_NOTE:
-GetTopReplyNote()->ToggleResolved();
-mrMgr.UpdateResolvedStatus(GetTopReplyNote());
+ToggleResolved();
 DoResize();
 Invalidate();
 mrMgr.LayoutPostIts();
@@ -1392,7 +1391,7 @@ sal_Int32 SwAnnotationWin::GetMetaHeight()
 
 sal_Int32 SwAnnotationWin::GetNumFields()
 {
-return IsThreadResolved() ? 3 : 2;
+return IsResolved() ? 3 : 2;
 }
 
 sal_Int32 SwAnnotationWin::GetMinimumSizeWithMeta() const
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 88f917a923ea..3f0e6f530469 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1570,6 +1570,31 @@ void 

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

2020-09-08 Thread Szymon Kłos (via logerrit)
 sw/source/core/doc/DocumentStylePoolManager.cxx |   11 +++
 sw/source/core/edit/edfcol.cxx  |   13 +
 2 files changed, 24 insertions(+)

New commits:
commit ca435be45f316120b9df6c9d547b781ed975817d
Author: Szymon Kłos 
AuthorDate: Mon Aug 31 12:49:46 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Sep 8 11:21:36 2020 +0200

writer: handle styles in multiple languages for online

Use translated name when style is applied and broadcasted.
Avoid using style names created by the first view.

Change-Id: I18abf3388e69f76ec99eda94e0b67782a52ab23f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101831
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 23529c16ff9e..f13c55f72dc2 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -69,6 +69,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::editeng;
 using namespace ::com::sun::star;
@@ -583,10 +584,20 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
 SwTextFormatColl* pNewColl;
 sal_uInt16 nOutLvlBits = 0;
+
 for (size_t n = 0, nSize = m_rDoc.GetTextFormatColls()->size(); n < nSize; 
++n)
 {
 if( nId == ( pNewColl = (*m_rDoc.GetTextFormatColls())[ n ] 
)->GetPoolFormatId() )
 {
+// in online we can have multiple languages, use translated name
+if (comphelper::LibreOfficeKit::isActive())
+{
+OUString aName;
+SwStyleNameMapper::GetUIName(nId, aName);
+if (!aName.isEmpty())
+pNewColl->SetName(aName);
+}
+
 return pNewColl;
 }
 
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 2b49ee16ecc8..830402d2d60c 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -100,6 +100,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #define WATERMARK_NAME "PowerPlusWaterMarkObject"
 #define WATERMARK_AUTO_SIZE sal_uInt32(1)
@@ -2196,6 +2198,17 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl 
*pFormat,
 RedlineFlags eRedlMode = 
GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode;
 
 SwRewriter aRewriter;
+
+// in online we can have multiple languages, use universal name then
+if (comphelper::LibreOfficeKit::isActive())
+{
+OUString aName;
+sal_uInt16 nId = 
SwStyleNameMapper::GetPoolIdFromUIName(pLocal->GetName(), 
SwGetPoolIdFromName::TxtColl);
+SwStyleNameMapper::FillProgName(nId, aName);
+if (!aName.isEmpty())
+pLocal->SetName(aName);
+}
+
 aRewriter.AddRule(UndoArg1, pLocal->GetName());
 
 GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::SETFMTCOLL, 
);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-08 Thread Szymon Kłos (via logerrit)
 sw/source/core/doc/DocumentStylePoolManager.cxx |  161 ++--
 sw/source/core/doc/SwStyleNameMapper.cxx|   14 +-
 2 files changed, 135 insertions(+), 40 deletions(-)

New commits:
commit 8ddd66a36e5e54291e56c1a5804d5db3b1ba16bb
Author: Szymon Kłos 
AuthorDate: Fri Aug 28 13:43:13 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Sep 8 11:21:13 2020 +0200

writer: translate standard styles for online

in online we can have multiple users with different UI language

Change-Id: I8fac53391832acace29388cdbca2c18853ef1690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101830
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 767af3a22010..23529c16ff9e 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -67,6 +67,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::editeng;
 using namespace ::com::sun::star;
@@ -2544,88 +2546,171 @@ lcl_NewUINameArray(const char** pIds, const size_t 
nLen, const size_t nSvxIds =
 
 const std::vector& SwStyleNameMapper::GetTextUINameArray()
 {
-static const std::vector s_aTextUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_TEXT_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY)));
-return s_aTextUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aTextUINameArray;
+
+auto aFound = s_aTextUINameArray.find(aCurrentLanguage);
+if (aFound == s_aTextUINameArray.end()) {
+s_aTextUINameArray[aCurrentLanguage] =
+lcl_NewUINameArray(STR_POOLCOLL_TEXT_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY));
+}
+
+return s_aTextUINameArray[aCurrentLanguage];
 }
 
 const std::vector& SwStyleNameMapper::GetListsUINameArray()
 {
-static const std::vector s_aListsUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_LISTS_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY)));
-return s_aListsUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aListsUINameArray;
+
+auto aFound = s_aListsUINameArray.find(aCurrentLanguage);
+if (aFound == s_aListsUINameArray.end()) {
+s_aListsUINameArray[aCurrentLanguage] =
+lcl_NewUINameArray(STR_POOLCOLL_LISTS_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY));
+}
+
+return s_aListsUINameArray[aCurrentLanguage];
 }
 
 const std::vector& SwStyleNameMapper::GetExtraUINameArray()
 {
-static const std::vector s_aExtraUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_EXTRA_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_EXTRA_ARY)));
-return s_aExtraUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aExtraUINameArray;
+
+auto aFound = s_aExtraUINameArray.find(aCurrentLanguage);
+if (aFound == s_aExtraUINameArray.end()) {
+s_aExtraUINameArray[aCurrentLanguage] =
+lcl_NewUINameArray(STR_POOLCOLL_EXTRA_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_EXTRA_ARY));
+}
+
+return s_aExtraUINameArray[aCurrentLanguage];
 }
 
 const std::vector& SwStyleNameMapper::GetRegisterUINameArray()
 {
-static const std::vector s_aRegisterUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_REGISTER_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY)));
-return s_aRegisterUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aRegisterUINameArray;
+
+auto aFound = s_aRegisterUINameArray.find(aCurrentLanguage);
+if (aFound == s_aRegisterUINameArray.end()) {
+s_aRegisterUINameArray[aCurrentLanguage] =
+lcl_NewUINameArray(STR_POOLCOLL_REGISTER_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY));
+}
+
+return s_aRegisterUINameArray[aCurrentLanguage];
 }
 
 const std::vector& SwStyleNameMapper::GetDocUINameArray()
 {
-static const std::vector s_aDocUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_DOC_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY)));
-return s_aDocUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aDocUINameArray;
+
+auto aFound = s_aDocUINameArray.find(aCurrentLanguage);
+if (aFound == s_aDocUINameArray.end())
+s_aDocUINameArray[aCurrentLanguage] =
+lcl_NewUINameArray(STR_POOLCOLL_DOC_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY));
+
+return s_aDocUINameArray[aCurrentLanguage];
 }
 
 const std::vector& SwStyleNameMapper::GetHTMLUINameArray()
 {
-static const std::vector s_aHTMLUINameArray(
-lcl_NewUINameArray(STR_POOLCOLL_HTML_ARY, 
SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY)));
-return s_aHTMLUINameArray;
+LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
+static std::map> s_aHTMLUINameArray;
+
+auto aFound = 

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

2020-09-07 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/sidebar/TableEditPanel.cxx |6 ++
 sw/source/uibase/sidebar/TableEditPanel.hxx |2 ++
 2 files changed, 8 insertions(+)

New commits:
commit 17d06055d213e907b966081690d5977a91ae69f7
Author: Szymon Kłos 
AuthorDate: Mon Sep 7 09:40:29 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon Sep 7 10:33:09 2020 +0200

Hide InsertFormula in Writer online

Change-Id: I5875559b46d242434b8e47f214e7f7f7a4a3db6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102146
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx 
b/sw/source/uibase/sidebar/TableEditPanel.cxx
index a657feb8718c..a57311c5cf40 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -116,6 +117,10 @@ TableEditPanel::TableEditPanel(vcl::Window* pParent,
 {
 get(m_pRowHeightEdit, "rowheight");
 get(m_pColumnWidthEdit, "columnwidth");
+get(m_pMiscToolbar, "misc");
+
+if (comphelper::LibreOfficeKit::isActive())
+
m_pMiscToolbar->HideItem(m_pMiscToolbar->GetItemId(".uno:InsertFormula"));
 
 InitRowHeightToolitem();
 InitColumnWidthToolitem();
@@ -151,6 +156,7 @@ void TableEditPanel::dispose()
 {
 m_pRowHeightEdit.clear();
 m_pColumnWidthEdit.clear();
+m_pMiscToolbar.clear();
 m_aRowHeightController.dispose();
 m_aColumnWidthController.dispose();
 m_aInsertRowsBeforeController.dispose();
diff --git a/sw/source/uibase/sidebar/TableEditPanel.hxx 
b/sw/source/uibase/sidebar/TableEditPanel.hxx
index 13ae11b5dd99..4088d0a7a433 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.hxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.hxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace sw
 {
@@ -49,6 +50,7 @@ private:
 
 VclPtr m_pRowHeightEdit;
 VclPtr m_pColumnWidthEdit;
+VclPtr<::sfx2::sidebar::SidebarToolBox> m_pMiscToolbar;
 ::sfx2::sidebar::ControllerItem m_aRowHeightController;
 ::sfx2::sidebar::ControllerItem m_aColumnWidthController;
 ::sfx2::sidebar::ControllerItem m_aInsertRowsBeforeController;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-24 Thread Caolán McNamara (via logerrit)
 sw/source/filter/ww8/ww8par.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a904e4035daa5c58201e9f6e06b0282a9a11d252
Author: Caolán McNamara 
AuthorDate: Sun Aug 23 20:47:00 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Aug 25 07:38:55 2020 +0200

ofz#25169 insertion into set might find a duplicate

in which case pImpRec is deleted and pImpRecTmp is invalid

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 89b45849fe69..f29833775b4b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1076,7 +1076,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
 
 if( pImpRec->nShapeId )
 {
-auto pImpRecTmp = pImpRec.get();
+auto nShapeId = pImpRec->nShapeId;
+auto nShapeOrder = 
(static_cast(pImpRec->aTextId.nTxBxS) << 16)
++ pImpRec->aTextId.nSequence;
 // Complement Import Record List
 pImpRec->pObj = pObj;
 rImportData.insert(std::move(pImpRec));
@@ -1088,9 +1090,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
 ( (rObjData.nSpFlags & ShapeFlag::Group)
  && (rObjData.nCalledByGroup < 2) )
   )
-StoreShapeOrder( pImpRecTmp->nShapeId,
-( 
static_cast(pImpRecTmp->aTextId.nTxBxS) << 16 )
-+ pImpRecTmp->aTextId.nSequence, pObj );
+{
+StoreShapeOrder(nShapeId, nShapeOrder, pObj);
+}
 }
 else
 pImpRec.reset();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Michael Stahl (via logerrit)
 sw/source/core/txtnode/atrfld.cxx |2 +-
 sw/source/core/undo/undobj.cxx|4 
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5563f6ba24a7d96062ab8f1a6f3234a39e999bc2
Author: Michael Stahl 
AuthorDate: Fri Aug 14 16:35:32 2020 +0200
Commit: Andras Timar 
CommitDate: Sun Aug 23 19:15:59 2020 +0200

tdf#135457 sw: fix invalidation of SwXTextField

This was supposed to happen from SwNodes::ChgNode() when moving to the
undo nodes array.

There are fields with a range that contains other fields, when the outer
field's range is deleted, the contained field moves to the undo array
and its position is no longer valid to be given out by
SwXTextField::getAnchor().

(regression from c73b5e969b2f9abdb2b9191938ca30bec5af725d
 ERR no, actually more likely from e18359445fabad9ba1a704600e9ee327112cc6ae)

Change-Id: I38c8b3393a777ca8dc8739b5ca4233a7f124961e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100749
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 14fd4b54113f884cfd6871aeff693734fc06224b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100705
Reviewed-by: Caolán McNamara 
(cherry picked from commit 27e9ead64d4e3a3f3b3d1203f7b9fee50eb0d04d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100987
Tested-by: Michael Stahl 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101233
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index fba15a6107f9..ebcdced03c52 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -217,7 +217,7 @@ void SwFormatField::InvalidateField()
 {
 SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT,
 _cast(*this)); // cast to base class (void*)
-NotifyClients(, );
+CallSwClientNotify(sw::LegacyModifyHint{ ,  });
 }
 
 void SwFormatField::SwClientNotify( const SwModify& rModify, const SfxHint& 
rHint )
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index bfea81a886b6..fa86072a3008 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -849,6 +849,10 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& 
rMark,
 
 SwDoc* pDoc = rMark.nNode.GetNode().GetDoc();
 
+// if it's not in the doc array, probably missing some invalidation 
somewhere
+assert(() == >GetNodes());
+assert(() == >GetNodes());
+
 ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
 
 // 1. Footnotes
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Michael Stahl (via logerrit)
 sw/source/uibase/lingu/olmenu.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 05d086e432644d80160723009a2b3eebf50417d2
Author: Michael Stahl 
AuthorDate: Wed Aug 19 18:55:27 2020 +0200
Commit: Andras Timar 
CommitDate: Sun Aug 23 19:15:15 2020 +0200

tdf#135721 sw: fix spell check context menu deleting flys

Kind of similar to e1629c210ad78310e3d48c0756723134a27b89df
but the problem is at a higher level: SwTextShell::Execute() with
SID_SPELLCHECK_APPLY_SUGGESTION should not DelLeft() + Insert() but
just Replace().

(regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5)

Change-Id: I78487c7841ba22ccc6751240a8e55e08a86fba32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101014
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit ec579354af954867b829e7d08e4d752518c83728)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101072
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101231
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/lingu/olmenu.cxx 
b/sw/source/uibase/lingu/olmenu.cxx
index cb14cd26aca7..2ee4737abfb6 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -746,9 +746,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
 
 m_pSh->StartUndo(SwUndoId::UI_REPLACE, );
 m_pSh->StartAction();
-m_pSh->DelLeft();
 
-m_pSh->Insert( aTmp );
+m_pSh->Replace(aTmp, false);
 
 /* #102505# EndAction/EndUndo moved down since insertion
of temporary auto correction is now undoable two and
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Vasily Melenchuk (via logerrit)
 sw/source/core/doc/docfmt.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9253d60c6fa4c8f37eba8e445cb5432e80a61696
Author: Vasily Melenchuk 
AuthorDate: Mon Jul 20 09:55:19 2020 +0300
Commit: Andras Timar 
CommitDate: Sun Aug 23 19:13:17 2020 +0200

sw: generate unique style name for table box and line frames

Since SwTableBoxFormat and SwTableLineFormat are derived from
SwFrameFormat they can behave incorrectly during undo/redo.
Undo/redo code is trying to rely style names instead of pointers
to format: this is dangerous.

Any problems with SwTableBoxFormat and SwTableLineFormat, I was
not able to reproduce with GUI. But external access to document
via UNO can bring surprises.

For example: NumberFormat for table cells in GUI is modified, but
can be changed to another by UNO call (see example/usecase in
/sw/qa/python/check_table.py: test_tdf32082. And such replacement
looks from core as a new style, not a modification of attributes
in existing one.

Change-Id: I6afc992f6cdb9ce692167204b3c98e8234cd87d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99023
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 083fe09958658de8c3da87a28e0f8ff7b3b8a5e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101225
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6b92ee74e9ac..a738ea1596a0 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1696,6 +1696,7 @@ bool SwDoc::DontExpandFormat( const SwPosition& rPos, 
bool bFlag )
 SwTableBoxFormat* SwDoc::MakeTableBoxFormat()
 {
 SwTableBoxFormat* pFormat = new SwTableBoxFormat( GetAttrPool(), 
mpDfltFrameFormat.get() );
+pFormat->SetName("TableBox" + 
OUString::number(reinterpret_cast(pFormat)));
 getIDocumentState().SetModified();
 return pFormat;
 }
@@ -1703,6 +1704,7 @@ SwTableBoxFormat* SwDoc::MakeTableBoxFormat()
 SwTableLineFormat* SwDoc::MakeTableLineFormat()
 {
 SwTableLineFormat* pFormat = new SwTableLineFormat( GetAttrPool(), 
mpDfltFrameFormat.get() );
+pFormat->SetName("TableLine" + 
OUString::number(reinterpret_cast(pFormat)));
 getIDocumentState().SetModified();
 return pFormat;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Vasily Melenchuk (via logerrit)
 sw/source/core/edit/edfcol.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e4c4caea265b874f5f6b96b2aab108785e9ebc3a
Author: Vasily Melenchuk 
AuthorDate: Thu Apr 30 16:27:37 2020 +0300
Commit: Andras Timar 
CommitDate: Sun Aug 23 19:13:32 2020 +0200

sw: moved setting shape name to earlier stage

During setting of some shape properties undo/redo code is called.
Undo/redo code should know about shape and style name.

Change-Id: I5240c450d0c739a245e32e9ca6f34518f35ddda5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93214
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit db3d90abd3bb830b079169397f656c56bdcc3af8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100939
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101226
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 7216ab102c87..2b49ee16ecc8 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1532,6 +1532,10 @@ static void lcl_placeWatermarkInHeader(const 
SfxWatermarkItem& rWatermark,
 
 // Create and insert the shape.
 uno::Reference 
xShape(xMultiServiceFactory->createInstance(aShapeServiceName), uno::UNO_QUERY);
+
+uno::Reference xNamed(xShape, uno::UNO_QUERY);
+xNamed->setName(sWatermark);
+
 basegfx::B2DHomMatrix aTransformation;
 aTransformation.identity();
 aTransformation.scale(nWidth, nHeight);
@@ -1600,8 +1604,6 @@ static void lcl_placeWatermarkInHeader(const 
SfxWatermarkItem& rWatermark,
 xPropertySet->setPropertyValue(UNO_NAME_HORI_ORIENT, 
uno::makeAny(static_cast(text::HoriOrientation::CENTER)));
 xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT, 
uno::makeAny(static_cast(text::VertOrientation::CENTER)));
 
-uno::Reference xNamed(xShape, uno::UNO_QUERY);
-xNamed->setName(sWatermark);
 xLockable->removeActionLock();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-02 Thread Gülşah Köse (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 9bdef35a045bbfc064c9dc2c1df7acd91daac9e3
Author: Gülşah Köse 
AuthorDate: Mon Jul 27 22:26:13 2020 +0300
Commit: Andras Timar 
CommitDate: Sun Aug 2 08:58:22 2020 +0200

Use enable/disable widgets instead of hide/show.

Change-Id: Ied3eb671155b88d47a5a91fcd81351492ccf9bb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99560
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit 08d16c76e48b43e4f74bb6f9e57605f43f27)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99534
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index bbc88ebb30bc..23b3a640f6bb 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -345,9 +345,9 @@ SwMMResultEmailDialog::SwMMResultEmailDialog(weld::Window* 
pParent)
 
 m_xOKButton->connect_clicked(LINK(this, SwMMResultEmailDialog, 
SendDocumentsHdl_Impl));
 
-m_xPasswordCB->hide();
-m_xPasswordFT->hide();
-m_xPasswordLB->hide();
+m_xPasswordCB->set_sensitive(false);
+m_xPasswordFT->set_sensitive(false);
+m_xPasswordLB->set_sensitive(false);
 
 FillInEmailSettings();
 }
@@ -854,17 +854,16 @@ IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, 
weld::ComboBox&, rBox, void)
 
 if(bIsPDF)
 {
-m_xPasswordCB->show();
-m_xPasswordFT->show();
-m_xPasswordLB->show();
+m_xPasswordCB->set_sensitive(true);
+m_xPasswordFT->set_sensitive(true);
+m_xPasswordLB->set_sensitive(true);
 CheckHdl(*m_xPasswordCB);
 }
 else
 {
-m_xPasswordCB->hide();
-m_xPasswordFT->hide();
-m_xPasswordLB->hide();
-
+m_xPasswordCB->set_sensitive(false);
+m_xPasswordFT->set_sensitive(false);
+m_xPasswordLB->set_sensitive(false);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-20 Thread Szymon Kłos (via logerrit)
 sw/source/ui/dialog/swdlgfact.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ffb5593e6ea7fcdf13208e24b2a3bc5f28e8834a
Author: Szymon Kłos 
AuthorDate: Mon Jul 20 13:21:41 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jul 20 13:39:14 2020 +0200

Fix warning while building on windows

cannot convert int to optional

Change-Id: Ibe4c4d440a835c3d85835bc7952340db5e26841f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99045
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index 63f262a28ac9..be05d3ba8f0f 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -383,7 +383,7 @@ sal_uInt16 AbstractSwBreakDlg_Impl:: GetKind()
 if (pDlg)
 return pDlg->GetPageNumber();
 
-return 0;
+return ::boost::optional(0);
 }
 
 void AbstractSwConvertTableDlg_Impl::GetValues( sal_Unicode& 
rDelim,SwInsertTableOptions& rInsTableFlags,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-20 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/uiview/view2.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f6c00b4ec0c3d111a616673cc33a4f5e9b9657a5
Author: Szymon Kłos 
AuthorDate: Mon Jul 20 12:42:36 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jul 20 13:06:05 2020 +0200

Make Line Numbering dialog async

Change-Id: I196008ec58feab9d9a2e41c8901ed5d5a2fc9b4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99037
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 2885fa0af8e2..2691214240e1 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -556,7 +556,9 @@ void SwView::Execute(SfxRequest )
 {
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 ScopedVclPtr 
pDlg(pFact->CreateVclSwViewDialog(*this));
-pDlg->Execute();
+VclAbstractDialog::AsyncContext aContext;
+aContext.maEndDialogFn = [](sal_Int32){};
+pDlg->StartExecuteAsync(aContext);
 break;
 }
 case FN_EDIT_LINK_DLG:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-05 Thread Samuel Mehrbrodt (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e2e731f32c8461853258116188125d885295a27c
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jun 29 14:58:57 2020 +0200
Commit: Andras Timar 
CommitDate: Sun Jul 5 13:19:09 2020 +0200

tdf#130151 Fix toc pointing to wrong page

Change-Id: I26c1027722613f751bd39fde97f1e14d3238eefa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97413
Reviewed-by: Ilmari Lauhakangas 
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Jenkins
(cherry picked from commit 63f3485b57904de4e77c04f5759e6563fcce6748)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97504
Reviewed-by: Xisco Fauli 
(cherry picked from commit 0e558c86a3d25764d44c14e28232ff4629af75ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97581
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index c7f66b67640e..be5c2ff289c3 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2601,8 +2601,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 // there is no time to sort this out.
 //TODO: check what exactly needs to be done and make just one 
function for that
 pViewShell->CalcLayout();
-pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
-
 
 // #122919# Force field update before PDF export, but after layout 
init (tdf#121962)
 bool bStateChanged = false;
@@ -2616,6 +2614,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 if( bStateChanged )
 pRenderDocShell->EnableSetModified();
 
+pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
+
 pViewShell->SetPDFExportOption( false );
 
 // enable view again
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-02 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/dialog/watermarkdialog.cxx |   12 
 vcl/source/window/builder.cxx   |3 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 2db1de7dd1b460ace3fe39bd8de8017bd48b00ff
Author: Szymon Kłos 
AuthorDate: Tue Mar 10 16:23:51 2020 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jul 2 08:23:30 2020 +0200

jsdialog: enable watermark dialog

Change-Id: I4badd0d2f6c9c0d2828152685aa14c2e1d358fea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97623
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx 
b/sw/source/uibase/dialog/watermarkdialog.cxx
index 09ac8ed94c70..19ee4ad78009 100644
--- a/sw/source/uibase/dialog/watermarkdialog.cxx
+++ b/sw/source/uibase/dialog/watermarkdialog.cxx
@@ -20,6 +20,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+
+#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
 
 SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& 
rBindings)
 : SfxDialogController(pParent, "modules/swriter/ui/watermarkdialog.ui", 
"WatermarkDialog")
@@ -32,6 +36,14 @@ SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, 
SfxBindings& rBindin
 , m_xColor(new ColorListBox(m_xBuilder->weld_menu_button("Color"), 
m_xDialog.get()))
 {
 InitFields();
+
+if (IS_MOBILE)
+{
+m_xBuilder->weld_label("ColorLabel")->hide();
+m_xColor->hide();
+m_xBuilder->weld_button("cancel")->hide();
+m_xBuilder->weld_button("help")->hide();
+}
 }
 
 SwWatermarkDialog::~SwWatermarkDialog()
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a840305bc4fe..6cc2c91d137c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -156,7 +156,8 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 if (bMobile)
 {
 if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui" ||
-rUIFile == "svx/ui/findreplacedialog-mobile.ui")
+rUIFile == "svx/ui/findreplacedialog-mobile.ui" ||
+rUIFile == "modules/swriter/ui/watermarkdialog.ui")
 bUseJSBuilder = true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-23 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/app/docstyle.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 7463f150bf8a31b5febe3f91dc082124d53df504
Author: Szymon Kłos 
AuthorDate: Tue Jun 16 11:42:13 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jun 23 10:11:58 2020 +0200

Getting styles info shouldnt set document modification state

Getter function modified document's 'is modified' state
and broadcasted it due to internal styles creation/delete

That caused spam of SwCursorShell::UpdateCursor calls
when styles preview widget was used in the notebookbar.

Change-Id: I22ee4e820adf79f6e816cb35161cb21f26abb2b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96921
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 4326445cd8ec..def145366ad8 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1290,7 +1290,14 @@ std::unique_ptr 
SwDocStyleSheet::GetItemSetForPreview()
 // time, return one "flattened" item set that contains all items from
 // all parents.
 std::unique_ptr pRet;
+
+bool bModifiedEnabled = rDoc.getIDocumentState().IsEnableSetModified();
+rDoc.getIDocumentState().SetEnableSetModified(false);
+
 FillStyleSheet(FillPreview, );
+
+rDoc.getIDocumentState().SetEnableSetModified(bModifiedEnabled);
+
 assert(pRet);
 return pRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-23 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit cec306c2e2bff6cd70fc698a5026425f41c98ab7
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Andras Timar 
CommitDate: Tue Jun 23 08:55:49 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 63d4e8aa10186b4ed0e3106c116ad25c5fb5ed6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96709
(cherry picked from commit 9733be8607fe36c7f69ff050a487ff0e6e88f79f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96790

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 0460cb343dd3..79963e311b29 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -695,6 +696,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-10 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/shells/basesh.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit b6e89538f1d289f521f29736f35c72a1c075e671
Author: Tor Lillqvist 
AuthorDate: Wed Jun 10 17:41:57 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Jun 10 21:10:49 2020 +0200

Fix crash for Table > Insert Table... in Writer and also fix related UITest

Make the code in SwBaseShell::InsertTable be like in master.
Presumably it works correctly?

This also fixes at least UITest_writer_tests.

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

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 44f5f0a53b38..d06c3db27483 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2776,7 +2776,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 SwInsertTableOptions aInsTableOptsIn( SwInsertTableFlags::All, 1 );
 OUString aTableNameIn;
 OUString aAutoNameIn;
-std::unique_ptr pTAFormatIn = nullptr;
+std::unique_ptr pTAFormatIn;
 
 if( pArgs && pArgs->Count() >= 2 )
 {
@@ -2826,7 +2826,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 std::shared_ptr 
pDialogController(pAbstractDialog->getDialogController());
 
 weld::DialogController::runAsync(pDialogController,
-[pAbstractDialog, , , aTableNameIn, nRowsIn, 
nColsIn, aInsTableOptsIn, aAutoNameIn, ] (sal_Int32 nResult) {
+[pAbstractDialog, , , aTableNameIn, nRowsIn, 
nColsIn, aInsTableOptsIn, aAutoNameIn] (sal_Int32 nResult) {
 if( RET_OK == nResult )
 {
 sal_uInt16 nCols = nColsIn;
@@ -2834,12 +2834,13 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 SwInsertTableOptions aInsTableOpts = 
aInsTableOptsIn;
 OUString aTableName = aTableNameIn;
 OUString aAutoName = aAutoNameIn;
+std::unique_ptr pTAFormat;
 
-pAbstractDialog->GetValues( aTableName, nRows, 
nCols, aInsTableOpts, aAutoName, pTAFormatIn );
+pAbstractDialog->GetValues( aTableName, nRows, 
nCols, aInsTableOpts, aAutoName, pTAFormat );
 
 if( nCols && nRows )
 {
-InsertTableImpl( rSh, rTempView, aTableName, 
nRows, nCols, aInsTableOpts, aAutoName, pTAFormatIn );
+InsertTableImpl( rSh, rTempView, aTableName, 
nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
 EndUndo(rSh);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-03 Thread Miklos Vajna (via logerrit)
 sw/source/core/doc/DocumentSettingManager.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0e69275695679e34300df2d16640cdec3dd1df2f
Author: Miklos Vajna 
AuthorDate: Wed Apr 22 21:06:58 2020 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jun 3 09:09:08 2020 +0200

tdf#124790: sw: handle SubtractFlys when replacing compat options

This was added in commit c5cf8824a619401627f18abc7b3049551c71ac2a
(tdf#86578: sw: fix rendering of legacy documents with fly achored at
fly), it's off by default and on for legacy ODT files.

Change-Id: I8a08106bed8b12c173d47ed66efe54fd71953c99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92731
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95298

diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index fe13a6b569f6..0d2a8fb99808 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -592,6 +592,7 @@ void 
sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSetti
 mbUnixForceZeroExtLeading = rSource.mbUnixForceZeroExtLeading;
 mbTabRelativeToIndent = rSource.mbTabRelativeToIndent;
 mbTabAtLeftIndentForParagraphsInList = 
rSource.mbTabAtLeftIndentForParagraphsInList;
+mbSubtractFlys = rSource.mbSubtractFlys;
 mbMsWordCompTrailingBlanks = rSource.mbMsWordCompTrailingBlanks;
 mbEmptyDbFieldHidesPara = rSource.mbEmptyDbFieldHidesPara;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-22 Thread Szymon Kłos (via logerrit)
 sw/source/ui/table/instable.cxx   |5 +
 sw/source/uibase/inc/instable.hxx |1 +
 sw/uiconfig/swriter/ui/inserttable.ui |2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0fe4f3590e641ebd3049bdfe72cc32fbc74603ee
Author: Szymon Kłos 
AuthorDate: Thu May 21 16:33:32 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 22 09:41:33 2020 +0200

Don't show styles frame in insert table in online

Change-Id: I2ee2daef028b49a409920c0fe83190575e7a82c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94639
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 4d1225af9a27..5401b92c0bda 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define ROW_COL_PROD 16384
 
@@ -76,7 +77,11 @@ SwInsTableDlg::SwInsTableDlg(SwView& rView)
 , m_xInsertBtn(m_xBuilder->weld_button("ok"))
 , m_xLbFormat(m_xBuilder->weld_tree_view("formatlbinstable"))
 , m_xWndPreview(new weld::CustomWeld(*m_xBuilder, "previewinstable", 
m_aWndPreview))
+, m_xStyleFrame(m_xBuilder->weld_frame("stylesframe"))
 {
+if (comphelper::LibreOfficeKit::isActive())
+m_xStyleFrame->hide();
+
 const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32;
 const int nHeight = m_xLbFormat->get_height_rows(8);
 m_xLbFormat->set_size_request(nWidth, nHeight);
diff --git a/sw/source/uibase/inc/instable.hxx 
b/sw/source/uibase/inc/instable.hxx
index 3145227e84a1..aa36dc655c00 100644
--- a/sw/source/uibase/inc/instable.hxx
+++ b/sw/source/uibase/inc/instable.hxx
@@ -58,6 +58,7 @@ class SwInsTableDlg : public SfxDialogController
 std::unique_ptr m_xInsertBtn;
 std::unique_ptr m_xLbFormat;
 std::unique_ptr m_xWndPreview;
+std::unique_ptr m_xStyleFrame;
 
 // Returns 255 if mapping is not possible.
 // This means there cannot be more than 255 autotable style.
diff --git a/sw/uiconfig/swriter/ui/inserttable.ui 
b/sw/uiconfig/swriter/ui/inserttable.ui
index 03a2eb096a91..64cfab916932 100644
--- a/sw/uiconfig/swriter/ui/inserttable.ui
+++ b/sw/uiconfig/swriter/ui/inserttable.ui
@@ -366,7 +366,7 @@
   
 
 
-  
+  
 True
 False
 True
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-20 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/basesh.cxx |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit b76c00c642a861fd01a7c82ad1b1ee1bc88ebd7c
Author: Szymon Kłos 
AuthorDate: Tue May 19 16:55:39 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed May 20 15:19:04 2020 +0200

Make Insert Table dialog async fix

Change-Id: If3d9e7d40f227cb657b2a9ff9714017d04bd76d4

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index f34c8a802d50..44f5f0a53b38 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2712,7 +2712,7 @@ static void InsertTableImpl(SwWrtShell& rSh,
 sal_uInt16 nCols,
 SwInsertTableOptions aInsTableOpts,
 const OUString& aAutoName,
-std::unique_ptr pTAFormat)
+std::unique_ptr& pTAFormat)
 {
 rSh.StartUndo(SwUndoId::INSTABLE);
 
@@ -2755,6 +2755,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 bool bCallEndUndo = false;
 
 if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() &&
+!rSh.IsTableMode() )
 {
 const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
 SwInsertTableOptions aInsTableOpts = 
pModOpt->GetInsTableFlags(bHTMLMode);
@@ -2825,7 +2826,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 std::shared_ptr 
pDialogController(pAbstractDialog->getDialogController());
 
 weld::DialogController::runAsync(pDialogController,
-[pAbstractDialog, , , aTableNameIn, nRowsIn, 
nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn] (sal_Int32 nResult) {
+[pAbstractDialog, , , aTableNameIn, nRowsIn, 
nColsIn, aInsTableOptsIn, aAutoNameIn, ] (sal_Int32 nResult) {
 if( RET_OK == nResult )
 {
 sal_uInt16 nCols = nColsIn;
@@ -2833,17 +2834,14 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 SwInsertTableOptions aInsTableOpts = 
aInsTableOptsIn;
 OUString aTableName = aTableNameIn;
 OUString aAutoName = aAutoNameIn;
-SwTableAutoFormat* pTAFormat = pTAFormatIn;
 
-pAbstractDialog->GetValues( aTableName, nRows, 
nCols, aInsTableOpts, aAutoName, pTAFormat );
+pAbstractDialog->GetValues( aTableName, nRows, 
nCols, aInsTableOpts, aAutoName, pTAFormatIn );
 
 if( nCols && nRows )
 {
-InsertTableImpl( rSh, rTempView, aTableName, 
nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
+InsertTableImpl( rSh, rTempView, aTableName, 
nRows, nCols, aInsTableOpts, aAutoName, pTAFormatIn );
 EndUndo(rSh);
 }
-
-delete pTAFormat;
 }
 }
 );
@@ -2862,7 +2860,6 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
 InsertTableImpl( rSh, rTempView, aTableNameIn, nRowsIn, 
nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn );
 
 bCallEndUndo = true;
-delete pTAFormatIn;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-18 Thread Pranam Lashkari (via logerrit)
 sw/source/ui/frmdlg/frmdlg.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 837c067ded097d257332c6948f237bff72bea0b8
Author: Pranam Lashkari 
AuthorDate: Sun Apr 26 23:25:47 2020 +0530
Commit: Andras Timar 
CommitDate: Mon May 18 20:59:36 2020 +0200

remove macro tab for image dialog in online

Change-Id: I02de19e8048fd045a6ef6bdcc655c9911f0f9f01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92958
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit 51d192a3bfa24dc979f7ad6178803d3262290b46)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94274
Tested-by: Andras Timar 

diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index 2deb04142e7e..ca59c421b394 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // the dialog's carrier
 SwFrameDlg::SwFrameDlg(SfxViewFrame const * pViewFrame,
@@ -112,6 +113,9 @@ SwFrameDlg::SwFrameDlg(SfxViewFrame const * pViewFrame,
 }
 }
 
+if(comphelper::LibreOfficeKit::isActive())
+RemoveTabPage("macro");
+
 if (m_bNew)
 SetCurPageId("type");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-18 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/misc/swruler.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 28606ab36152ce0c0b929e6eb23262eac4881a4e
Author: Tor Lillqvist 
AuthorDate: Thu Dec 5 00:28:41 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon May 18 08:41:28 2020 +0200

tdf#128468: The RulerTab::nPos is in twips

Do pass that as actual mm100 then.

Change-Id: Ifc9608aeee838172a18cc07aa1dbe0d7f3f5fb6a
Reviewed-on: https://gerrit.libreoffice.org/84473
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
(cherry picked from commit a69f5b1386fc7e3f7f9838c078e4078c555d)
Reviewed-on: https://gerrit.libreoffice.org/84761
(cherry picked from commit a3dcf498040111cf6f3fb96822c175d80f26d822)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94208

diff --git a/sw/source/uibase/misc/swruler.cxx 
b/sw/source/uibase/misc/swruler.cxx
index 989ef20f9057..d500ce3006d2 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -279,14 +279,17 @@ std::string SwCommentRuler::CreateJsonNotification()
 jsonNotif.put("pageOffset", convertTwipToMm100(GetPageOffset()));
 
 // GetPageWidth() on the other hand does return a value in twips.
+// So here convertTwipToMm100() really does produce actual mm100. Fun.
 jsonNotif.put("pageWidth", convertTwipToMm100(GetPageWidth()));
 
 boost::property_tree::ptree tabs;
 
+// The RulerTab array elements that GetTabs() returns have their nPos 
field in twips. So these
+// too are actual mm100.
 for (auto const& tab : GetTabs())
 {
 boost::property_tree::ptree element;
-element.put("position", tab.nPos);
+element.put("position", convertTwipToMm100(tab.nPos));
 element.put("style", tab.nStyle);
 tabs.push_back(std::make_pair("", element));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-18 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/misc/swruler.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit a08a0b2eb78527dd27656a46efb1ad69ea7f0d21
Author: Tor Lillqvist 
AuthorDate: Wed Dec 4 16:19:24 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon May 18 08:40:35 2020 +0200

tdf#128468: Add tab stop information to LOK_CALLBACK_RULER_UPDATE

Change-Id: I7872cdc3aabf66bb6d1df09f503274c698b64a4e
Reviewed-on: https://gerrit.libreoffice.org/84420
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
(cherry picked from commit 8a840463fc8abbbc445fed91463a1e2eb42dc1aa)
Reviewed-on: https://gerrit.libreoffice.org/84760
(cherry picked from commit 20c02c0f54618deb6b8c9af640f1e05e6a1168a2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94207

diff --git a/sw/source/uibase/misc/swruler.cxx 
b/sw/source/uibase/misc/swruler.cxx
index 021013890631..989ef20f9057 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -281,6 +281,18 @@ std::string SwCommentRuler::CreateJsonNotification()
 // GetPageWidth() on the other hand does return a value in twips.
 jsonNotif.put("pageWidth", convertTwipToMm100(GetPageWidth()));
 
+boost::property_tree::ptree tabs;
+
+for (auto const& tab : GetTabs())
+{
+boost::property_tree::ptree element;
+element.put("position", tab.nPos);
+element.put("style", tab.nStyle);
+tabs.push_back(std::make_pair("", element));
+}
+
+jsonNotif.add_child("tabs", tabs);
+
 RulerUnitData aUnitData = GetCurrentRulerUnit();
 jsonNotif.put("unit", aUnitData.aUnitStr);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-15 Thread Ashod Nakashian (via logerrit)
 sw/source/filter/ascii/parasc.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 7a831d5139f30bad2468323a74850810ada136cd
Author: Ashod Nakashian 
AuthorDate: Wed Jul 10 08:31:39 2019 -0400
Commit: Andras Timar 
CommitDate: Fri May 15 14:12:50 2020 +0200

sw: fail loading when the fallback text detection fails

When we document in question fails to match any known type,
we try to open as plain text (and convert to a Writer doc).
However we should not display non-text when we have failed
to detect ascii or unicode contents in the file.

This happens with corrupted documents, for example, where
we end up displaying non-printable binary data.

Change-Id: Iccc158a4cb6051a8b17ba01987a30a9882a27fa9
Reviewed-on: https://gerrit.libreoffice.org/75512
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
(cherry picked from commit d1f6f27e2a014aa55e2762f1209dc520fb183404)
Reviewed-on: https://gerrit.libreoffice.org/78452
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/82099
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/sw/source/filter/ascii/parasc.cxx 
b/sw/source/filter/ascii/parasc.cxx
index cbdae221ed1e..95948041d767 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -260,7 +260,11 @@ ErrCode SwASCIIParser::ReadChars()
 nOrig = nLen = rInput.ReadBytes(pArr.get(), ASC_BUFFLEN);
 rtl_TextEncoding eCharSet;
 LineEnd eLineEnd;
-bool bRet = SwIoSystem::IsDetectableText(pArr.get(), nLen, , 
, );
+const bool bRet
+= SwIoSystem::IsDetectableText(pArr.get(), nLen, , 
, );
+if (!bRet)
+return ERRCODE_IO_BROKENPACKAGE;
+
 OSL_ENSURE(bRet, "Autodetect of text import without nag dialog must 
have failed");
 if (bRet && eCharSet != RTL_TEXTENCODING_DONTKNOW)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits