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

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

New commits:
commit e256b08d17c5325500828fac49f946869c9c4752
Author: Noel Grandin 
AuthorDate: Fri Jul 2 11:19:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 2 14:38:25 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/+/118263
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/uiview/uivwimp.cxx 
b/sw/source/uibase/uiview/uivwimp.cxx
index e7ce5be812ab..2f8b55b00043 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -289,6 +289,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.2' - sw/source

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

New commits:
commit 70f778657d90fa974281233628e1006740d4d698
Author: Aron Budea 
AuthorDate: Mon Feb 15 21:46:45 2021 +0100
Commit: Aron Budea 
CommitDate: Sun Feb 21 22:33:34 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 
(cherry picked from commit 934ed8d888abe231c014ce179e5256933b0562ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/79
Reviewed-by: Aron Budea 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 3ab7e4a8c8d8..1a746f65f7d1 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3368,6 +3368,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.2' - sw/source

2021-01-25 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 7c1dd1001798092248b22ed392b12b6c271a831f
Author: Tamás Zolnai 
AuthorDate: Fri Jan 22 11:55:25 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Jan 25 16:25:45 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 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109903

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.2' - sw/source

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

New commits:
commit 1423d6e79ebc3d82d1971061273103c55073e358
Author: Tamás Zolnai 
AuthorDate: Tue Jan 12 16:00:46 2021 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Jan 20 23:02:56 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 
(cherry picked from commit 7f150d63253e171e87c09225291c4e059aaf2476)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109624

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 3e29c1b83f3b..57c8fe107028 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2402,6 +2402,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.2' - sw/source

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

New commits:
commit 8e996d7aa41d29b46964c656f4f959316e5ad265
Author: Jan Holesovsky 
AuthorDate: Tue Nov 24 15:34:55 2020 +0100
Commit: Miklos Vajna 
CommitDate: Thu Nov 26 13:50:32 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 
(cherry picked from commit 8f44a939ad09d0365607ae8960e2abfe77e3fe72)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106516

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index a3fabfaf514d..174437ea4156 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -355,14 +355,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;
@@ -1091,7 +1099,7 @@ SwRangeRedline::~SwRangeRedline()
 
 void MaybeNotifyRedlineModification(SwRangeRedline* pRedline, SwDoc* pDoc)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+if (!lcl_LOKRedlineNotificationEnabled())
 return;
 
 const SwRedlineTable& rRedTable = 
pDoc->getIDocumentRedlineAccess().GetRedlineTable();
@@ -1107,7 +1115,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.2' - sw/source

2020-10-06 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 8c75dc8cdae09aeae447862cdfc1fda948bc369d
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 22 07:29:34 2020 +0200
Commit: Andras Timar 
CommitDate: Tue Oct 6 08:24:17 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 
(cherry picked from commit 0120fecc22b36a55a2a25573a7a9632319b2b0ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103606
Reviewed-by: Andras Timar 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 91aad561d3db..074cb2507737 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4879,8 +4879,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)
@@ -4899,6 +4899,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" );
@@ -4928,25 +4951,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 7ecbf3202214..2d32c29bfd6d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -922,8 +922,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 > 

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

2020-07-28 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 407ad48dc464495031e45e4b3019fb1f068d301c
Author: Gülşah Köse 
AuthorDate: Mon Jul 27 22:26:13 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Jul 28 09:33:36 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/+/99535
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 adc586132f0c..52712a6ea106 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -312,9 +312,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();
 }
@@ -835,17 +835,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.2' - 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 7b3959b848e8bfc592903c5f69d16afee762cd44
Author: Szymon Kłos 
AuthorDate: Thu May 21 16:33:32 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 22 09:30:28 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 b960dcb4f168..a50cadb6bb18 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 c0194403ab98..c4980054f200 100644
--- a/sw/source/uibase/inc/instable.hxx
+++ b/sw/source/uibase/inc/instable.hxx
@@ -62,6 +62,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 7ce4f860fcce..236232a9cad2 100644
--- a/sw/uiconfig/swriter/ui/inserttable.ui
+++ b/sw/uiconfig/swriter/ui/inserttable.ui
@@ -373,7 +373,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.2' - sw/source

2020-05-21 Thread Tamás Zolnai (via logerrit)
 sw/source/core/crsr/FormFieldButton.cxx |6 +-
 sw/source/core/crsr/bookmrk.cxx |8 
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit cf46c7fc883ab6aecc5809a6c5fd823f736956f3
Author: Tamás Zolnai 
AuthorDate: Fri May 15 10:30:51 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Thu May 21 22:35:12 2020 +0200

MSForms: fix rendering of form field button.

It's not enough to check the paint area. because it's
in logic units, which does not change by zooming.

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

diff --git a/sw/source/core/crsr/FormFieldButton.cxx 
b/sw/source/core/crsr/FormFieldButton.cxx
index b69fab1d86d1..f64a80a228d8 100644
--- a/sw/source/core/crsr/FormFieldButton.cxx
+++ b/sw/source/core/crsr/FormFieldButton.cxx
@@ -57,7 +57,11 @@ void FormFieldButton::CalcPosAndSize(const SwRect& 
rPortionPaintArea)
 // Then extend the size with the button area
 
aBoxSize.AdjustWidth(GetParent()->LogicToPixel(rPortionPaintArea.SSize()).Height());
 
-SetPosSizePixel(aBoxPos, aBoxSize);
+if (aBoxPos != GetPosPixel() || aBoxSize != GetSizePixel())
+{
+SetPosSizePixel(aBoxPos, aBoxSize);
+Invalidate();
+}
 }
 
 void FormFieldButton::MouseButtonUp(const MouseEvent&)
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 5f8ba1b51b9d..9aa65b9bb2a5 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -556,19 +556,11 @@ namespace sw { namespace mark
 
 void DropDownFieldmark::SetPortionPaintArea(const SwRect& 
rPortionPaintArea)
 {
-if(m_aPortionPaintArea == rPortionPaintArea &&
-   m_pButton && m_pButton->IsVisible())
-{
-SendLOKMessage("show");
-return;
-}
-
 m_aPortionPaintArea = rPortionPaintArea;
 if(m_pButton)
 {
 m_pButton->Show();
 m_pButton->CalcPosAndSize(m_aPortionPaintArea);
-m_pButton->Invalidate();
 SendLOKMessage("show");
 }
 }
___
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.2' - sw/source sw/uiconfig sw/UIConfig_swriter.mk

2020-05-12 Thread Szymon Kłos (via logerrit)
 sw/UIConfig_swriter.mk |1 
 sw/source/ui/dialog/wordcountdialog.cxx|   13 
 sw/source/uibase/inc/wordcountdialog.hxx   |2 
 sw/uiconfig/swriter/ui/wordcount-mobile.ui |  661 +
 4 files changed, 676 insertions(+), 1 deletion(-)

New commits:
commit fe58fc543bea0a7b370f1df503ce59d83d8b3e2c
Author: Szymon Kłos 
AuthorDate: Mon Feb 24 19:10:52 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 12 19:48:40 2020 +0200

Add mobile version of WordCountDialog

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

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 4167a4eee307..0faa1b16bc20 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -286,6 +286,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/warnemaildialog \
sw/uiconfig/swriter/ui/watermarkdialog \
sw/uiconfig/swriter/ui/wordcount \
+   sw/uiconfig/swriter/ui/wordcount-mobile \
sw/uiconfig/swriter/ui/wrapdialog \
sw/uiconfig/swriter/ui/wrappage \
 ))
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx 
b/sw/source/ui/dialog/wordcountdialog.cxx
index 30148e8bb83b..6080bb6c166d 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -30,6 +30,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+
+#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
 
 SwWordCountFloatDlg::~SwWordCountFloatDlg()
 {
@@ -84,6 +89,8 @@ void SwWordCountFloatDlg::showCJK(bool bShowCJK)
 {
 m_xCurrentCjkcharsFT->show(bShowCJK);
 m_xDocCjkcharsFT->show(bShowCJK);
+if (m_xCjkcharsLabelFT2)
+m_xCjkcharsLabelFT2->show(bShowCJK);
 m_xCjkcharsLabelFT->show(bShowCJK);
 }
 
@@ -91,6 +98,8 @@ void SwWordCountFloatDlg::showStandardizedPages(bool 
bShowStandardizedPages)
 {
 m_xCurrentStandardizedPagesFT->show(bShowStandardizedPages);
 m_xDocStandardizedPagesFT->show(bShowStandardizedPages);
+if (m_xStandardizedPagesLabelFT2)
+m_xStandardizedPagesLabelFT2->show(bShowStandardizedPages);
 m_xStandardizedPagesLabelFT->show(bShowStandardizedPages);
 }
 
@@ -98,7 +107,7 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* 
_pBindings,
  SfxChildWindow* pChild,
  weld::Window *pParent,
  SfxChildWinInfo const * pInfo)
-: SfxModelessDialogController(_pBindings, pChild, pParent, 
"modules/swriter/ui/wordcount.ui", "WordCountDialog")
+: SfxModelessDialogController(_pBindings, pChild, pParent, IS_MOBILE ? 
OUString("modules/swriter/ui/wordcount-mobile.ui") : 
OUString("modules/swriter/ui/wordcount.ui"), "WordCountDialog")
 , m_xCurrentWordFT(m_xBuilder->weld_label("selectwords"))
 , m_xCurrentCharacterFT(m_xBuilder->weld_label("selectchars"))
 , 
m_xCurrentCharacterExcludingSpacesFT(m_xBuilder->weld_label("selectcharsnospaces"))
@@ -110,7 +119,9 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* 
_pBindings,
 , m_xDocCjkcharsFT(m_xBuilder->weld_label("doccjkchars"))
 , m_xDocStandardizedPagesFT(m_xBuilder->weld_label("docstandardizedpages"))
 , m_xCjkcharsLabelFT(m_xBuilder->weld_label("cjkcharsft"))
+, m_xCjkcharsLabelFT2(m_xBuilder->weld_label("cjkcharsft2"))
 , m_xStandardizedPagesLabelFT(m_xBuilder->weld_label("standardizedpages"))
+, 
m_xStandardizedPagesLabelFT2(m_xBuilder->weld_label("standardizedpages2"))
 {
 showCJK(SvtCJKOptions().IsAnyEnabled());
 
showStandardizedPages(officecfg::Office::Writer::WordCount::ShowStandardizedPageCount::get());
diff --git a/sw/source/uibase/inc/wordcountdialog.hxx 
b/sw/source/uibase/inc/wordcountdialog.hxx
index 7e2730f7d0aa..b3afc1393268 100644
--- a/sw/source/uibase/inc/wordcountdialog.hxx
+++ b/sw/source/uibase/inc/wordcountdialog.hxx
@@ -42,7 +42,9 @@ class SwWordCountFloatDlg : public SfxModelessDialogController
 std::unique_ptr m_xDocCjkcharsFT;
 std::unique_ptr m_xDocStandardizedPagesFT;
 std::unique_ptr m_xCjkcharsLabelFT;
+std::unique_ptr m_xCjkcharsLabelFT2;
 std::unique_ptr m_xStandardizedPagesLabelFT;
+std::unique_ptr m_xStandardizedPagesLabelFT2;
 
 public:
 SwWordCountFloatDlg(SfxBindings* pBindings,
diff --git a/sw/uiconfig/swriter/ui/wordcount-mobile.ui 
b/sw/uiconfig/swriter/ui/wordcount-mobile.ui
new file mode 100644
index ..37129797d11d
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/wordcount-mobile.ui
@@ -0,0 +1,661 @@
+
+
+
+  
+  
+False
+6
+Word Count
+0
+0
+True
+dialog
+
+  
+False
+vertical
+12
+
+  
+False
+

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

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

New commits:
commit 51d192a3bfa24dc979f7ad6178803d3262290b46
Author: Pranam Lashkari 
AuthorDate: Sun Apr 26 23:25:47 2020 +0530
Commit: Andras Timar 
CommitDate: Mon Apr 27 09:34:24 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 

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.2' - sw/source

2020-03-30 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/lingu/olmenu.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d638fb21aa12bb02cafc64affef343cc6afa00d5
Author: Tamás Zolnai 
AuthorDate: Fri Mar 27 13:58:52 2020 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Mar 30 14:03:52 2020 +0200

sw lok: add uno command for submenus in Spellchecking popup.

Change-Id: I1c7591379ecbce0099ed7d969e5dc83831e322b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91227
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 190e783379a00b1ba82d4a48e95e47449ce2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91356
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/lingu/olmenu.cxx 
b/sw/source/uibase/lingu/olmenu.cxx
index 29f27bf0ca4f..d107e2901fb5 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -617,6 +617,7 @@ void SwSpellPopup::InitItemCommands(const 
css::uno::Sequence< OUString >& aSugge
 }
 
 PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nLangSelectionMenuId);
+m_xPopupMenu->SetItemCommand(m_nLangSelectionMenuId, 
".uno:SetSelectionLanguageMenu");
 if(pMenu)
 {
 for (const auto& item : m_aLangTable_Text)
@@ -631,6 +632,7 @@ void SwSpellPopup::InitItemCommands(const 
css::uno::Sequence< OUString >& aSugge
 }
 
 pMenu = m_xPopupMenu->GetPopupMenu(m_nLangParaMenuId);
+m_xPopupMenu->SetItemCommand(m_nLangParaMenuId, 
".uno:SetParagraphLanguageMenu");
 if(pMenu)
 {
 for (const auto& item : m_aLangTable_Paragraph)
___
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.2' - sw/source

2020-03-23 Thread Ashod Nakashian (via logerrit)
 sw/source/uibase/shells/drwtxtsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a50d20b114b4d418cebb968af4b40645dfac087a
Author: Ashod Nakashian 
AuthorDate: Sun Mar 22 11:45:08 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Tue Mar 24 00:07:33 2020 +0100

sw: keep the cursor visible after creating SwDrawTextShell

For some mysterious reason the cursor was forced to
become hidden after creating SwDrawTextShell, which
is used to edit the text on shapes. Doing this
didn't have a negative effect on desktop, because
the cursor was shown anyway at a later point.

However, for LOK, the cursor was not restored. This
was unexpected as the clients didn't know editing
was possible (and on mobile wouldn't even show
the keyboard).

There doesn't seem to be any ill-effect to leaving
the cursor enabled in all cases after creating
an SwDrawTextShell instance.

Change-Id: Ifae8d533ef48b2146a451d58d729e46f5248be71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90897
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/sw/source/uibase/shells/drwtxtsh.cxx 
b/sw/source/uibase/shells/drwtxtsh.cxx
index cf6e1765e3fd..6d83dd0d05c6 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -124,9 +124,9 @@ SwDrawTextShell::SwDrawTextShell(SwView ) :
 SwWrtShell  = GetShell();
 SetPool(rSh.GetAttrPool().GetSecondaryPool());
 
+// Initialize and show cursor to start editing.
 Init();
 
-rSh.NoEdit();
 SetName("ObjectText");
 
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::DrawText));
 }
___
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.2' - sw/source

2020-03-23 Thread Ashod Nakashian (via logerrit)
 sw/source/uibase/uiview/viewdraw.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8ed4ac6152c96280616a784b47c4f75df147501a
Author: Ashod Nakashian 
AuthorDate: Sat Mar 21 11:48:40 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Tue Mar 24 00:06:39 2020 +0100

sw: check for null SdrObject before accessing

Change-Id: I30f1cc658450982232feea10dbe9c5bfefe07d91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90896
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/sw/source/uibase/uiview/viewdraw.cxx 
b/sw/source/uibase/uiview/viewdraw.cxx
index 62f2842f0cb0..94d1153ad460 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -665,6 +665,8 @@ bool SwView::AreOnlyFormsSelected() const
 {
 // Except controls, are still normal draw objects selected?
 SdrObject *pSdrObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+if (!pSdrObj)
+continue;
 
 if (!HasOnlyObj(pSdrObj, SdrInventor::FmForm))
 {
___
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.2' - sw/source vcl/headless vcl/inc vcl/source

2020-02-26 Thread Michael Meeks (via logerrit)
 sw/source/core/doc/notxtfrm.cxx |  198 +---
 sw/source/core/inc/frmtool.hxx  |6 
 sw/source/core/inc/notxtfrm.hxx |6 
 vcl/headless/svpbmp.cxx |7 -
 vcl/headless/svpgdi.cxx |  219 +++
 vcl/inc/headless/svpbmp.hxx |   26 
 vcl/source/outdev/bitmap.cxx|  247 +++-
 7 files changed, 107 insertions(+), 602 deletions(-)

New commits:
commit 4e19d09360220a181d7bdad92e6112390ff49f39
Author: Michael Meeks 
AuthorDate: Wed Feb 26 03:59:48 2020 +
Commit: Michael Meeks 
CommitDate: Wed Feb 26 09:53:26 2020 +0100

Revert "tdf#130768 speedup huge pixel graphics Cairo"

This reverts commit ef6f94e93bbe55a26b67b55b2aecda67d406ab85.

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

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index f2b148361994..04e556277738 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -82,14 +82,6 @@
 #include 
 #include 
 
-// MM02 needed for VOC mechanism and getting the OC - may be moved to an own 
file
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
 using namespace com::sun::star;
 
 static bool GetRealURL( const SwGrfNode& rNd, OUString& rText )
@@ -156,9 +148,7 @@ static void lcl_PaintReplacement( const SwRect , 
const OUString ,
 SwNoTextFrame::SwNoTextFrame(SwNoTextNode * const pNode, SwFrame* pSib )
 :   SwContentFrame( pNode, pSib ),
 // RotateFlyFrame3
-mpTransformableSwFrame(),
-// MM02
-mpViewContact()
+mpTransformableSwFrame()
 {
 mnFrameType = SwFrameType::NoTxt;
 }
@@ -935,7 +925,6 @@ static bool paintUsingPrimitivesHelper(
 return false;
 }
 
-// MM02 original using falölback to VOC and primitive-based version
 void paintGraphicUsingPrimitivesHelper(
 vcl::RenderContext & rOutputDevice,
 GraphicObject const& rGrfObj,
@@ -947,24 +936,12 @@ void paintGraphicUsingPrimitivesHelper(
 // -> the primitive renderer will create the needed pdf export data
 // -> if bitmap content, it will be cached system-dependent
 drawinglayer::primitive2d::Primitive2DContainer aContent(1);
+
 aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
 rGraphicTransform,
 rGrfObj,
 rGraphicAttr);
 
-// MM02 use primitive-based version for visualization
-paintGraphicUsingPrimitivesHelper(
-rOutputDevice,
-aContent,
-rGraphicTransform);
-}
-
-// MM02 new VOC and primitive-based version
-void paintGraphicUsingPrimitivesHelper(
-vcl::RenderContext & rOutputDevice,
-drawinglayer::primitive2d::Primitive2DContainer& rContent,
-const basegfx::B2DHomMatrix& rGraphicTransform)
-{
 // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
 // need to use that. Usually the renderer would be a VCL-based
 // PrimitiveRenderer, but there are system-specific shortcuts that
@@ -1031,12 +1008,9 @@ void paintGraphicUsingPrimitivesHelper(
 aTarget.append(aClip);
 }
 
-drawinglayer::primitive2d::MaskPrimitive2D* pNew(
-new drawinglayer::primitive2d::MaskPrimitive2D(
-aTarget,
-rContent));
-rContent.resize(1);
-rContent[0] = pNew;
+aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
+aTarget,
+aContent);
 }
 }
 
@@ -1045,111 +1019,11 @@ void paintGraphicUsingPrimitivesHelper(
 
 paintUsingPrimitivesHelper(
 rOutputDevice,
-rContent,
+aContent,
 aTargetRange,
 aTargetRange);
 }
 
-// DrawContact section
-namespace { // anonymous namespace
-class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
-{
-protected:
-virtual drawinglayer::primitive2d::Primitive2DContainer 
createPrimitive2DSequence(
-const sdr::contact::DisplayInfo& rDisplayInfo) const override;
-
-public:
-ViewObjectContactOfSwNoTextFrame(
-sdr::contact::ObjectContact& rObjectContact,
-sdr::contact::ViewContact& rViewContact);
-};
-
-class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
-{
-private:
-// owner
-const SwNoTextFrame&mrSwNoTextFrame;
-
-protected:
-// Create an Object-Specific ViewObjectContact, set ViewContact and
-// ObjectContact. Always needs to return something.
-virtual sdr::contact::ViewObjectContact& 
CreateObjectSpecificViewObjectContact(
-sdr::contact::ObjectContact& rObjectContact) override;
-
-public:
-// read-access to owner
-const SwNoTextFrame& getSwNoTextFrame() const { return mrSwNoTextFrame; }
-
-// basic constructor, used from SwNoTextFrame.
-explicit 

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

2020-02-24 Thread Armin Le Grand (Collabora) (via logerrit)
 sw/source/core/doc/notxtfrm.cxx |  198 ++--
 sw/source/core/inc/frmtool.hxx  |6 
 sw/source/core/inc/notxtfrm.hxx |6 
 vcl/headless/svpbmp.cxx |7 +
 vcl/headless/svpgdi.cxx |  219 ---
 vcl/inc/headless/svpbmp.hxx |   26 
 vcl/source/outdev/bitmap.cxx|  247 
 7 files changed, 602 insertions(+), 107 deletions(-)

New commits:
commit ef6f94e93bbe55a26b67b55b2aecda67d406ab85
Author: Armin Le Grand (Collabora) 
AuthorDate: Fri Feb 21 16:58:17 2020 +0100
Commit: Miklos Vajna 
CommitDate: Mon Feb 24 13:10:29 2020 +0100

tdf#130768 speedup huge pixel graphics Cairo

For more information/documentation please
refer to the bugzilla task

Fixed a crash in CppunitTest_desktop_lib which
led to a missing test of mpGraphics in
OutputDevice::DrawTransformedBitmapEx. Other
public methods test that and one of the goals
of the cange was to use that method more often,
so this may have never been detected before

Change-Id: I10e57bd05db0c8cf868ff98d63f5af3d116a3015
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89230
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89252
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 04e556277738..f2b148361994 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -82,6 +82,14 @@
 #include 
 #include 
 
+// MM02 needed for VOC mechanism and getting the OC - may be moved to an own 
file
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 using namespace com::sun::star;
 
 static bool GetRealURL( const SwGrfNode& rNd, OUString& rText )
@@ -148,7 +156,9 @@ static void lcl_PaintReplacement( const SwRect , 
const OUString ,
 SwNoTextFrame::SwNoTextFrame(SwNoTextNode * const pNode, SwFrame* pSib )
 :   SwContentFrame( pNode, pSib ),
 // RotateFlyFrame3
-mpTransformableSwFrame()
+mpTransformableSwFrame(),
+// MM02
+mpViewContact()
 {
 mnFrameType = SwFrameType::NoTxt;
 }
@@ -925,6 +935,7 @@ static bool paintUsingPrimitivesHelper(
 return false;
 }
 
+// MM02 original using falölback to VOC and primitive-based version
 void paintGraphicUsingPrimitivesHelper(
 vcl::RenderContext & rOutputDevice,
 GraphicObject const& rGrfObj,
@@ -936,12 +947,24 @@ void paintGraphicUsingPrimitivesHelper(
 // -> the primitive renderer will create the needed pdf export data
 // -> if bitmap content, it will be cached system-dependent
 drawinglayer::primitive2d::Primitive2DContainer aContent(1);
-
 aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
 rGraphicTransform,
 rGrfObj,
 rGraphicAttr);
 
+// MM02 use primitive-based version for visualization
+paintGraphicUsingPrimitivesHelper(
+rOutputDevice,
+aContent,
+rGraphicTransform);
+}
+
+// MM02 new VOC and primitive-based version
+void paintGraphicUsingPrimitivesHelper(
+vcl::RenderContext & rOutputDevice,
+drawinglayer::primitive2d::Primitive2DContainer& rContent,
+const basegfx::B2DHomMatrix& rGraphicTransform)
+{
 // RotateFlyFrame3: If ClipRegion is set at OutputDevice, we
 // need to use that. Usually the renderer would be a VCL-based
 // PrimitiveRenderer, but there are system-specific shortcuts that
@@ -1008,9 +1031,12 @@ void paintGraphicUsingPrimitivesHelper(
 aTarget.append(aClip);
 }
 
-aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
-aTarget,
-aContent);
+drawinglayer::primitive2d::MaskPrimitive2D* pNew(
+new drawinglayer::primitive2d::MaskPrimitive2D(
+aTarget,
+rContent));
+rContent.resize(1);
+rContent[0] = pNew;
 }
 }
 
@@ -1019,11 +1045,111 @@ void paintGraphicUsingPrimitivesHelper(
 
 paintUsingPrimitivesHelper(
 rOutputDevice,
-aContent,
+rContent,
 aTargetRange,
 aTargetRange);
 }
 
+// DrawContact section
+namespace { // anonymous namespace
+class ViewObjectContactOfSwNoTextFrame : public sdr::contact::ViewObjectContact
+{
+protected:
+virtual drawinglayer::primitive2d::Primitive2DContainer 
createPrimitive2DSequence(
+const sdr::contact::DisplayInfo& rDisplayInfo) const override;
+
+public:
+ViewObjectContactOfSwNoTextFrame(
+sdr::contact::ObjectContact& rObjectContact,
+sdr::contact::ViewContact& rViewContact);
+};
+
+class ViewContactOfSwNoTextFrame : public sdr::contact::ViewContact
+{
+private:
+// owner
+const SwNoTextFrame&mrSwNoTextFrame;
+
+protected:
+// Create an Object-Specific 

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

2020-02-20 Thread Michael Stahl (via logerrit)
 sw/source/core/inc/rolbck.hxx  |4 ++--
 sw/source/core/undo/rolbck.cxx |   12 
 sw/source/core/undo/undobj.cxx |   10 +-
 sw/source/core/undo/untbl.cxx  |2 +-
 4 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 783ff7aacf72d907b43b26926131966b199ebb90
Author: Michael Stahl 
AuthorDate: Tue Nov 19 10:54:57 2019 +0100
Commit: Miklos Vajna 
CommitDate: Thu Feb 20 18:52:08 2020 +0100

sw: fix invalid downcast of SwDrawFrameFormat in DelContentIndex()

failure in UITest_writer_tests6:

sw/source/core/undo/undobj.cxx:1021:47: runtime error: downcast of address 
0x61300019d3c0 which does not point to an object of type 'SwFlyFrameFormat'
0x61300019d3c0:m note: object is of type 'SwDrawFrameFormat'
 a2 01 80 19  50 ac d1 9e 14 7f 00 00  00 af 19 00 30 61 00 00  e8 4f 
0b 00 b0 61 00 00  40 dd 40 00
  ^~~
  vptr for 'SwDrawFrameFormat'
 in SwUndoSaveContent::DelContentIndex(SwPosition const&, SwPosition 
const&, DelContentType) at sw/source/core/undo/undobj.cxx:1021:47 
(instdir/program/../program/libswlo.so +0xf8e5833)

Also lose the ridiculous overloading across derived classes.

(cherry picked from commit 8f7274682661baec4c9b160ee2165972bbfa9881)

Conflicts:
sw/source/core/undo/undobj.cxx

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

diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 2feec7e6d973..619b0577c613 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -361,8 +361,8 @@ public:
 void Add( SwTextAttr* pTextHt, sal_uLong nNodeIdx, bool bNewAttr );
 void Add( SwFormatColl*, sal_uLong nNodeIdx, SwNodeType nWhichNd );
 void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos );
-void Add( SwFrameFormat& rFormat );
-void Add( SwFlyFrameFormat&, sal_uInt16& rSetPos );
+void AddChangeFlyAnchor( SwFrameFormat& rFormat );
+void AddDeleteFly( SwFrameFormat&, sal_uInt16& rSetPos );
 void Add( const SwTextFootnote& );
 void Add( const SfxItemSet & rSet, const SwCharFormat & rCharFormat);
 
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 495ce724032d..973054c47664 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1067,18 +1067,21 @@ void SwHistory::Add(const ::sw::mark::IMark& rBkmk, 
bool bSavePos, bool bSaveOth
 m_SwpHstry.push_back( std::move(pHt) );
 }
 
-void SwHistory::Add( SwFrameFormat& rFormat )
+void SwHistory::AddChangeFlyAnchor(SwFrameFormat& rFormat)
 {
 std::unique_ptr pHt(new SwHistoryChangeFlyAnchor( rFormat 
));
 m_SwpHstry.push_back( std::move(pHt) );
 }
 
-void SwHistory::Add( SwFlyFrameFormat& rFormat, sal_uInt16& rSetPos )
+void SwHistory::AddDeleteFly(SwFrameFormat& rFormat, sal_uInt16& rSetPos)
 {
 OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
 
 const sal_uInt16 nWh = rFormat.Which();
-if( RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh )
+(void) nWh;
+// only Flys!
+assert((RES_FLYFRMFMT == nWh && dynamic_cast())
+|| (RES_DRAWFRMFMT == nWh && 
dynamic_cast()));
 {
 std::unique_ptr pHint(new SwHistoryTextFlyCnt(  
));
 m_SwpHstry.push_back( std::move(pHint) );
@@ -1087,10 +1090,11 @@ void SwHistory::Add( SwFlyFrameFormat& rFormat, 
sal_uInt16& rSetPos )
 if( SfxItemState::SET == rFormat.GetItemState( RES_CHAIN, false,
 reinterpret_cast() ))
 {
+assert(RES_FLYFRMFMT == nWh); // not supported on SdrObjects
 if( pChainItem->GetNext() || pChainItem->GetPrev() )
 {
 std::unique_ptr pHt(
-new SwHistoryChangeFlyChain( rFormat, *pChainItem ));
+new 
SwHistoryChangeFlyChain(static_cast(rFormat), *pChainItem));
 m_SwpHstry.insert( m_SwpHstry.begin() + rSetPos++, 
std::move(pHt) );
 if ( pChainItem->GetNext() )
 {
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 452091c548f8..dcbe3a4a04cc 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -992,7 +992,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& 
rMark,
 // Do not try to move the anchor to a 
table!
 && rMark.nNode.GetNode().IsTextNode())
 {
-pHistory->Add( *pFormat );
+pHistory->AddChangeFlyAnchor(*pFormat);
 SwFormatAnchor aAnch( *pAnchor );
 SwPosition aPos( 

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

2020-02-20 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 5ae142a2169e3db0fd138e91e71e3d696580d453
Author: Michael Stahl 
AuthorDate: Fri Aug 9 12:11:17 2019 +0200
Commit: Miklos Vajna 
CommitDate: Thu Feb 20 18:51:21 2020 +0100

tdf#126626 sw: fix duplicate SwUndoInsLayFormat in single-node Copy

Fly Undo created later in SwUndoInserts::SetInsertRange(); suppress it
in DocumentContentOperationsManager::CopyImpl().

(regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5)

(cherry picked from commit 844f9fa6ba7108b12758202c5fd08daa2a707641)

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 5b07f7b48fb8..137eb9a593ec 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4608,6 +4608,8 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& 
rPam, SwPosition& rPos,
 
 // copy at-char flys in rPam
 aInsPos = *pDestTextNd; // update to new (start) node for 
flys
+// tdf#126626 prevent duplicate Undos
+::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
 CopyFlyInFlyImpl(aRg, , aInsPos, false);
 
 break;
___
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.2' - sw/source

2020-02-10 Thread Dennis Francis (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c7178a12e6e57e3d85cecd09e9c0373ececbb33f
Author: Dennis Francis 
AuthorDate: Fri Feb 7 12:08:21 2020 +0530
Commit: Jan Holesovsky 
CommitDate: Mon Feb 10 12:51:39 2020 +0100

Classify shape(s) selections as 'complex'...

in isComplex() of XTransferable2 implementation SwTransferable.
This method is used by online via doc_getSelectionType() to determine the
type of selection. In writer this method used to classify shape objects as
non-complex which translates to 'text' in online, so if a shape is selected
in online, the js code there would treat it as text. This is problematic
when you want to send the correct align uno commands based on selection 
type.
So returning true in isComplex() for writer would correctly treat the shape
selections as 'complex' in online Writer.

Change-Id: I09fcd9e4fab48aa0d7e7d04c88bae9e1281a1b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88158
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index ea12ee91601a..b9cce5ee9579 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -415,6 +415,9 @@ sal_Bool SAL_CALL SwTransferable::isComplex()
 }
 }
 
+if (m_pWrtShell->GetSelectionType() == SelectionType::DrawObject)
+return true; // Complex
+
 // Simple
 return 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.2' - sw/source

2020-02-10 Thread Dennis Francis (via logerrit)
 sw/source/uibase/shells/drwbassh.cxx |   53 +--
 1 file changed, 44 insertions(+), 9 deletions(-)

New commits:
commit 4a885a4da2e7baaa8c1827a1483b76894d3c0967
Author: Dennis Francis 
AuthorDate: Fri Feb 7 12:49:59 2020 +0530
Commit: Miklos Vajna 
CommitDate: Mon Feb 10 12:02:54 2020 +0100

Get the align states of draw-shapes in...

SwDrawBaseShell::GetState() so that the align buttons are informed
(in core desktop and online via statechange messages)

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

diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 6f405026b071..21c6f9395a90 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -695,18 +695,53 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
 case SID_OBJECT_ALIGN_MIDDLE:
 case SID_OBJECT_ALIGN_DOWN:
 case SID_OBJECT_ALIGN:
-if ( !rSh.IsAlignPossible() || bProtected )
-rSet.DisableItem( nWhich );
-else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
 {
+bool bDisableThis = false;
+bool bDisableHoriz = false;
+bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich 
== SID_OBJECT_ALIGN_CENTER ||
+nWhich == SID_OBJECT_ALIGN_RIGHT);
 const SdrMarkList& rMarkList = 
pSdrView->GetMarkedObjectList();
-//if only one object is selected it can only be vertically
-// aligned because it is character bound
-if( rMarkList.GetMarkCount() == 1 )
+if ( !rSh.IsAlignPossible() || bProtected )
+{
+bDisableThis = true;
+rSet.DisableItem( nWhich );
+}
+else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
 {
-rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
-rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
-rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
+//if only one object is selected it can only be 
vertically
+// aligned because it is character bound
+if( rMarkList.GetMarkCount() == 1 )
+{
+bDisableHoriz = true;
+rSet.DisableItem(SID_OBJECT_ALIGN_LEFT);
+rSet.DisableItem(SID_OBJECT_ALIGN_CENTER);
+rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT);
+}
+}
+
+if (bHoriz && !bDisableThis && !bDisableHoriz &&
+rMarkList.GetMarkCount() == 1)
+{
+sal_Int16 nHoriOrient = -1;
+switch(nWhich)
+{
+case SID_OBJECT_ALIGN_LEFT:
+nHoriOrient = text::HoriOrientation::LEFT;
+break;
+case SID_OBJECT_ALIGN_CENTER:
+nHoriOrient = text::HoriOrientation::CENTER;
+break;
+case SID_OBJECT_ALIGN_RIGHT:
+nHoriOrient = text::HoriOrientation::RIGHT;
+break;
+default:
+break;
+}
+
+SdrObject* pObj = 
rMarkList.GetMark(0)->GetMarkedSdrObj();
+SwFrameFormat* pFrameFormat = FindFrameFormat(pObj);
+SwFormatHoriOrient 
aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
+rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() 
== nHoriOrient));
 }
 }
 break;
___
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.2' - sw/source

2020-02-04 Thread Mike Kaganski (via logerrit)
 sw/source/ui/fldui/flddb.cxx |   58 +--
 sw/source/ui/fldui/flddb.hxx |1 
 2 files changed, 35 insertions(+), 24 deletions(-)

New commits:
commit a8070d38c81c64e9e9cff0ea28fdcffc2763c365
Author: Mike Kaganski 
AuthorDate: Mon Jan 6 01:20:13 2020 +0300
Commit: Miklos Vajna 
CommitDate: Tue Feb 4 09:16:16 2020 +0100

tdf#129798: store SwWrtShell when it's available

GetActiveWrtShell may return nullptr when attaching a new component
to current frame, e.g. destroying on print preview. OTOH SwWrtShell
is passed to SwFieldDBPage::SetWrtShell on creation, so store it to
own base class then.

Possibly that would be enough, and we could remove all the checks
in other methods - but I don't know the code well enough to be sure
that SwFieldDlg::PageCreated and SwFieldEditDlg::CreatePage will
always set SwWrtShell; to be on the safe side, I kept the checks
where SwWrtShell is used, and stored it in those places if not yet
stored.

Regression after commit 39ba5e3bde93358af1b363da8f850bdc96806cfa.

Change-Id: I21f3c8ef24764e98b1bc287db3c6485ce0b3ab48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86253
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87947
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 3feac5488241..59b59b31607e 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -79,13 +79,14 @@ SwFieldDBPage::~SwFieldDBPage()
 
 void SwFieldDBPage::dispose()
 {
-SwWrtShell* pSh = GetWrtShell();
-if (!pSh)
-pSh = ::GetActiveWrtShell();
-// This would cleanup in the case of cancelled dialog
-SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
-if (pDbManager)
-pDbManager->RevokeLastRegistrations();
+// If we have no stored SwWrtShell, it means we didn't do anything useful 
- no need to revoke.
+if (SwWrtShell* pSh = GetWrtShell())
+{
+// This would cleanup in the case of cancelled dialog
+SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
+if (pDbManager)
+pDbManager->RevokeLastRegistrations();
+}
 
 m_pTypeLB.clear();
 m_pDatabaseTLB.clear();
@@ -160,9 +161,7 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
 }
 else
 {
-SwWrtShell *pSh = GetWrtShell();
-if(!pSh)
-pSh = ::GetActiveWrtShell();
+SwWrtShell *pSh = CheckAndGetWrtShell();
 if(pSh)
 {
 SwDBData aTmp(pSh->GetDBData());
@@ -213,9 +212,8 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
 aData.sDataSource = m_pDatabaseTLB->GetDBName(sTableName, sColumnName, 
);
 aData.sCommand = sTableName;
 aData.nCommandType = bIsTable ? 0 : 1;
-SwWrtShell *pSh = GetWrtShell();
-if(!pSh)
-pSh = ::GetActiveWrtShell();
+SwWrtShell *pSh = CheckAndGetWrtShell();
+assert(pSh);
 
 SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
 if (pDbManager)
@@ -309,9 +307,8 @@ void SwFieldDBPage::TypeHdl( ListBox const * pBox )
 if (nOld == GetTypeSel())
 return;
 
-SwWrtShell *pSh = GetWrtShell();
-if(!pSh)
-pSh = ::GetActiveWrtShell();
+SwWrtShell *pSh = CheckAndGetWrtShell();
+assert(pSh);
 bool bCond = false, bSetNo = false, bFormat = false, bDBFormat = false;
 const sal_uInt16 nTypeId = 
static_cast(reinterpret_cast(m_pTypeLB->GetEntryData(GetTypeSel(;
 
@@ -499,15 +496,14 @@ IMPL_LINK( SwFieldDBPage, TreeSelectHdl, SvTreeListBox *, 
pBox, void )
 
 IMPL_LINK_NOARG(SwFieldDBPage, AddDBHdl, Button*, void)
 {
-SwWrtShell* pSh = GetWrtShell();
-if (!pSh)
-pSh = ::GetActiveWrtShell();
-
-OUString sNewDB
-= SwDBManager::LoadAndRegisterDataSource(GetFrameWeld(), 
pSh->GetDoc()->GetDocShell());
-if(!sNewDB.isEmpty())
+if (SwWrtShell* pSh = CheckAndGetWrtShell())
 {
-m_pDatabaseTLB->AddDataSource(sNewDB);
+OUString sNewDB
+= SwDBManager::LoadAndRegisterDataSource(GetFrameWeld(), 
pSh->GetDoc()->GetDocShell());
+if (!sNewDB.isEmpty())
+{
+m_pDatabaseTLB->AddDataSource(sNewDB);
+}
 }
 }
 
@@ -535,7 +531,21 @@ void SwFieldDBPage::ActivateMailMergeAddress()
 
 void SwFieldDBPage::SetWrtShell(SwWrtShell& rSh)
 {
+// We need to remember the shell to be able to call correct SwDBManager
+SwFieldPage::SetWrtShell();
 m_pDatabaseTLB->SetWrtShell(rSh);
 }
 
+SwWrtShell* SwFieldDBPage::CheckAndGetWrtShell()
+{
+SwWrtShell* pSh = GetWrtShell();
+if (!pSh)
+{
+pSh = ::GetActiveWrtShell();
+if (pSh) // this is not guaranteed: e.g., activating print preview 
with dialog active
+SetWrtShell(*pSh);
+}
+return pSh;

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

2020-01-09 Thread Michael Meeks (via logerrit)
 sw/source/uibase/docvw/AnnotationWin2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dbbdc809b41c705d732e06c69c348ab6d1977e46
Author: Michael Meeks 
AuthorDate: Thu Jan 9 09:58:11 2020 +
Commit: Michael Meeks 
CommitDate: Thu Jan 9 18:27:17 2020 +0100

sw: tolerate null ShadowOverlay object as the rest of the code does.

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

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 48db11fdd37e..c9ba97fd5adc 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -766,7 +766,7 @@ void SwAnnotationWin::SetPosAndSize()
 }
 }
 
-if (bChange)
+if (mpShadow && bChange)
 {
 Point aStart = 
EditWin().PixelToLogic(GetPosPixel()+Point(0,GetSizePixel().Height()));
 Point aEnd = 
EditWin().PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height()));
___
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.2' - sw/source

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/edit/edfcol.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit e6a6449aab2b63252ccb4ca9e3e009534c5f0c48
Author: Ashod Nakashian 
AuthorDate: Wed Oct 3 05:49:51 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 04:35:55 2019 +0100

sw: paragraph-sign: avoid re-validating paragraphs when classifying

When setting the classification watermark, every edit to the document
is triggering a re-validation of signatures, which is excessive and
excessively expensive.

Change-Id: I7808877263f553a871f2c31856da1a2f9e50c4bb
Reviewed-on: https://gerrit.libreoffice.org/63007
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit 10a0693a60d11cfd2401f9f96041bc3d5d7c4c5b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85808
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 8068e618ffcf..b97ce353a840 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -2160,6 +2160,12 @@ void SwEditShell::ClassifyDocPerHighestParagraphClass()
 
 const SfxClassificationPolicyType eHighestClassType = 
SfxClassificationHelper::stringToPolicyType(sHighestClass);
 
+// Prevent paragraph signature validation since the below changes (f.e. 
watermarking) are benign.
+const bool bOldValidationFlag = SetParagraphSignatureValidation(false);
+comphelper::ScopeGuard const g([this, bOldValidationFlag]() {
+SetParagraphSignatureValidation(bOldValidationFlag);
+});
+
 // Check the origin, if "manual" (created via advanced classification 
dialog),
 // then we just need to set the category name.
 if (sfx::getCreationOriginProperty(xPropertyContainer, aKeyCreator) == 
sfx::ClassificationCreationOrigin::MANUAL)
___
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.2' - sw/source

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/doc/rdfhelper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d50f6eb167a1b3c74dbe6e66b10ec906c2d1e351
Author: Ashod Nakashian 
AuthorDate: Wed Oct 3 05:47:49 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 04:35:19 2019 +0100

sw: paragraph-sign: skip invalid graph names

Change-Id: Iaff61723497466521eddb2333656981f976d3fa6
Reviewed-on: https://gerrit.libreoffice.org/63006
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit ffc9efb5c770a674c781bfedb3b91e912b6d0136)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85807
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/doc/rdfhelper.cxx b/sw/source/core/doc/rdfhelper.cxx
index d1fb7d4dbf4f..ff77293639cc 100644
--- a/sw/source/core/doc/rdfhelper.cxx
+++ b/sw/source/core/doc/rdfhelper.cxx
@@ -73,6 +73,9 @@ SwRDFHelper::getStatements(const 
css::uno::Reference& xModel
 for (const uno::Reference& xGraphName : rGraphNames)
 {
 uno::Reference xGraph = xRepo->getGraph(xGraphName);
+if (!xGraph.is())
+continue;
+
 uno::Reference xStatements = 
xGraph->getStatements(
 xSubject, uno::Reference(), 
uno::Reference());
 while (xStatements->hasMoreElements())
___
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.2' - sw/source

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/edit/edfcol.cxx |   41 +++--
 1 file changed, 23 insertions(+), 18 deletions(-)

New commits:
commit 7a3d0af89a302bd074cc21b4f25402922670bbd3
Author: Ashod Nakashian 
AuthorDate: Tue Oct 2 06:02:39 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 04:34:37 2019 +0100

sw: paragraph-sign: formatting

Change-Id: I9bf1b58aa6e18202a5f7eba010cc5b914e1d33d4
Reviewed-on: https://gerrit.libreoffice.org/63005
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit 89c351a2610cc24720f391cf933f8af170de03ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85806
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index ccc5028eb311..8068e618ffcf 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -360,14 +360,16 @@ SignatureDescr lcl_getSignatureDescr(const 
uno::Reference& xModel
 SignatureDescr aDescr;
 aDescr.msId = sFieldId;
 
+const OUString prefix = ParagraphSignatureRDFNamespace + sFieldId;
 const std::map aStatements = 
lcl_getRDFStatements(xModel, xParagraph);
-const auto itSig = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureDigestRDFName);
+
+const auto itSig = aStatements.find(prefix + 
ParagraphSignatureDigestRDFName);
 aDescr.msSignature = (itSig != aStatements.end() ? itSig->second : 
OUString());
 
-const auto itDate = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureDateRDFName);
+const auto itDate = aStatements.find(prefix + 
ParagraphSignatureDateRDFName);
 aDescr.msDate = (itDate != aStatements.end() ? itDate->second : 
OUString());
 
-const auto itUsage = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureUsageRDFName);
+const auto itUsage = aStatements.find(prefix + 
ParagraphSignatureUsageRDFName);
 aDescr.msUsage = (itUsage != aStatements.end() ? itUsage->second : 
OUString());
 
 return aDescr;
@@ -377,14 +379,16 @@ SignatureDescr lcl_getSignatureDescr(const 
uno::Reference& xModel
  const 
uno::Reference& xParagraph,
  const 
uno::Reference& xField)
 {
-const std::pair pair = lcl_getRDF(xModel, xField, 
ParagraphSignatureIdRDFName);
-return (!pair.second.isEmpty() ? lcl_getSignatureDescr(xModel, xParagraph, 
pair.second) : SignatureDescr());
+const OUString sFieldId = lcl_getRDF(xModel, xField, 
ParagraphSignatureIdRDFName).second;
+if (!sFieldId.isEmpty())
+return lcl_getSignatureDescr(xModel, xParagraph, sFieldId);
+
+return SignatureDescr();
 }
 
 /// Validate and create the signature field display text from the fields.
-std::pair
-lcl_MakeParagraphSignatureFieldText(const SignatureDescr& aDescr,
-const OString& utf8Text)
+std::pair lcl_MakeParagraphSignatureFieldText(const 
SignatureDescr& aDescr,
+  const OString& 
utf8Text)
 {
 OUString msg = SwResId(STR_INVALID_SIGNATURE);
 bool valid = false;
@@ -400,7 +404,8 @@ lcl_MakeParagraphSignatureFieldText(const SignatureDescr& 
aDescr,
 const std::vector 
sig(svl::crypto::DecodeHexString(encSignature));
 SignatureInformation aInfo(0);
 valid = svl::crypto::Signing::Verify(data, false, sig, aInfo);
-valid = valid && aInfo.nStatus == 
css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
+valid = valid
+&& aInfo.nStatus == 
xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
 
 msg = SwResId(STR_SIGNED_BY) + ": " + aInfo.ouSubject + ", ";
 msg += aDescr.msDate;
@@ -412,7 +417,6 @@ lcl_MakeParagraphSignatureFieldText(const SignatureDescr& 
aDescr,
 return std::make_pair(valid, msg);
 }
 
-
 /// Validate and return validation result and signature field display text.
 std::pair
 lcl_MakeParagraphSignatureFieldText(const uno::Reference& 
xModel,
@@ -428,11 +432,10 @@ lcl_MakeParagraphSignatureFieldText(const 
uno::Reference& xModel,
 OUString lcl_getNextSignatureId(const uno::Reference& xModel,
 const uno::Reference& 
xParagraph)
 {
-const std::pair pair = lcl_getRDF(xModel, xParagraph, 
ParagraphSignatureLastIdRDFName);
-return OUString::number(!pair.second.isEmpty() ? pair.second.toInt32() + 1 
: 1);
+const OUString sFieldId = lcl_getRDF(xModel, xParagraph, 
ParagraphSignatureLastIdRDFName).second;
+return OUString::number(!sFieldId.isEmpty() ? sFieldId.toInt32() + 1 : 1);
 }
 
-
 /// Creates and inserts Paragraph Signature Metadata field and creates the RDF 
entry
 uno::Reference lcl_InsertParagraphSignature(const 
uno::Reference& xModel,
   const 

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

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/edit/edfcol.cxx |   58 +
 1 file changed, 31 insertions(+), 27 deletions(-)

New commits:
commit cdc3145021bf873f07105d2daef35c9feb446477
Author: Ashod Nakashian 
AuthorDate: Mon Oct 1 07:56:14 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 04:33:53 2019 +0100

sw: paragraph-sign: get graph-names only once

And reduce other overheads to make the paragraph
signature validation significantly faster.

Change-Id: I631bd0f15200bb8f0b85b40c0d4819a7bc4d562e
Reviewed-on: https://gerrit.libreoffice.org/63003
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit 9ae364330ddbc7cec836d42221ebc9f7b4c40240)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85804
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 3febab36678d..bfbb4fa62f1c 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -544,6 +544,7 @@ uno::Reference 
lcl_FindParagraphClassificationField(const uno:
 if (!xTextPortionEnumerationAccess.is())
 return xTextField;
 
+// Enumerate text portions to find metadata fields. This is expensive, 
best to enumerate fields only.
 uno::Reference xTextPortions = 
xTextPortionEnumerationAccess->createEnumeration();
 while (xTextPortions->hasMoreElements())
 {
@@ -561,7 +562,6 @@ uno::Reference 
lcl_FindParagraphClassificationField(const uno:
 uno::Reference xField(xServiceInfo, uno::UNO_QUERY);
 if (lcl_IsParagraphClassificationField(xModel, xField, sKey))
 {
-uno::Reference xText(xField, 
uno::UNO_QUERY);
 xTextField = xField;
 break;
 }
@@ -1157,10 +1157,6 @@ static void lcl_ApplyParagraphClassification(SwDoc* pDoc,
 if (!xNodeSubject.is())
 return;
 
-uno::Reference xMultiServiceFactory(xModel, 
uno::UNO_QUERY);
-
-sfx::ClassificationKeyCreator 
aKeyCreator(SfxClassificationHelper::getPolicyType());
-
 // Remove all paragraph classification fields.
 for (;;)
 {
@@ -1183,13 +1179,14 @@ static void lcl_ApplyParagraphClassification(SwDoc* 
pDoc,
 { return rResult.meType == 
svx::ClassificationType::PARAGRAPH; }),
   aResults.end());
 
+sfx::ClassificationKeyCreator 
aKeyCreator(SfxClassificationHelper::getPolicyType());
 std::vector aFieldNames;
 for (size_t nIndex = 0; nIndex < aResults.size(); ++nIndex)
 {
 const svx::ClassificationResult& rResult = aResults[nIndex];
 
 const bool isLast = nIndex == 0;
-const bool isFirst = nIndex == aResults.size() - 1;
+const bool isFirst = (nIndex == aResults.size() - 1);
 OUString sKey;
 OUString sValue = rResult.msName;
 switch (rResult.meType)
@@ -1916,19 +1913,23 @@ void SwEditShell::RestoreMetadataFields()
 uno::Reference xParagraphs = 
xParagraphEnumerationAccess->createEnumeration();
 if (!xParagraphs.is())
 return;
+
+static const OUString sBlank("");
+const sfx::ClassificationKeyCreator 
aKeyCreator(SfxClassificationHelper::getPolicyType());
+const css::uno::Sequence> aGraphNames = 
SwRDFHelper::getGraphNames(xModel, MetaNS);
+
 while (xParagraphs->hasMoreElements())
 {
 uno::Reference 
xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
 
-std::map aSignatures;
-std::vector aResults;
-
 try
 {
-const sfx::ClassificationKeyCreator 
aKeyCreator(SfxClassificationHelper::getPolicyType());
-const OUString sBlank("");
+const css::uno::Reference 
xSubject(xParagraph, uno::UNO_QUERY);
+const std::map aStatements = 
SwRDFHelper::getStatements(xModel, aGraphNames, xSubject);
 
-const OUString sFieldNames = lcl_getRDF(xModel, xParagraph, 
ParagraphClassificationFieldNamesRDFName).second;
+const auto it = 
aStatements.find(ParagraphClassificationFieldNamesRDFName);
+const OUString sFieldNames = (it != aStatements.end() ? it->second 
: sBlank);
+std::vector aResults;
 if (!sFieldNames.isEmpty())
 {
 // Order the fields
@@ -1938,9 +1939,10 @@ void SwEditShell::RestoreMetadataFields()
 const OUString sCurFieldName = sFieldNames.getToken(0, 
'/', nIndex);
 if (sCurFieldName.isEmpty())
 break;
-std::pair fieldNameValue = 
lcl_getRDF(xModel, xParagraph, sCurFieldName);
-const OUString sName = fieldNameValue.first;
-const OUString sValue = fieldNameValue.second;
+
+const auto it2 = aStatements.find(sCurFieldName);
+const OUString sName = (it2 != aStatements.end() ? 
it->first : sBlank);
+

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

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/txtnode/ndtxt.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 6ffcbd6e8e07989af0dac07e2e43dfd96693dd7a
Author: Ashod Nakashian 
AuthorDate: Fri Sep 28 06:27:09 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 03:37:40 2019 +0100

sw: paragraph-sign: erase metafields from copied text correctly

This is relevant for paragraph signatures where the
metadata is not yet copied and so we exclude it.
The issue was that in some cases we didn't use
the proper range of text and an assertion was
triggered in debug builds.

Otherwise there should be no change of behavior
in release builds with this patch.

Change-Id: I90bc2ca56d586b96d39f34c68de53d3dac6099d7
Reviewed-on: https://gerrit.libreoffice.org/63000
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit 15701ab315a9d4cfc9ab0b05eae11a61b008eddc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85800
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 3904e11699e6..619e99efa1b5 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2017,7 +2017,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 {
 CHECK_SWPHINTS_IF_FRM(this);
 CHECK_SWPHINTS(pDest);
-sal_Int32 nTextStartIdx = rStart.GetIndex();
+const sal_Int32 nTextStartIdx = rStart.GetIndex();
 sal_Int32 nDestStart = rDestStart.GetIndex();  // remember old Pos
 
 if (pDest->GetDoc()->IsClipBoard() && GetNum())
@@ -2108,7 +2108,6 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 
 // Fetch end only now, because copying into self updates the start index
 // and all attributes
-nTextStartIdx = rStart.GetIndex();
 const sal_Int32 nEnd = nTextStartIdx + nLen;
 
 // 2. copy attributes
@@ -2256,8 +2255,10 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 std::reverse(metaFieldRanges.begin(), metaFieldRanges.end());
 for (const auto& pair : metaFieldRanges)
 {
-const SwIndex aIdx(pDest, pair.first);
-pDest->EraseText(aIdx, pair.second - pair.first);
+const SwIndex aIdx(pDest, std::max(pair.first - 
nTextStartIdx, 0));
+const sal_Int32 nCount = pair.second - pair.first;
+if (nCount > 0)
+pDest->EraseText(aIdx, nCount);
 }
 }
 
___
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.2' - sw/source

2019-12-25 Thread Ashod Nakashian (via logerrit)
 sw/source/core/doc/DocumentTimerManager.cxx |   34 +++-
 sw/source/core/inc/DocumentTimerManager.hxx |7 +
 2 files changed, 35 insertions(+), 6 deletions(-)

New commits:
commit c058e9518cdc4531737a47148fe49e4044d73d74
Author: Ashod Nakashian 
AuthorDate: Sat Oct 20 14:16:08 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Dec 26 03:36:54 2019 +0100

sw lok: delay processing idle jobs to let LOK finish initialization

When loading document, LOK needs to setup the client view, register
callbacks, get document size and type, etc. All of these need
to take SolarMutex, which is taken by the idle jobs immediately
after loading, blocking LOK from finishing initialization
and rendering the first tiles for the user. This gives the
user the impression that the document is loading for far
longer than it actually is, due to lack of interactivity
(or indeed any activity on the screen besides the spinning wheel).

By delaying the idle jobs, we allow time for LOK to finish
initialization and render the first tiles before the idle
jobs kick in and hog SolarMutex.

Reviewed-on: https://gerrit.libreoffice.org/56572
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 1056640a6e1fd044cb61f5bf5ee85dfec3cbeb7c)

Reviewed-on: https://gerrit.libreoffice.org/58157
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit e5225f152c3128efa73cb602d7a524f2cb436189)

Change-Id: Ic6f437bfd6f43dfed2aaa1a9d3510d43f5ec30ae
Reviewed-on: https://gerrit.libreoffice.org/64013
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
(cherry picked from commit 349748e63c698076bb44f75da9eaa104489e959c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85798
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/doc/DocumentTimerManager.cxx 
b/sw/source/core/doc/DocumentTimerManager.cxx
index 5d8c425dfd46..d290e70942b8 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -34,22 +34,38 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace sw
 {
-
-DocumentTimerManager::DocumentTimerManager( SwDoc& i_rSwdoc ) : m_rDoc( 
i_rSwdoc ),
-
m_nIdleBlockCount( 0 ),
-
m_bStartOnUnblock( false ),
-m_aDocIdle( 
i_rSwdoc )
+DocumentTimerManager::DocumentTimerManager(SwDoc& i_rSwdoc)
+: m_rDoc(i_rSwdoc)
+, m_nIdleBlockCount(0)
+, m_bStartOnUnblock(false)
+, m_aDocIdle(i_rSwdoc)
+, m_aFireIdleJobsTimer("sw::DocumentTimerManager m_aFireIdleJobsTimer")
+, m_bWaitForLokInit(true)
 {
 m_aDocIdle.SetPriority(TaskPriority::LOWEST);
-m_aDocIdle.SetInvokeHandler(LINK( this, DocumentTimerManager, DoIdleJobs));
+m_aDocIdle.SetInvokeHandler(LINK(this, DocumentTimerManager, DoIdleJobs));
 m_aDocIdle.SetDebugName("sw::DocumentTimerManager m_aDocIdle");
+
+m_aFireIdleJobsTimer.SetInvokeHandler(LINK(this, DocumentTimerManager, 
FireIdleJobsTimeout));
+m_aFireIdleJobsTimer.SetTimeout(1000); // Enough time for LOK to render 
the first tiles.
 }
 
 void DocumentTimerManager::StartIdling()
 {
+if (m_bWaitForLokInit && comphelper::LibreOfficeKit::isActive())
+{
+// Start the idle jobs only after a certain delay.
+m_bWaitForLokInit = false;
+StopIdling();
+m_aFireIdleJobsTimer.Start();
+return;
+}
+
+m_bWaitForLokInit = false;
 m_bStartOnUnblock = true;
 if (0 == m_nIdleBlockCount)
 {
@@ -86,6 +102,12 @@ void DocumentTimerManager::UnblockIdling()
 }
 }
 
+IMPL_LINK(DocumentTimerManager, FireIdleJobsTimeout, Timer*, , void)
+{
+// Now we can run the idle jobs, assuming we finished LOK initialization.
+StartIdling();
+}
+
 DocumentTimerManager::IdleJob DocumentTimerManager::GetNextIdleJob() const
 {
 SwRootFrame* pTmpRoot = 
m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout();
diff --git a/sw/source/core/inc/DocumentTimerManager.hxx 
b/sw/source/core/inc/DocumentTimerManager.hxx
index 2caaf608c40d..df0a5d2b1ce6 100644
--- a/sw/source/core/inc/DocumentTimerManager.hxx
+++ b/sw/source/core/inc/DocumentTimerManager.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -60,6 +61,10 @@ private:
 DocumentTimerManager(DocumentTimerManager const&) = delete;
 DocumentTimerManager& operator=(DocumentTimerManager const&) = delete;
 
+/// Delay starting idle jobs to allow for post-load activity.
+/// Used by LOK only.
+DECL_LINK( FireIdleJobsTimeout, Timer *, void );
+
 DECL_LINK( DoIdleJobs, Timer *, void );
 
 IdleJob GetNextIdleJob() const;
@@ -69,6 +74,8 @@ private:
 sal_uInt32 m_nIdleBlockCount; ///< Don't run the Idle, 

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

2019-12-21 Thread Muhammet Kara (via logerrit)
 sw/source/uibase/sidebar/PageOrientationControl.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 142df3a7baa0ada853787ead27f36e08e5947360
Author: Muhammet Kara 
AuthorDate: Fri Dec 20 20:35:00 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Dec 21 10:54:58 2019 +0100

tdf#129526: Prevent accidental toggling of page orientation

Change-Id: I3145cb34ec782c1aa60fe864a6ec7c195185ad18
Reviewed-on: https://gerrit.libreoffice.org/85626
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx 
b/sw/source/uibase/sidebar/PageOrientationControl.cxx
index aa810867aae9..3602e2b76411 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.cxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx
@@ -113,6 +113,14 @@ void PageOrientationControl::ExecuteOrientationChange( 
const bool bLandscape )
 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE,
 pItem);
 mpPageSizeItem.reset( static_cast(pItem->Clone()) );
 
+// Prevent accidental toggling of page orientation
+if ((mpPageSizeItem->GetWidth() > mpPageSizeItem->GetHeight()) == 
bLandscape)
+{
+if ( mxUndoManager.is() )
+mxUndoManager->leaveUndoContext();
+return;
+}
+
 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE,
 pItem);
 mpPageLRMarginItem.reset( static_cast(pItem->Clone()) 
);
 
___
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.2' - sw/source

2019-12-18 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit a6177673663726039f8e0f51633284c48de31e76
Author: Miklos Vajna 
AuthorDate: Wed Dec 18 22:34:06 2019 +0100
Commit: Michael Meeks 
CommitDate: Wed Dec 18 23:19:49 2019 +0100

sw lok: disable Edit Contour button in image sidebar

This can be enabled when the underlying dialog is OK under LOK.

Change-Id: Id74d20de55e77842d707e345b2193ca9113594e8
Reviewed-on: https://gerrit.libreoffice.org/85436
Reviewed-by: Miklos Vajna 
Tested-by: Michael Meeks 

diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx 
b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
index c51d4f7844a1..0cf00345c777 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 const char UNO_WRAPOFF[] = ".uno:WrapOff";
 const char UNO_WRAPLEFT[] = ".uno:WrapLeft";
@@ -148,6 +149,13 @@ void WrapPropertyPanel::Initialize()
 
 Link EditContourLink = LINK(this, WrapPropertyPanel, 
EditContourHdl);
 mpEditContour->SetClickHdl(EditContourLink);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// Disable Edit Contour button for LOK purposes.
+mpEditContour->Hide();
+}
+
 Link EnableContourLink = LINK(this,WrapPropertyPanel, 
EnableContourHdl);
 mpEnableContour->SetClickHdl(EnableContourLink);
 mpSpacingLB->SetSelectHdl(LINK(this, WrapPropertyPanel, SpacingLBHdl));
___
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.2' - sw/source

2019-12-18 Thread Muhammet Kara (via logerrit)
 sw/source/core/crsr/viscrs.cxx |   44 +++--
 1 file changed, 38 insertions(+), 6 deletions(-)

New commits:
commit 026337091f628996d7bedfb2e7f3cddc0f24cc94
Author: Muhammet Kara 
AuthorDate: Wed Dec 18 02:11:23 2019 +0300
Commit: Muhammet Kara 
CommitDate: Wed Dec 18 13:27:14 2019 +0100

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

Repro: Select text in Online, and Ctrl + K to open Hyperlink dialog,
then assign a hyperlink and close with Ok. Without removing/changing
the selection, re-open the hyperlink dialog again by Ctrl + K. You see
that the hyperlink is not recognized.

Why?
The dialog relies on the hyperlinkUnderCursor property which is
set by the SfxLokHelper::notifyVisCursorInvalidation() method, which
also relies on the current char cursor is on. So when you select a 
hyperlinked
text from left to right (in English), the final position of the cursor is 
outside
the hyperlinked text, thus the hyperlinkUnderCursor property is unset.

Solution
Check for presence of selection and hyperlink via SfxItemPool and
proceed accordingly

Change-Id: I3a7f18c8199cec243ac99f011d9aaee7c7c575b8
Reviewed-on: https://gerrit.libreoffice.org/85348
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index a1c1555858aa..62f7f033da63 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // Here static members are defined. They will get changed on alteration of the
 // MapMode. This is done so that on ShowCursor the same size does not have to 
be
@@ -110,6 +111,23 @@ void SwVisibleCursor::Hide()
 }
 }
 
+namespace
+{
+
+// Build JSON message to be sent to Online
+OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink)
+{
+boost::property_tree::ptree aTree;
+aTree.put("text", sText);
+aTree.put("link", sLink);
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree, false);
+
+return OString(aStream.str().c_str()).trim();
+}
+
+}
+
 void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
 {
 SwRect aRect;
@@ -243,15 +261,29 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * 
pViewShell)
 
 OString sHyperlink;
 SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr);
+bool bIsSelection = 
const_cast(m_pCursorShell)->IsSelection();
+
 if 
(const_cast(m_pCursorShell)->GetContentAtPos(aRect.Pos(), 
aContentAtPos))
 {
 const SwFormatINetFormat* pItem = static_cast(aContentAtPos.aFnd.pAttr);
-boost::property_tree::ptree aTree;
-aTree.put("text", aContentAtPos.sStr);
-aTree.put("link", pItem->GetValue());
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree, false);
-sHyperlink = OString(aStream.str().c_str()).trim();
+sHyperlink = buildHyperlinkJSON(aContentAtPos.sStr, 
pItem->GetValue());
+}
+else if (bIsSelection)
+{
+SwWrtShell* pShell = 
m_pCursorShell->GetDoc()->GetDocShell()->GetWrtShell();
+
+if (pShell)
+{
+SfxItemSet aSet(m_pCursorShell->GetSfxViewShell()->GetPool(),
+svl::Items{});
+pShell->GetCurAttr(aSet);
+if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT 
))
+{
+sHyperlink = 
buildHyperlinkJSON(const_cast(m_pCursorShell)->GetSelText(),
+
aSet.GetItem(RES_TXTATR_INETFMT)->GetValue());
+}
+}
 }
 
 if (pViewShell)
___
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.2' - sw/source

2019-12-13 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/docvw/FloatingTableButton.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit d170b73a6d75545ccb45ca58808573d03a1b0bec
Author: Mike Kaganski 
AuthorDate: Wed Dec 4 20:26:49 2019 +0300
Commit: Aron Budea 
CommitDate: Sat Dec 14 02:58:58 2019 +0100

tdf#129176: clear "TablePosition" grab bag when unfloating table

The operation explicitly changes the table to be not floating; this will
change its position; yet when saving back to DOCX, saved values from the
grab bag were used, incorrectly restoring table floating state.

Change-Id: I19c185849443dc1a8b5ac974e09349c206b0506b
Reviewed-on: https://gerrit.libreoffice.org/84446
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/84679
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sw/source/uibase/docvw/FloatingTableButton.cxx 
b/sw/source/uibase/docvw/FloatingTableButton.cxx
index e35c0de5f951..c18b6d485b52 100644
--- a/sw/source/uibase/docvw/FloatingTableButton.cxx
+++ b/sw/source/uibase/docvw/FloatingTableButton.cxx
@@ -24,6 +24,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -35,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define TEXT_PADDING 3
 #define BOX_DISTANCE 3
@@ -108,6 +111,25 @@ void FloatingTableButton::MouseButtonDown(const 
MouseEvent& /*rMEvt*/)
 
 SwDoc& rDoc = *pTextFrame->GetTextNodeFirst()->GetDoc();
 
+// tdf#129176: clear "TablePosition" grab bag, since we explicitly change 
the position here
+// See DomainMapperTableHandler::endTableGetTableStyle, where the grab bag 
is filled, and
+// DocxAttributeOutput::TableDefinition that uses it on export
+SwFrameFormat* pTableFormat = pTableFrame->GetTable()->GetFrameFormat();
+assert(pTableFormat);
+if (const SfxGrabBagItem* pGrabBagItem = 
pTableFormat->GetAttrSet().GetItem(RES_FRMATR_GRABBAG))
+{
+SfxGrabBagItem aGrabBagItem(*pGrabBagItem); // Editable copy
+if (aGrabBagItem.GetGrabBag().erase("TablePosition"))
+{
+css::uno::Any aVal;
+aGrabBagItem.QueryValue(aVal);
+const auto xTable = SwXTextTable::CreateXTextTable(pTableFormat);
+const css::uno::Reference xSet(xTable, 
css::uno::UNO_QUERY);
+assert(xSet);
+xSet->setPropertyValue(UNO_NAME_TABLE_INTEROP_GRAB_BAG, aVal);
+}
+}
+
 // When we move the table before the first text node, we need to clear 
RES_PAGEDESC attribute
 // of the text node otherwise LO will create a page break after the table
 if (pTextFrame->GetTextNodeFirst())
___
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.2' - sw/source

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

New commits:
commit a3dcf498040111cf6f3fb96822c175d80f26d822
Author: Tor Lillqvist 
AuthorDate: Thu Dec 5 00:28:41 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Dec 10 05:15:41 2019 +0100

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

diff --git a/sw/source/uibase/misc/swruler.cxx 
b/sw/source/uibase/misc/swruler.cxx
index ae3f35a8f2c8..76682e5468e9 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -276,14 +276,17 @@ const 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.2' - sw/source

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

New commits:
commit 20c02c0f54618deb6b8c9af640f1e05e6a1168a2
Author: Tor Lillqvist 
AuthorDate: Wed Dec 4 16:19:24 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Dec 10 05:15:09 2019 +0100

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

diff --git a/sw/source/uibase/misc/swruler.cxx 
b/sw/source/uibase/misc/swruler.cxx
index 7dd10518dc34..ae3f35a8f2c8 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -278,6 +278,18 @@ const 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.2' - sw/source

2019-12-09 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/misc/swruler.cxx |   20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 2f7653ea487fbf21891ef733ee72d85e0673009b
Author: Tor Lillqvist 
AuthorDate: Wed Dec 4 15:00:15 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Dec 9 17:34:40 2019 +0100

Add comment about confusion in SwCommentRuler::CreateJsonNotification()

No code changes.

Change-Id: Ibc46b3e55038e84f2ad80ff12b277b2e2c77a4ce
(cherry picked from commit 5b6d23dcd0f2f779b4bbffe7f427a7c397f41c95)
Reviewed-on: https://gerrit.libreoffice.org/84755
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/uibase/misc/swruler.cxx 
b/sw/source/uibase/misc/swruler.cxx
index 86667e6b02d7..7dd10518dc34 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -254,10 +254,28 @@ const std::string SwCommentRuler::CreateJsonNotification()
 {
 boost::property_tree::ptree jsonNotif;
 
+// Note that GetMargin1(), GetMargin2(), GetNullOffset(), and 
GetPageOffset() return values in
+// pixels. Not twips. So "converting" the returned values with 
convertTwipToMm100() is quite
+// wrong. (Also, even if the return values actually were in twips, it is 
questionable why we
+// would want to pass them in mm100, as all other length values in the 
LOKit protocol apparently
+// are in twips.)
+
+// Anyway, as the consuming code in Online mostly seems to work anyway, it 
is likely that it
+// would work as well even if the values in pixels were passed without a 
bogus "conversion" to
+// mm100. But let's keep this as is for now.
+
+// Also note that in desktop LibreOffice, these pixel values for the rules 
of course change as
+// one changes the zoom level. (Can be seen if one temporarily modifies 
the NotifyKit() function
+// below to call this CreateJsonNotification() function and print its 
result in all cases even
+// without LibreOfficeKit::isActive().) But in both web-based Online and 
in the iOS app, the
+// zoom level from the point of view of this code here apparently does not 
change even if one
+// zooms from the Online code's point of view.
 jsonNotif.put("margin1", convertTwipToMm100(GetMargin1()));
 jsonNotif.put("margin2", convertTwipToMm100(GetMargin2()));
 jsonNotif.put("leftOffset", convertTwipToMm100(GetNullOffset()));
 jsonNotif.put("pageOffset", convertTwipToMm100(GetPageOffset()));
+
+// GetPageWidth() on the other hand does return a value in twips.
 jsonNotif.put("pageWidth", convertTwipToMm100(GetPageWidth()));
 
 RulerUnitData aUnitData = GetCurrentRulerUnit();
___
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.2' - sw/source

2019-12-02 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/shells/textsh1.cxx  |   45 ---
 sw/source/uibase/uiview/viewling.cxx |3 +-
 2 files changed, 3 insertions(+), 45 deletions(-)

New commits:
commit bae671f4cafde408ea7dd7d4b621365b0e5e924c
Author: Tamás Zolnai 
AuthorDate: Fri Nov 29 18:19:58 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Dec 2 18:17:58 2019 +0100

SpellingPopup: lok: keep the selection to make context menu work.

Change-Id: Ida46a1140c889d1864b423eb9c5512d99a028fce
Reviewed-on: https://gerrit.libreoffice.org/84155
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 
(cherry picked from commit addb177559778d771f0eec92ae173552d8e1a1e5)
Reviewed-on: https://gerrit.libreoffice.org/84238
Tested-by: Tamás Zolnai 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 7e071c41adcf..d69e47c6ebd9 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1425,37 +1425,6 @@ void SwTextShell::Execute(SfxRequest )
 break;
 case SID_SPELLCHECK_IGNORE:
 {
-// If there is not selection, we need to create one, before ignoring
-if(!rWrtSh.HasSelection())
-{
-OUString sApplyText;
-const SfxStringItem* pItem2 = 
rReq.GetArg(FN_PARAM_1);
-if (pItem2)
-sApplyText = pItem2->GetValue();
-
-const OUString sGrammarType("Grammar");
-const OUString sSpellingType("Spelling");
-
-if (sApplyText == sGrammarType)
-{
-linguistic2::ProofreadingResult aGrammarCheckRes;
-sal_Int32 nErrorInResult = -1;
-uno::Sequence< OUString > aSuggestions;
-sal_Int32 nErrorPosInText = -1;
-SwRect aToFill;
-bool bCorrectionRes = rWrtSh.GetGrammarCorrection( 
aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, 
aToFill );
-if (!bCorrectionRes)
-return;
-}
-else if (sApplyText == sSpellingType)
-{
-SwRect aToFill;
-uno::Reference< linguistic2::XSpellAlternatives >  xSpellAlt( 
rWrtSh.GetCorrection(nullptr, aToFill) );
-if (!xSpellAlt.is())
-return;
-}
-}
-
 SwPaM *pPaM = rWrtSh.GetCursor();
 if (pPaM)
 SwEditShell::IgnoreGrammarErrorAt( *pPaM );
@@ -1530,19 +1499,7 @@ void SwTextShell::Execute(SfxRequest )
 if(-1 != (nPos = sApplyText.indexOf( sGrammarRule )))
 {
 sApplyText = sApplyText.replaceAt(nPos, sGrammarRule.getLength(), 
"");
-if(rWrtSh.HasSelection())
-{
-bGrammar = true;
-}
-else
-{
-linguistic2::ProofreadingResult aGrammarCheckRes;
-sal_Int32 nErrorInResult = -1;
-uno::Sequence< OUString > aSuggestions;
-sal_Int32 nErrorPosInText = -1;
-SwRect aToFill;
-bGrammar = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, 
nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
-}
+bGrammar = true;
 }
 else if (-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
 {
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index c954dce5bbd8..d77faa042104 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -787,7 +787,8 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 }
 }
 
-m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
+if (!comphelper::LibreOfficeKit::isActive())
+m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
 m_pWrtShell->LockView( bOldViewLock );
 }
 }
___
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.2' - sw/source

2019-11-27 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |   87 +---
 1 file changed, 42 insertions(+), 45 deletions(-)

New commits:
commit 596164f9a68cce74c106ad79cde3a5b5ad550800
Author: Tamás Zolnai 
AuthorDate: Tue Nov 26 16:34:20 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Nov 27 13:06:37 2019 +0100

SpellingPopup: Fix Ignore All execution.

Change-Id: I13520c1f14530cc1f04290d4d0b204cc45b124eb
Reviewed-on: https://gerrit.libreoffice.org/83786
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 
(cherry picked from commit 11395405d08ecb44a555fd26d0e16993cb5e13f6)
Reviewed-on: https://gerrit.libreoffice.org/83891
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index cb92a7312e93..7e071c41adcf 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1463,58 +1463,55 @@ void SwTextShell::Execute(SfxRequest )
 break;
 case SID_SPELLCHECK_IGNORE_ALL:
 {
-if(!rWrtSh.HasSelection())
-{
-OUString sApplyText;
-const SfxStringItem* pItem2 = 
rReq.GetArg(FN_PARAM_1);
-if (pItem2)
-sApplyText = pItem2->GetValue();
+OUString sApplyText;
+const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_1);
+if (pItem2)
+sApplyText = pItem2->GetValue();
 
-const OUString sGrammarType("Grammar");
-const OUString sSpellingType("Spelling");
+const OUString sGrammarType("Grammar");
+const OUString sSpellingType("Spelling");
 
-if(sApplyText == sGrammarType)
-{
-linguistic2::ProofreadingResult aGrammarCheckRes;
-sal_Int32 nErrorInResult = -1;
-uno::Sequence< OUString > aSuggestions;
-sal_Int32 nErrorPosInText = -1;
-SwRect aToFill;
-bool bCorrectionRes = rWrtSh.GetGrammarCorrection( 
aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, 
aToFill );
-if(bCorrectionRes)
-{
-try {
-uno::Reference< linguistic2::XDictionary > xDictionary 
= LinguMgr::GetIgnoreAllList();
-aGrammarCheckRes.xProofreader->ignoreRule(
-aGrammarCheckRes.aErrors[ nErrorInResult 
].aRuleIdentifier,
-aGrammarCheckRes.aLocale );
-// refresh the layout of the actual paragraph (faster)
-SwPaM *pPaM = rWrtSh.GetCursor();
-if (pPaM)
-SwEditShell::IgnoreGrammarErrorAt( *pPaM );
-// refresh the layout of all paragraphs (workaround to 
launch a dictionary event)
-xDictionary->setActive(false);
-xDictionary->setActive(true);
-}
-catch( const uno::Exception& )
-{
-}
+if(sApplyText == sGrammarType)
+{
+linguistic2::ProofreadingResult aGrammarCheckRes;
+sal_Int32 nErrorInResult = -1;
+uno::Sequence< OUString > aSuggestions;
+sal_Int32 nErrorPosInText = -1;
+SwRect aToFill;
+bool bCorrectionRes = rWrtSh.GetGrammarCorrection( 
aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, 
aToFill );
+if(bCorrectionRes)
+{
+try {
+uno::Reference< linguistic2::XDictionary > xDictionary = 
LinguMgr::GetIgnoreAllList();
+aGrammarCheckRes.xProofreader->ignoreRule(
+aGrammarCheckRes.aErrors[ nErrorInResult 
].aRuleIdentifier,
+aGrammarCheckRes.aLocale );
+// refresh the layout of the actual paragraph (faster)
+SwPaM *pPaM = rWrtSh.GetCursor();
+if (pPaM)
+SwEditShell::IgnoreGrammarErrorAt( *pPaM );
+// refresh the layout of all paragraphs (workaround to 
launch a dictionary event)
+xDictionary->setActive(false);
+xDictionary->setActive(true);
 }
-}
-else if (sApplyText == sSpellingType)
-{
-SwRect aToFill;
-uno::Reference< linguistic2::XSpellAlternatives >  xSpellAlt( 
rWrtSh.GetCorrection(nullptr, aToFill) );
-uno::Reference< linguistic2::XDictionary > xDictionary = 
LinguMgr::GetIgnoreAllList();
-OUString sWord(xSpellAlt->getWord());
-linguistic::DictionaryError nAddRes = 
linguistic::AddEntryToDic( xDictionary,
-sWord, false, OUString() );
-if (linguistic::DictionaryError::NONE 

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

2019-11-21 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/drawdlg.cxx |   61 
 1 file changed, 61 insertions(+)

New commits:
commit 71be20fd28349a870780ced7c81fcf21fe30e70a
Author: Szymon Kłos 
AuthorDate: Thu Nov 21 11:03:11 2019 +0100
Commit: Szymon Kłos 
CommitDate: Thu Nov 21 12:04:32 2019 +0100

jsdialogs: send .uno:FillStyle updates

Change-Id: I31eab196466b380d1121dece59e9c19f8380fb9b
Reviewed-on: https://gerrit.libreoffice.org/83366
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/drawdlg.cxx 
b/sw/source/uibase/shells/drawdlg.cxx
index 6b4462f952f2..aa0218193456 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -38,6 +38,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+
+#include 
+
+using namespace com::sun::star::drawing;
 
 void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
 {
@@ -247,6 +254,56 @@ namespace
 pArgs->Put(aItem);
 }
 }
+
+OUString lcl_fillStyleEnumToString(FillStyle eStyle)
+{
+switch (eStyle)
+{
+case FillStyle_NONE:
+return "NONE";
+
+case FillStyle_SOLID:
+return "SOLID";
+
+case FillStyle_GRADIENT:
+return "GRADIENT";
+
+case FillStyle_HATCH:
+return "HATCH";
+
+case FillStyle_BITMAP:
+return "BITMAP";
+
+default:
+return "";
+}
+}
+
+void lcl_sendAttrUpdatesForLOK(SfxViewShell* pShell, const SfxItemSet& 
rSet)
+{
+if (!pShell)
+return;
+
+OUString sPayload;
+const SfxPoolItem* pItem = rSet.GetItem(SID_ATTR_FILL_STYLE);
+
+if (pItem)
+{
+const XFillStyleItem* pFillStyleItem = static_cast(pItem);
+FillStyle eStyle;
+css::uno::Any aAny;
+
+pFillStyleItem->QueryValue(aAny);
+aAny >>= eStyle;
+sPayload = ".uno:FillStyle=" + lcl_fillStyleEnumToString(eStyle);
+}
+
+if (!sPayload.isEmpty())
+{
+pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US).getStr());
+}
+}
 }
 
 void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
@@ -315,6 +372,10 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
 }
 else
 rSet.Put(pSdrView->GetDefaultAttr());
+
+SfxViewShell* pViewShell = GetShell().GetSfxViewShell();
+if (pViewShell && comphelper::LibreOfficeKit::isActive())
+lcl_sendAttrUpdatesForLOK( pViewShell, rSet );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
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.2' - sw/source

2019-11-19 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/frmdlg/frmmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a6517600b184ccd1ccc20e26127dc0094c872ef
Author: Miklos Vajna 
AuthorDate: Mon Nov 18 13:50:32 2019 +0100
Commit: Miklos Vajna 
CommitDate: Tue Nov 19 11:07:30 2019 +0100

sw: insert image: set anchor to at-char by default

This changes the default set in commit
4f40bf6a79de6d60da0a5090cdfeda6242e889f0 (sw: insert image: set anchor
to as-char by default, 2019-07-04), to have a better compromise, taking
both Word defaults compatibility and usability into account.

The problem is that users are used to just inserting an image and being
able to drag it to its final location, which is broken with as-char
anchoring.

So default to at-char anchoring, this is still something that is fully
interoperable to Word (unlike the old to-para anchoring), but allows the
easier image move again.

[ Testcase not backported, would depend on the original testcase from
the above commit. ]

(cherry picked from commit a7528cd6f17ea5c5b29e7d607e54c62de0d9e7db)

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

Change-Id: Ibc61ae167fc9e5cc31b04c83e854556309e27fd4
Reviewed-on: https://gerrit.libreoffice.org/83172
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx 
b/sw/source/uibase/frmdlg/frmmgr.cxx
index 627a5d4ffdd2..5d1282aec939 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -87,7 +87,7 @@ SwFlyFrameAttrMgr::SwFlyFrameAttrMgr( bool bNew, SwWrtShell* 
pSh, Frmmgr_Type nT
 
 if (nType == Frmmgr_Type::GRF || nType == Frmmgr_Type::OLE)
 {
-m_aSet.Put(SwFormatAnchor(RndStdIds::FLY_AS_CHAR));
+m_aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_CHAR));
 }
 }
 else if ( nType == Frmmgr_Type::NONE )
___
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.2' - sw/source

2019-11-14 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/drwtxtex.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit f652d0f8250e03a9fca70b145fb2b0efc36aee85
Author: Szymon Kłos 
AuthorDate: Thu Nov 14 11:16:04 2019 +0100
Commit: Szymon Kłos 
CommitDate: Thu Nov 14 21:36:10 2019 +0100

jsdialogs: fix CID 1455691 & CID 1455690

Change-Id: Idbb3e70c1a09be7dd7c43747250f3a6368251cd9
Reviewed-on: https://gerrit.libreoffice.org/82661
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index e1073389879c..82a6e19beb1f 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -605,16 +605,19 @@ void SwDrawTextShell::Execute( SfxRequest  )
 return;
 }
 
-std::unique_ptr pNewArgs = pNewAttrs->Clone();
-lcl_convertStringArguments(nSlot, pNewArgs);
-
-if(nEEWhich && pNewAttrs)
+std::unique_ptr pNewArgs = pNewAttrs ? pNewAttrs->Clone() : 
nullptr;
+if (pNewArgs)
 {
-std::unique_ptr 
pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich));
-pNewArgs->Put(*pNewItem);
-}
+lcl_convertStringArguments(nSlot, pNewArgs);
+
+if (nEEWhich)
+{
+std::unique_ptr 
pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich));
+pNewArgs->Put(*pNewItem);
+}
 
-SetAttrToMarked(*pNewArgs);
+SetAttrToMarked(*pNewArgs);
+}
 
 GetView().GetViewFrame()->GetBindings().InvalidateAll(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.2' - sw/source

2019-11-13 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/tabsh.cxx |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit ac8ad3057033a190b1eff729c7196e8aa5fc43fc
Author: Szymon Kłos 
AuthorDate: Tue Nov 12 17:17:36 2019 +0100
Commit: Szymon Kłos 
CommitDate: Wed Nov 13 09:50:51 2019 +0100

jsdialogs: send table row/column size updates

Change-Id: I1b41fe50e93dc14db60c7548a1ae0c54113da329
Reviewed-on: https://gerrit.libreoffice.org/82540
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 29c2e320d1d8..35f6a84d80fa 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -46,6 +46,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -1418,6 +1421,19 @@ void SwTableShell::GetState(SfxItemSet )
 long nHeight = pHeight->GetHeight();
 aRowHeight.SetValue(nHeight);
 rSet.Put(aRowHeight);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO: set correct unit
+MapUnit eTargetUnit = MapUnit::MapInch;
+OUString sHeight = GetMetricText(nHeight,
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sPayload = ".uno:TableRowHeight=" + sHeight;
+
+
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US).getStr());
+}
 }
 break;
 }
@@ -1429,6 +1445,20 @@ void SwTableShell::GetState(SfxItemSet )
 SwTwips nWidth = aFunc.GetColWidth(aFunc.GetCurColNum());
 aColumnWidth.SetValue(nWidth);
 rSet.Put(aColumnWidth);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO: set correct unit
+MapUnit eTargetUnit = MapUnit::MapInch;
+OUString sWidth = GetMetricText(nWidth,
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sPayload = ".uno:TableColumWidth=" + sWidth;
+
+
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US).getStr());
+}
+
 break;
 }
 }
___
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.2' - sw/source

2019-11-12 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/uiview/viewtab.cxx |   21 +
 1 file changed, 21 insertions(+)

New commits:
commit 891cd63392262dd7be27f30b0f31687c005a2703
Author: Szymon Kłos 
AuthorDate: Tue Nov 12 16:28:04 2019 +0100
Commit: Szymon Kłos 
CommitDate: Tue Nov 12 18:24:35 2019 +0100

jsdialogs: send .uno:ULSpacing updates

Change-Id: I061868a0cf9163624026dc1ff164af3d98923aa6
Reviewed-on: https://gerrit.libreoffice.org/82529
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index d978d6a7451b..96c322aa5d33 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -56,6 +56,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -1578,6 +1581,24 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 aUL.SetWhich( nWhich );
 rSet.Put( aUL );
 }
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO: set correct unit
+MapUnit eTargetUnit = MapUnit::MapInch;
+
+OUString sUpper = GetMetricText(aUL.GetUpper(),
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sLower = GetMetricText(aUL.GetLower(),
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sPayload = ".uno:ULSpacing={\"upper\": \"" + 
sUpper +
+"\", \"lower\": \"" + sLower + "\"}";
+
+
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US).getStr());
+}
 }
 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.2' - sw/source

2019-11-12 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/txtattr.cxx |   25 +
 1 file changed, 25 insertions(+)

New commits:
commit c6cf2bec7148e403e2ee9592b4410cc73bad8f46
Author: Szymon Kłos 
AuthorDate: Tue Nov 12 12:31:10 2019 +0100
Commit: Szymon Kłos 
CommitDate: Tue Nov 12 13:26:19 2019 +0100

jsdialogs: send .uno:LeftRightParaMargin updates

Change-Id: I22aef6ac57c94893bf2e73ea2901ed8bc074076e
Reviewed-on: https://gerrit.libreoffice.org/82501
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/txtattr.cxx 
b/sw/source/uibase/shells/txtattr.cxx
index d83db9144420..70ef0ba431f7 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -38,6 +38,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -722,6 +725,28 @@ void SwTextShell::GetAttrState(SfxItemSet )
 SvxLRSpaceItem aLR = aCoreSet.Get( RES_LR_SPACE );
 aLR.SetWhich(nSlot);
 rSet.Put(aLR);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO: set correct unit
+MapUnit eTargetUnit = MapUnit::MapInch;
+
+OUString sLeft = GetMetricText(aLR.GetLeft(),
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sRight = GetMetricText(aLR.GetRight(),
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sFirstline = 
GetMetricText(aLR.GetTextFirstLineOfst(),
+MapUnit::MapTwip, eTargetUnit, 
nullptr);
+
+OUString sPayload = 
".uno:LeftRightParaMargin={\"left\": \"" + sLeft +
+"\", \"right\": \"" + sRight +
+"\", \"firstline\": \"" + sFirstline + "\"}";
+
+
GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+OUStringToOString(sPayload, 
RTL_TEXTENCODING_ASCII_US).getStr());
+}
 }
 else
 rSet.InvalidateItem(nSlot);
___
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.2' - sw/source

2019-11-08 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/drwtxtex.cxx |   49 ---
 1 file changed, 46 insertions(+), 3 deletions(-)

New commits:
commit 9a1525f93dfce425a8416f83ca7361cb5783d36b
Author: Szymon Kłos 
AuthorDate: Fri Nov 8 17:13:05 2019 +0100
Commit: Szymon Kłos 
CommitDate: Fri Nov 8 17:55:06 2019 +0100

jsdialogs: apply .uno:Color and CharBackColor to floating text frames

Change-Id: I1a6b997f1a857524c7a48434321ca10d97f5e5db
Reviewed-on: https://gerrit.libreoffice.org/82311
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 7e0a8c0ead75..e1073389879c 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -92,12 +92,51 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
 
 using namespace ::com::sun::star;
 
+namespace
+{
+void lcl_convertStringArguments(sal_uInt16 nSlot, 
std::unique_ptr& pArgs)
+{
+Color aColor;
+OUString sColor;
+const SfxPoolItem* pItem = nullptr;
+
+if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, 
false, ))
+{
+sColor = static_cast(pItem)->GetValue();
+
+if (sColor == "transparent")
+aColor = COL_TRANSPARENT;
+else
+aColor = Color(sColor.toInt32(16));
+
+switch (nSlot)
+{
+case SID_ATTR_CHAR_COLOR:
+{
+SvxColorItem aColorItem(aColor, EE_CHAR_COLOR);
+pArgs->Put(aColorItem);
+break;
+}
+
+case SID_ATTR_CHAR_BACK_COLOR:
+{
+SvxBackgroundColorItem pBackgroundItem(aColor, 
EE_CHAR_BKGCOLOR);
+pArgs->Put(pBackgroundItem);
+break;
+}
+}
+}
+}
+}
+
 void SwDrawTextShell::Execute( SfxRequest  )
 {
 SwWrtShell  = GetShell();
@@ -565,13 +604,17 @@ void SwDrawTextShell::Execute( SfxRequest  )
 assert(false && "wrong dispatcher");
 return;
 }
+
+std::unique_ptr pNewArgs = pNewAttrs->Clone();
+lcl_convertStringArguments(nSlot, pNewArgs);
+
 if(nEEWhich && pNewAttrs)
 {
-std::unique_ptr 
pNewItem(pNewAttrs->Get(nWhich).CloneSetWhich(nEEWhich));
-aNewAttr.Put(*pNewItem);
+std::unique_ptr 
pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich));
+pNewArgs->Put(*pNewItem);
 }
 
-SetAttrToMarked(aNewAttr);
+SetAttrToMarked(*pNewArgs);
 
 GetView().GetViewFrame()->GetBindings().InvalidateAll(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.2' - sw/source

2019-11-04 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/sidebar/TableEditPanel.cxx |   29 
 sw/source/uibase/sidebar/TableEditPanel.hxx |   14 +
 2 files changed, 43 insertions(+)

New commits:
commit 2fdd4ee38a60d50ebba057ee5ba7f09b720a0ce4
Author: Tamás Zolnai 
AuthorDate: Thu Oct 31 17:11:13 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Nov 4 18:49:01 2019 +0100

Table panel: Make sure all toolbox buttons has the right initial state

For this we need to add a ControllerItem for all toolbox buttons.
See SfxStateCache::SetCachedState().

Change-Id: Id69a92fe5748617e3cd98c3007afbff2885a5d3b
Reviewed-on: https://gerrit.libreoffice.org/81899
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 47c88b2c4db23f33a4371139745b8427564d3667)
Reviewed-on: https://gerrit.libreoffice.org/82030
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx 
b/sw/source/uibase/sidebar/TableEditPanel.cxx
index c61292dd43ec..d252b4baa8eb 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -98,6 +99,20 @@ TableEditPanel::TableEditPanel(vcl::Window* pParent,
 , m_pBindings(pBindings)
 , m_aRowHeightController(SID_ATTR_TABLE_ROW_HEIGHT, *pBindings, *this)
 , m_aColumnWidthController(SID_ATTR_TABLE_COLUMN_WIDTH, *pBindings, *this)
+, m_aInsertRowsBeforeController(FN_TABLE_INSERT_ROW_BEFORE, *pBindings, 
*this)
+, m_aInsertRowsAfterController(FN_TABLE_INSERT_ROW_AFTER, *pBindings, 
*this)
+, m_aInsertColumnsBeforeController(FN_TABLE_INSERT_COL_BEFORE, *pBindings, 
*this)
+, m_aInsertColumnsAfterController(FN_TABLE_INSERT_COL_AFTER, *pBindings, 
*this)
+, m_aDeleteRowsController(FN_TABLE_DELETE_ROW, *pBindings, *this)
+, m_aDeleteColumnsController(FN_TABLE_DELETE_COL, *pBindings, *this)
+, m_aDeleteTableController(FN_TABLE_DELETE_TABLE, *pBindings, *this)
+, m_aSetMinimalRowHeightController(SID_TABLE_MINIMAL_ROW_HEIGHT, 
*pBindings, *this)
+, m_aSetOptimalRowHeightController(FN_TABLE_OPTIMAL_HEIGHT, *pBindings, 
*this)
+, m_aDistributeRowsController(FN_TABLE_BALANCE_ROWS, *pBindings, *this)
+, m_aSetMinimalColumnWidthController(SID_TABLE_MINIMAL_COLUMN_WIDTH, 
*pBindings, *this)
+, m_aSetOptimalColumnWidthController(FN_TABLE_ADJUST_CELLS, *pBindings, 
*this)
+, m_aDistributeColumnsController(FN_TABLE_BALANCE_CELLS, *pBindings, *this)
+, m_aMergeCellsController(FN_TABLE_MERGE_CELLS, *pBindings, *this)
 {
 get(m_pRowHeightEdit, "rowheight");
 get(m_pColumnWidthEdit, "columnwidth");
@@ -138,6 +153,20 @@ void TableEditPanel::dispose()
 m_pColumnWidthEdit.clear();
 m_aRowHeightController.dispose();
 m_aColumnWidthController.dispose();
+m_aInsertRowsBeforeController.dispose();
+m_aInsertRowsAfterController.dispose();
+m_aInsertColumnsBeforeController.dispose();
+m_aInsertColumnsAfterController.dispose();
+m_aDeleteRowsController.dispose();
+m_aDeleteColumnsController.dispose();
+m_aDeleteTableController.dispose();
+m_aSetMinimalRowHeightController.dispose();
+m_aSetOptimalRowHeightController.dispose();
+m_aDistributeRowsController.dispose();
+m_aSetMinimalColumnWidthController.dispose();
+m_aSetOptimalColumnWidthController.dispose();
+m_aDistributeColumnsController.dispose();
+m_aMergeCellsController.dispose();
 
 PanelLayout::dispose();
 }
diff --git a/sw/source/uibase/sidebar/TableEditPanel.hxx 
b/sw/source/uibase/sidebar/TableEditPanel.hxx
index 6d7a9c63f732..53380b44ebd5 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.hxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.hxx
@@ -48,6 +48,20 @@ private:
 VclPtr m_pColumnWidthEdit;
 ::sfx2::sidebar::ControllerItem m_aRowHeightController;
 ::sfx2::sidebar::ControllerItem m_aColumnWidthController;
+::sfx2::sidebar::ControllerItem m_aInsertRowsBeforeController;
+::sfx2::sidebar::ControllerItem m_aInsertRowsAfterController;
+::sfx2::sidebar::ControllerItem m_aInsertColumnsBeforeController;
+::sfx2::sidebar::ControllerItem m_aInsertColumnsAfterController;
+::sfx2::sidebar::ControllerItem m_aDeleteRowsController;
+::sfx2::sidebar::ControllerItem m_aDeleteColumnsController;
+::sfx2::sidebar::ControllerItem m_aDeleteTableController;
+::sfx2::sidebar::ControllerItem m_aSetMinimalRowHeightController;
+::sfx2::sidebar::ControllerItem m_aSetOptimalRowHeightController;
+::sfx2::sidebar::ControllerItem m_aDistributeRowsController;
+::sfx2::sidebar::ControllerItem m_aSetMinimalColumnWidthController;
+::sfx2::sidebar::ControllerItem m_aSetOptimalColumnWidthController;
+::sfx2::sidebar::ControllerItem m_aDistributeColumnsController;
+::sfx2::sidebar::ControllerItem m_aMergeCellsController;
 
 DECL_LINK(RowHeightMofiyHdl, Edit&, void);

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

2019-11-04 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/shells/tabsh.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 95d12a686065b41abe3840608d3bbfbf284fb7d8
Author: Tamás Zolnai 
AuthorDate: Wed Oct 30 14:17:37 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Mon Nov 4 18:31:52 2019 +0100

Table panel: Make sure Row Height spin button works with the default size 
type

SwFormatFrameSize() object has ATT_VAR_SIZE size type by default, before
we change it to anything else. We will change ATT_VAR_SIZE to ATT_MIN_SIZE
when changing the row height on the sidebar panel, similar to the
row height dialog.

Change-Id: I2520340e023b910549ff2a4b011e9ae3da2b7b11
Reviewed-on: https://gerrit.libreoffice.org/81897
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 
(cherry picked from commit baf205e91db4356e71002581e46b1bdcc1841319)
Reviewed-on: https://gerrit.libreoffice.org/82028
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 8a380d6d325c..29c2e320d1d8 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -1114,6 +1114,8 @@ void SwTableShell::Execute(SfxRequest )
 std::unique_ptr pHeight = 
rSh.GetRowHeight();
 if ( pHeight )
 {
+if (pHeight->GetHeightSizeType() == ATT_VAR_SIZE)
+pHeight->SetHeightSizeType(ATT_MIN_SIZE);
 pHeight->SetHeight(nNewHeight);
 rSh.SetRowHeight(*pHeight);
 }
___
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.2' - sw/source

2019-11-01 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a72e0556ec0c333125670b39cfd1f7671f827a62
Author: Szymon Kłos 
AuthorDate: Mon Oct 28 11:38:20 2019 +0100
Commit: Szymon Kłos 
CommitDate: Fri Nov 1 09:10:12 2019 +0100

jsdialogs: allow to use transparent highlight

Change-Id: Ib19dbbf3c13afd20bee47226704887f899c99b5d
Reviewed-on: https://gerrit.libreoffice.org/81597
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 586c00f7ba59b0c75ed2dd8ecf241a4d81c82331)
Reviewed-on: https://gerrit.libreoffice.org/81862
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 525b808fb2d0..b6bc638131f7 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1208,7 +1208,10 @@ void SwTextShell::Execute(SfxRequest )
 if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, 
false, ))
 {
 sColor = static_cast(pColorStringItem)->GetValue();
-aSet = Color(sColor.toInt32(16));
+if (sColor == "transparent")
+aSet = COL_TRANSPARENT;
+else
+aSet = Color(sColor.toInt32(16));
 }
 else if (pItem)
 aSet = static_cast(pItem)->GetValue();
___
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.2' - sw/source

2019-10-14 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0836ea3ea6d56cf91e4da8d65b2bf6fd4466febd
Author: Mike Kaganski 
AuthorDate: Mon Oct 14 17:42:27 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Oct 14 22:32:08 2019 +0200

tdf#128139: add missing nullptr check

Regression after ef2ec07b4113fdadf863352c832af657b5ae205c

Change-Id: I5eed95e8136a812813145283e6b533a808324380
Reviewed-on: https://gerrit.libreoffice.org/80782
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 8a69d0212fa7e3f7f8f2ccf29f9393b9414282a2)
Reviewed-on: https://gerrit.libreoffice.org/80795
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index ddf7c6a4902d..d48a5a4199c0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2660,7 +2660,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
 if (bNormalChar)
 {
 const bool bAutoTextShown
-= pACfg->IsAutoTextTip() && 
ShowAutoText(rSh.GetChunkForAutoText());
+= pACfg && pACfg->IsAutoTextTip() && 
ShowAutoText(rSh.GetChunkForAutoText());
 if (!bAutoTextShown && pACorr && 
pACorr->GetSwFlags().bAutoCompleteWords)
 ShowAutoCorrectQuickHelp(rSh.GetPrevAutoCorrWord(*pACorr), 
*pACorr);
 }
___
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.2' - sw/source

2019-10-08 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/dochdl/gloshdl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9b264707ec9da318da9344a139b810755020aa69
Author: Mike Kaganski 
AuthorDate: Tue Oct 8 05:08:36 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Oct 8 10:16:04 2019 +0200

tdf#126589: only consider text to the left of cursor as AutoText short name

Given a text "This is a dtfoo bar", and cursor inside "dtfoo" between "t"
and "f", invoking AutoText function (F3) currently considers the whole word
"dtfoo" as autotext short name. This changes it to only consider the part of
the word to the left of cursor, i.e. only "dt" in the example. This removes
the requirement to have a word boundary after the autotext short name.

Change-Id: I6ba28e63fe25664131b7e03dda39ae997dffa464
Reviewed-on: https://gerrit.libreoffice.org/80419
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 810cddee6d2ef0f4057337d699a1a55323faa1ba)
Reviewed-on: https://gerrit.libreoffice.org/80420
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index a52a59f38f30..df6ea46eedef 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -372,8 +372,9 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent)
 pWrtShell->LeaveBlockMode();
 else if(pWrtShell->IsExtMode())
 pWrtShell->LeaveExtMode();
-// select word
-pWrtShell->SelNearestWrd();
+// select word (tdf#126589: part to the left of cursor)
+if (pWrtShell->IsInWord() || pWrtShell->IsEndWrd())
+pWrtShell->PrvWrd(true);
 // ask for word
 if(pWrtShell->IsSelection())
 aShortName = pWrtShell->GetSelText();
___
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.2' - sw/source

2019-10-07 Thread Marco Cecchetti (via logerrit)
 sw/source/uibase/docvw/AnnotationWin2.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit e06d5adb84d3d80e308395c291ce067b1cf457b9
Author: Marco Cecchetti 
AuthorDate: Fri Sep 20 18:51:27 2019 +0200
Commit: Michael Meeks 
CommitDate: Mon Oct 7 12:46:15 2019 +0200

lok: comments: fix hidden text cursor and sudden document scroll

On Android, SwAnnotationWin::Rescale leads to invoke
ImpEditEngine::UpdateViews which hides the text cursor. Moreover it
causes sudden document scroll when modifying a commented text.
Not clear the root cause, anyway skipping this method fixes the
problem, and there should be no side effect, since the client has
disabled annotations rendering.

Change-Id: I572a9c6b3fe39473a596209413945d777bd79506
Reviewed-on: https://gerrit.libreoffice.org/80245
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 500a839f0f06..1016118aedec 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -609,6 +609,14 @@ void SwAnnotationWin::CheckMetaText()
 
 void SwAnnotationWin::Rescale()
 {
+// On Android, this method leads to invoke ImpEditEngine::UpdateViews
+// which hides the text cursor. Moreover it causes sudden document scroll
+// when modifying a commented text. Not clear the root cause,
+// anyway skipping this method fixes the problem, and there should be
+// no side effect, since the client has disabled annotations rendering.
+if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isTiledAnnotations())
+return;
+
 MapMode aMode = GetParent()->GetMapMode();
 aMode.SetOrigin( Point() );
 mpOutliner->SetRefMapMode( aMode );
___
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.2' - sw/source

2019-09-30 Thread Muhammet Kara (via logerrit)
 sw/source/uibase/app/docst.cxx |   86 -
 1 file changed, 85 insertions(+), 1 deletion(-)

New commits:
commit 5a76cbb3570437f2eea4549b97dc6e08068d7a59
Author: Muhammet Kara 
AuthorDate: Mon Jun 24 01:46:42 2019 +0300
Commit: Andras Timar 
CommitDate: Mon Sep 30 21:50:39 2019 +0200

Sync page orientation of Endnote page

Description:
When changing the default page style to have a different orientation,
end-notes are placed on a page with a custom ‘Endnote’ page style.
This style does not inherit its orientation from the default style.

Repro:
Create a blank document, insert→End Note, Format→Page in the first page,
select the Page tab, and alter the Orientation to Landscape, ‘Ok’.
The End-note page should update its orientation too.

NB. If the Endnote page style is manually set to a different value
in a document template it will remain in the selected orientation.

After this patch, Default style and the Endnote style have their
orientations synced after each run of the Format > Page dialog.

Ideally, this should be solved by resolving tdf#41316 on master:
Page styles should support hierarchical parent-child relationships
(like paragraph or character styles)

Change-Id: I255b470d1aebb897f50a4a74b8678b771ffbab28
Reviewed-on: https://gerrit.libreoffice.org/79869
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 806c38b64bf2..59dfb6bbbfd5 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -86,6 +86,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -641,6 +642,71 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
 pWrtShell->EndAllAction();
 }
 
+namespace
+{
+/// Checks if there is an Endnote page style in use, and makes sure it has the 
same orientation
+/// with the Default (Standard) page style.
+void syncEndnoteOrientation(const uno::Reference< 
style::XStyleFamiliesSupplier >& xStyleFamSupp)
+{
+if (!xStyleFamSupp.is())
+{
+SAL_WARN("sw.ui", "Ref to XStyleFamiliesSupplier is null.");
+return;
+}
+uno::Reference xStyleFamilies(
+xStyleFamSupp->getStyleFamilies(), uno::UNO_QUERY);
+
+if (!xStyleFamilies.is())
+return;
+
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+
+if (!xPageStyles.is())
+return;
+
+uno::Reference 
xEndnotePageStyle(xPageStyles->getByName("Endnote"),
+  uno::UNO_QUERY);
+
+if (!xEndnotePageStyle.is())
+return;
+
+// Language-independent name of the "Default Style" is "Standard"
+uno::Reference 
xDefaultPageStyle(xPageStyles->getByName("Standard"),
+  uno::UNO_QUERY);
+if (!xDefaultPageStyle.is())
+return;
+
+if (xEndnotePageStyle->isUserDefined() || !xEndnotePageStyle->isInUse())
+return;
+
+uno::Reference 
xEndnotePagePropSet(xPageStyles->getByName("Endnote"), uno::UNO_QUERY);
+uno::Reference 
xDefaultPagePropSet(xPageStyles->getByName("Standard"), uno::UNO_QUERY);
+
+if (!xEndnotePagePropSet.is() || !xDefaultPagePropSet.is())
+{
+SAL_WARN("sw.ui", "xEndnotePagePropSet or xDefaultPagePropSet is 
null.");
+return;
+}
+
+sal_Int32 nWidth, nHeight;
+bool bIsDefLandScape, bIsEndLandScape;
+
+xDefaultPagePropSet->getPropertyValue("IsLandscape") >>= bIsDefLandScape;
+xEndnotePagePropSet->getPropertyValue("IsLandscape") >>= bIsEndLandScape;
+
+if (bIsDefLandScape == bIsEndLandScape)
+return;
+
+xEndnotePagePropSet->getPropertyValue("Width") >>= nWidth;
+xEndnotePagePropSet->getPropertyValue("Height") >>= nHeight;
+
+xEndnotePagePropSet->setPropertyValue("IsLandscape", 
css::uno::toAny(bIsDefLandScape));
+xEndnotePagePropSet->setPropertyValue("Width", css::uno::toAny(nHeight));
+xEndnotePagePropSet->setPropertyValue("Height", css::uno::toAny(nWidth));
+}
+}
+
 void SwDocShell::Edit(
 const OUString ,
 const OUString ,
@@ -830,7 +896,12 @@ void SwDocShell::Edit(
 pReq->Ignore(); // the 'old' request is not relevant any more
 }
 
-pDlg->StartExecuteAsync([bModified, bNew, nFamily, nSlot, 
nNewStyleUndoId, pApplyStyleHelper, pRequest, xTmp, this](sal_Int32 nResult){
+bool bIsDefaultPage = nFamily == SfxStyleFamily::Page
+&& rName == SwResId(STR_POOLPAGE_STANDARD)
+&& pStyle->IsUsed()
+&& !pStyle->IsUserDefined();
+
+pDlg->StartExecuteAsync([bIsDefaultPage, bModified, bNew, nFamily, 
nSlot, nNewStyleUndoId, 

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

2019-09-29 Thread Henry Castro (via logerrit)
 sw/source/ui/misc/num.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 8a3770f1d521ebb3a6e323dd3ba80b53ee442d92
Author: Henry Castro 
AuthorDate: Thu Feb 7 09:21:20 2019 -0400
Commit: Andras Timar 
CommitDate: Sun Sep 29 20:39:44 2019 +0200

lok: Bullets and Numbering → disable Graphic selection in Customize

Change-Id: If0f7b953a40ca1d5f469087cb8f362a949c39b37
Reviewed-on: https://gerrit.libreoffice.org/67499
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/79810
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index eb4c03c4d523..0506198c021e 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static bool bLastRelative = false;
 
@@ -890,7 +891,16 @@ 
SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(weld::Window* pParent,
 AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET );
 AddTabPage("outlinenum", RID_SVXPAGE_PICK_NUM );
 AddTabPage("graphics", RID_SVXPAGE_PICK_BMP );
-AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+RemoveTabPage("customize");
+}
+else
+{
+AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
+}
+
 AddTabPage("position", RID_SVXPAGE_NUM_POSITION );
 }
 
___
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.2' - sw/source

2019-09-26 Thread Jan Holesovsky (via logerrit)
 sw/source/uibase/wrtsh/wrtsh1.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 650cf5a0429cb022fff4dc87fe1bc5a17d69a523
Author: Jan Holesovsky 
AuthorDate: Wed Sep 25 11:40:46 2019 +0200
Commit: Andras Timar 
CommitDate: Thu Sep 26 13:02:38 2019 +0200

tdf#127673 lok: On double-click, don't enter the embedded objects in Writer.

There are all sorts of problems when we'd try to edit the embedded
objects, like that that LOK thinks it is a separate view etc., so better
to disable it for now, before we really need to edit embedded objects.

Change-Id: Ie8c0249cb0ca8b25a2ac97c1ccec4a5a62cbb770
Reviewed-on: https://gerrit.libreoffice.org/79590
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index fc176630e498..fe43ef52fabb 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -581,7 +581,14 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
 {
 svt::EmbeddedObjectRef& xRef = GetOLEObject();
 OSL_ENSURE( xRef.is(), "OLE not found" );
-SfxInPlaceClient* pCli=nullptr;
+
+// LOK: we don't want to handle any other embedded objects than
+// charts, there are too many problems with eg. embedded spreadsheets
+// (like it creates a separate view for the calc sheet)
+if (comphelper::LibreOfficeKit::isActive() && 
!SotExchange::IsChart(xRef->getClassID()))
+return;
+
+SfxInPlaceClient* pCli = nullptr;
 
 pCli = GetView().FindIPClient( xRef.GetObject(), 
().GetEditWin() );
 if ( !pCli )
___
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.2' - sw/source

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 1db820d9132ad3e813d018b8d847749a91cbe08b
Author: Tor Lillqvist 
AuthorDate: Tue May 28 22:03:58 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 14:13:24 2019 +0200

tdf#124752: Reduce number of formats offered on clipboard on mobile devices

It seems a bit pointless to offer formats that no other app will use.

Change-Id: I54474a4ba40d91c184592cede4224cbfbb78d518
Reviewed-on: https://gerrit.libreoffice.org/79231
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index ef5abb43a505..ea12ee91601a 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -831,8 +831,10 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac);
 m_pWrtShell->Copy( pDoc );
 
+#if HAVE_FEATURE_DESKTOP
 if (m_pOrigGraphic && !m_pOrigGraphic->GetBitmapEx().IsEmpty())
   AddFormat( SotClipboardFormatId::SVXB );
+#endif
 
 PrepareOLE( m_aObjDesc );
 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
@@ -840,9 +842,11 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 const Graphic* pGrf = m_pWrtShell->GetGraphic();
 if( pGrf && pGrf->IsSupportedGraphic() )
 {
-AddFormat( SotClipboardFormatId::GDIMETAFILE );
 AddFormat( SotClipboardFormatId::PNG );
+#if HAVE_FEATURE_DESKTOP
+AddFormat( SotClipboardFormatId::GDIMETAFILE );
 AddFormat( SotClipboardFormatId::BITMAP );
+#endif
 }
 m_eBufferType = TransferBufferType::Graphic;
 m_pWrtShell->GetGrfNms( , nullptr );
@@ -862,8 +866,9 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 m_aObjDesc.maSize = 
OutputDevice::LogicToLogic(m_pWrtShell->GetObjSize(), 
MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
 // <--
 PrepareOLE( m_aObjDesc );
-AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
 
+#if HAVE_FEATURE_DESKTOP
+AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
 AddFormat( SotClipboardFormatId::GDIMETAFILE );
 
 // Fetch the formats supported via embedtransferhelper as well
@@ -881,6 +886,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 AddFormat( rItem );
 }
 }
+#endif
 m_eBufferType = TransferBufferType::Ole;
 }
 // Is there anything to provide anyway?
@@ -943,15 +949,19 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 bDDELink = m_pWrtShell->HasWholeTabSelection();
 }
 
+#if HAVE_FEATURE_DESKTOP
 //When someone needs it, we 'OLE' him something
 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
+#endif
 
 //put RTF ahead of  the OLE's Metafile to have less loss
 if( !m_pWrtShell->IsObjSelected() )
 {
 AddFormat( SotClipboardFormatId::RTF );
+#if HAVE_FEATURE_DESKTOP
 AddFormat( SotClipboardFormatId::RICHTEXT );
 AddFormat( SotClipboardFormatId::HTML );
+#endif
 }
 if( m_pWrtShell->IsSelection() )
 AddFormat( SotClipboardFormatId::STRING );
@@ -961,9 +971,11 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 AddFormat( SotClipboardFormatId::DRAWING );
 if ( nSelection & SelectionType::DrawObject )
 {
+#if HAVE_FEATURE_DESKTOP
 AddFormat( SotClipboardFormatId::GDIMETAFILE );
-AddFormat( SotClipboardFormatId::PNG );
 AddFormat( SotClipboardFormatId::BITMAP );
+#endif
+AddFormat( SotClipboardFormatId::PNG );
 }
 m_eBufferType = static_cast( 
TransferBufferType::Graphic | m_eBufferType );
 
@@ -980,10 +992,12 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 if( m_pWrtShell->GetURLFromButton( sURL, sDesc ) )
 {
 AddFormat( SotClipboardFormatId::STRING );
+#if HAVE_FEATURE_DESKTOP
 AddFormat( SotClipboardFormatId::SOLK );
 AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
 AddFormat( SotClipboardFormatId::FILECONTENT );
 AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR );
+#endif
 AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
 m_eBufferType = TransferBufferType::InetField | m_eBufferType;
 nRet = 1;
@@ -996,7 +1010,9 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
 nullptr != ( pDShell = m_pWrtShell->GetDoc()->GetDocShell()) &&
 SfxObjectCreateMode::STANDARD == pDShell->GetCreateMode() )
 {
+#if HAVE_FEATURE_DESKTOP
 AddFormat( SotClipboardFormatId::LINK );
+#endif
 

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

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbaapplication.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dfb1fa5fa16a0147613cf4600a05356785b9acd5
Author: Tor Lillqvist 
AuthorDate: Fri Apr 19 12:46:32 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 13:56:42 2019 +0200

Add a SAL_INFO to SwWordBasic::FileSaveAs()

Change-Id: I04a3a22918ead008b560c2e1159747e8d28da404
(cherry picked from commit caee51e429119fe252d1aa4b075ab14863420b2c)
Reviewed-on: https://gerrit.libreoffice.org/79209
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbaapplication.cxx 
b/sw/source/ui/vba/vbaapplication.cxx
index e448f871db79..a0221c537252 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -579,6 +579,8 @@ SwWordBasic::FileSaveAs( const css::uno::Any& Name,
  const css::uno::Any& /*FormsData*/,
  const css::uno::Any& /*SaveAsAOCELetter*/ )
 {
+SAL_INFO("sw.vba", "WordBasic.FileSaveAs(Name:=" << Name << ",Format:=" << 
Format << ")");
+
 uno::Reference< frame::XModel > xModel( mpApp->getCurrentDocument(), 
uno::UNO_SET_THROW );
 
 // Based on SwVbaDocument::SaveAs2000.
___
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.2' - sw/source

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbadocument.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f8098e53752eefec19bee0899563c172a602aa2c
Author: Tor Lillqvist 
AuthorDate: Tue Mar 26 17:32:13 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 12:56:40 2019 +0200

Fix compilation error without precompiled headers

Change-Id: I06eea66ac783296a6278d4bcf3be5829a2d7d277
(cherry picked from commit afbc688fba50e8b76f2e367f62d943587c3411d8)
Reviewed-on: https://gerrit.libreoffice.org/79191
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 4fcd09f693a0..728107daddda 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -28,6 +28,7 @@
 #include "vbabookmarks.hxx"
 #include "vbamailmerge.hxx"
 #include "vbavariables.hxx"
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbadocument.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 053474e539c7724c8cfeb0c1dee1a6ede5f38c13
Author: Tor Lillqvist 
AuthorDate: Sun Mar 3 22:49:28 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 11:48:50 2019 +0200

tdf#123821: Correct accidental overlap with IIDs used in Calc

These are used for functionality that hasn't really been tested yet,
that I added right before moving on to other things last Spring, I
guess, which is why I hadn't noticed.

Change-Id: I1df26c5dff62269315b1a7eaaf574f7e38c452f6
(cherry picked from commit 1a5d7407d508057f4e4f8f4a3f890453623a0481)
Reviewed-on: https://gerrit.libreoffice.org/79176
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 557b5bb9ca1c..df94a8585fd9 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -552,7 +552,7 @@ SwVbaDocument::getIID()
 OUString SAL_CALL
 SwVbaDocument::GetIIDForClassItselfNotCoclass()
 {
-return OUString("{82154425-0FBF-11D4-8313-005004526AB4}");
+return OUString("{82154428-0FBF-11D4-8313-005004526AB4}");
 }
 
 TypeAndIID SAL_CALL
@@ -560,7 +560,7 @@ SwVbaDocument::GetConnectionPoint()
 {
 TypeAndIID aResult =
 { word::XDocumentOutgoing::static_type(),
-  "{82154426-0FBF-11D4-8313-005004526AB4}"
+  "{82154429-0FBF-11D4-8313-005004526AB4}"
 };
 
 return aResult;
___
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.2' - sw/source

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbaapplication.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit e6cefbb2683bf6d2d0bb727c4691586e89c56e60
Author: Tor Lillqvist 
AuthorDate: Wed Feb 6 12:32:35 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 11:15:09 2019 +0200

Ignore RuntimeException in Application.WindowState setter

Probably helps VB6 clients.

Change-Id: I3a1072e6ededbd0322c4b0dcd0ef4b16ace215d1
(cherry picked from commit e9f87f7b8e33352b66d52b37c459a52a6737eb80)
Reviewed-on: https://gerrit.libreoffice.org/79161
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbaapplication.cxx 
b/sw/source/ui/vba/vbaapplication.cxx
index 73a0c5394ff8..5a4ff94896c1 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -291,12 +291,18 @@ sal_Int32 SAL_CALL SwVbaApplication::getWindowState()
 
 void SAL_CALL SwVbaApplication::setWindowState( sal_Int32 _windowstate )
 {
-auto xWindow = getActiveWindow();
-if (xWindow.is())
+try
+{
+auto xWindow = getActiveWindow();
+if (xWindow.is())
+{
+uno::Any aState;
+aState <<= _windowstate;
+xWindow->setWindowState( aState );
+}
+}
+catch (const uno::RuntimeException&)
 {
-uno::Any aState;
-aState <<= _windowstate;
-xWindow->setWindowState( aState );
 }
 }
 
___
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.2' - sw/source

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbaapplication.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec8a45b9305e379a30a9768821f856e7928be5d0
Author: Tor Lillqvist 
AuthorDate: Wed Feb 6 11:44:15 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 10:59:48 2019 +0200

Use bool and not sal_Bool, says a plugin

Change-Id: I1714a609ecb520260b99f361e4ed65bdc77c
(cherry picked from commit 5f5726d82e92e0ed403240dbcea57567a5c38a1f)
Reviewed-on: https://gerrit.libreoffice.org/79156
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbaapplication.cxx 
b/sw/source/ui/vba/vbaapplication.cxx
index 12e7c2e80dd5..4d92fbd6b8a8 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -547,7 +547,7 @@ SwWordBasic::FileClose( const css::uno::Any& Save )
 {
 uno::Reference< frame::XModel > xModel( mpApp->getCurrentDocument(), 
uno::UNO_SET_THROW );
 
-sal_Bool bSave = false;
+bool bSave = false;
 if (Save.hasValue() && (Save >>= bSave) && bSave)
 FileSave();
 
___
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.2' - sw/source

2019-09-20 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbaapplication.cxx |3 ++-
 sw/source/ui/vba/vbaapplication.hxx |1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e60012e6ae4d7ea76787d4ec723ccb6c6c27555a
Author: Tor Lillqvist 
AuthorDate: Mon Jan 21 17:33:01 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Sep 20 09:57:53 2019 +0200

Implement WordBasic.FileSave()

Change-Id: Iafb5be16ebb23aa09e0300a77c2f2dbe29b85cad
(cherry picked from commit bd70fbe1d93c72dda2e8518975cf0b94e606199e)
Reviewed-on: https://gerrit.libreoffice.org/79152
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbaapplication.cxx 
b/sw/source/ui/vba/vbaapplication.cxx
index af7db0f26f79..97b9a59c5b6a 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -536,7 +536,8 @@ SwWordBasic::FileOpen( const OUString& Name, const 
uno::Any& ConfirmConversions,
 void SAL_CALL
 SwWordBasic::FileSave()
 {
-// FIXME save it
+uno::Reference< frame::XModel > xModel( mpApp->getCurrentDocument(), 
uno::UNO_SET_THROW );
+dispatchRequests(xModel,".uno:Save");
 }
 
 void SAL_CALL
diff --git a/sw/source/ui/vba/vbaapplication.hxx 
b/sw/source/ui/vba/vbaapplication.hxx
index b32a372749cd..2b566ad94c82 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -111,7 +111,6 @@ public:
 // XSinkCaller
 virtual void SAL_CALL CallSinks( const OUString& Method, 
css::uno::Sequence< css::uno::Any >& Arguments ) override;
 
-protected:
 virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() 
override;
 };
 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBAAPPLICATION_HXX
___
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.2' - sw/source

2019-09-19 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbaapplication.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b2b5405031342e85dd2a33aaa45211fb81a1b73b
Author: Tor Lillqvist 
AuthorDate: Fri Jan 18 14:49:24 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Sep 19 22:41:07 2019 +0200

Try ignoring RuntimeException in ComḿandBars(), VB6 clients don't like them?

Change-Id: Ia577174fac926295db439349f6caca178b363ba0
(cherry picked from commit f5499236c69d602ae518359c8e3e7d5e239b8eda)
Reviewed-on: https://gerrit.libreoffice.org/79147
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbaapplication.cxx 
b/sw/source/ui/vba/vbaapplication.cxx
index a691d61709ff..9b57e50b7348 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -167,7 +167,14 @@ SwVbaApplication::getOptions()
 uno::Any SAL_CALL
 SwVbaApplication::CommandBars( const uno::Any& aIndex )
 {
-return VbaApplicationBase::CommandBars( aIndex );
+try
+{
+return VbaApplicationBase::CommandBars( aIndex );
+}
+catch (const uno::RuntimeException&)
+{
+return uno::Any();
+}
 }
 
 uno::Reference< word::XSelection > SAL_CALL
___
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.2' - sw/source

2019-09-19 Thread Tor Lillqvist (via logerrit)
 sw/source/ui/vba/vbawindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0c201da2e1b26b38376e7fc05ba6418acef58876
Author: Tor Lillqvist 
AuthorDate: Fri Jan 18 14:17:50 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Sep 19 22:40:31 2019 +0200

Don't throw an exception, just ignore trying to set an unhandled WindowState

End-user VB6 applications might not like the exception. Better to just
ignore.

Change-Id: I42718de7855079e38c7983db39180c184ab7224f
(cherry picked from commit 0043408b027be8664dbf88093da538ba8e24)
Reviewed-on: https://gerrit.libreoffice.org/79146
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index aba495a199b8..a404a323b9fa 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -109,7 +109,7 @@ SwVbaWindow::setWindowState( const uno::Any& _windowstate )
 else if (nwindowState == word::WdWindowState::wdWindowStateNormal)
 pWork -> Restore();
 else
-throw uno::RuntimeException("Invalid Parameter" );
+SAL_WARN("sw.vba", "Unhandled window state " << nwindowState);
 }
 }
 
___
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.2' - sw/source

2019-09-19 Thread Noel Grandin (via logerrit)
 sw/source/uibase/dialog/regionsw.cxx |   18 ++
 sw/source/uibase/dochdl/swdtflvr.cxx |   13 ++---
 sw/source/uibase/inc/wrtsh.hxx   |4 ++--
 3 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit cd1dec8142280ba3977321c86cabaee45fd585ca
Author: Noel Grandin 
AuthorDate: Thu Jan 10 10:25:55 2019 +0200
Commit: Andras Timar 
CommitDate: Thu Sep 19 21:05:57 2019 +0200

make insert-section dialog async

Change-Id: Ia48f4103b8f346a93ebe1f2c5078f21a90884e3f
Reviewed-on: https://gerrit.libreoffice.org/66065
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 09f9b5f6ba9e4590227b12eb8232a56d003086ea)
Reviewed-on: https://gerrit.libreoffice.org/79126
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/dialog/regionsw.cxx 
b/sw/source/uibase/dialog/regionsw.cxx
index 516f50074e07..56c2db1e9f5f 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -79,9 +79,9 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
 // height=width for more consistent preview (analog to edit region)
 aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-ScopedVclPtr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
+VclPtr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
 ().GetViewFrame()->GetWindow(), aSet , rSh));
-aTabDlg->Execute();
+aTabDlg->StartExecuteAsync(nullptr);
 rReq.Ignore();
 }
 else
@@ -169,13 +169,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
 }
 }
 
-IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void )
+void SwWrtShell::StartInsertRegionDialog(SwSectionData& rSectionData)
 {
-SwSectionData* pSect = static_cast(p);
-std::unique_ptr xSectionData(pSect);
-if (!xSectionData)
-return;
-
 SfxItemSet aSet(
 GetView().GetPool(),
 svl::Items<
@@ -191,11 +186,10 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void 
)
 // height=width for more consistent preview (analog to edit region)
 aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-ScopedVclPtr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
+VclPtr 
aTabDlg(pFact->CreateInsertSectionTabDialog(
 ().GetViewFrame()->GetWindow(),aSet , *this));
-aTabDlg->SetSectionData(*xSectionData);
-aTabDlg->Execute();
-
+aTabDlg->SetSectionData(rSectionData);
+aTabDlg->StartExecuteAsync(nullptr);
 }
 
 void SwBaseShell::EditRegionDialog(SfxRequest const & rReq)
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index ad2433ff6b9e..ef5abb43a505 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2659,17 +2659,16 @@ bool SwTransferable::PasteFileName( 
TransferableDataHelper& rData,
 ? nullptr : SwIoSystem::GetFileFilter(sFileURL);
 if( pFlt && dynamic_cast< const SwWebDocShell *>( 
rSh.GetView().GetDocShell() ) == nullptr )
 {
-// and then pull up the insert-region-dialog by PostUser event
-SwSectionData * pSect = new SwSectionData(
+// and then pull up the insert-region-dialog
+SwSectionData aSect(
 FILE_LINK_SECTION,
 rSh.GetDoc()->GetUniqueSectionName() );
-pSect->SetLinkFileName( sFileURL );
-pSect->SetProtectFlag( true );
+aSect.SetLinkFileName( sFileURL );
+aSect.SetProtectFlag( true );
 
-Application::PostUserEvent( LINK( , SwWrtShell,
-  InsertRegionDialog ), 
pSect );
+rSh.StartInsertRegionDialog( aSect ); // starts dialog 
asynchronously
 bRet = true;
-}
+}
 else if( SwPasteSdr::SetAttr == nAction ||
 ( bIsURLFile && SwPasteSdr::Insert == nAction ))
 {
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 6c9a4fa2d883..58d375c805f2 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -449,8 +449,8 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
 void AutoUpdateFrame(SwFrameFormat* pFormat, const SfxItemSet& rStyleSet);
 void AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, 
SwPaM* pPaM = nullptr );
 
-// link for inserting ranges via Drag/Clipboard
-DECL_LINK( InsertRegionDialog, void*, void );
+// starts dialog for inserting ranges via Drag/Clipboard
+void 

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

2019-09-18 Thread Henry Castro (via logerrit)
 sw/source/uibase/uiview/viewdraw.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 34790afec30024569a66108fa4d875ab054ab938
Author: Henry Castro 
AuthorDate: Tue Apr 9 16:33:40 2019 -0400
Commit: Andras Timar 
CommitDate: Wed Sep 18 16:11:09 2019 +0200

sw lok: fix "Cannot deselect the shape after inserting the first in a...

document"

Change-Id: I976318fe299306b65190b4f5ae0ed2565830c6f7
Reviewed-on: https://gerrit.libreoffice.org/70475
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 
Reviewed-by: Henry Castro 
(cherry picked from commit 304425807e9172ac7a85d5f17fceba2735218409)
Reviewed-on: https://gerrit.libreoffice.org/79090
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/uiview/viewdraw.cxx 
b/sw/source/uibase/uiview/viewdraw.cxx
index 8420e9f3a9f5..278fe1baf8c8 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -346,6 +346,10 @@ void SwView::ExecDraw(SfxRequest& rReq)
 {
 m_pWrtShell->GotoObj(true);
 }
+else if (dynamic_cast(pTempFuncPtr))
+{
+pTempFuncPtr->CreateDefaultObject();
+}
 else
 {
 pTempFuncPtr->CreateDefaultObject();
___
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.2' - sw/source

2019-09-07 Thread Mert Tumer (via logerrit)
 sw/source/uibase/dialog/watermarkdialog.cxx |2 +-
 sw/source/uibase/inc/watermarkdialog.hxx|3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 4a439151f3b21b3381060d7c7e616f469e5f090f
Author: Mert Tumer 
AuthorDate: Fri Jan 18 00:52:23 2019 +0300
Commit: Aron Budea 
CommitDate: Sat Sep 7 08:14:52 2019 +0200

lok: Make the welded Watermark dialog work with dialog tunneling.

Change-Id: Ib5acd6fe4838aa09b74333c46cf38b9e0a926682
Signed-off-by: Mert Tumer 
Reviewed-on: https://gerrit.libreoffice.org/66555
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 2a1ea372daa12c0041d2c080a8fab33a6a87950d)
Reviewed-on: https://gerrit.libreoffice.org/78738
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx 
b/sw/source/uibase/dialog/watermarkdialog.cxx
index 378f20e2b9cb..a40977792873 100644
--- a/sw/source/uibase/dialog/watermarkdialog.cxx
+++ b/sw/source/uibase/dialog/watermarkdialog.cxx
@@ -20,7 +20,7 @@
 #include 
 
 SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& 
rBindings)
-: GenericDialogController(pParent, 
"modules/swriter/ui/watermarkdialog.ui", "WatermarkDialog")
+: SfxDialogController(pParent, "modules/swriter/ui/watermarkdialog.ui", 
"WatermarkDialog")
 , m_rBindings(rBindings)
 , m_xTextInput(m_xBuilder->weld_entry("TextInput"))
 , m_xOKButton(m_xBuilder->weld_button("ok"))
diff --git a/sw/source/uibase/inc/watermarkdialog.hxx 
b/sw/source/uibase/inc/watermarkdialog.hxx
index 65801fcba3a9..dff87a792a57 100644
--- a/sw/source/uibase/inc/watermarkdialog.hxx
+++ b/sw/source/uibase/inc/watermarkdialog.hxx
@@ -12,8 +12,9 @@
 #include 
 #include 
 #include 
+#include 
 
-class SwWatermarkDialog : public weld::GenericDialogController
+class SwWatermarkDialog : public SfxDialogController
 {
 public:
 SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindings);
___
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.2' - sw/source

2019-09-03 Thread Tamás Zolnai (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cdecd2c2e05b47602312f0875f9e3a719749fb01
Author: Tamás Zolnai 
AuthorDate: Mon Sep 2 18:23:19 2019 +0200
Commit: Andras Timar 
CommitDate: Tue Sep 3 21:41:31 2019 +0200

lok: Don't change mouse pointer when hovering over table borders

Reviewed-on: https://gerrit.libreoffice.org/78411
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 
(cherry picked from commit e015ce45c299bec5d4a571e127ca7422caea523b)

Change-Id: If6cc3698e6e7229a01d3147d79a587ead65f9b5e
Reviewed-on: https://gerrit.libreoffice.org/78415
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 5fcfbc9b3c5a..c7260dd99a75 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3887,7 +3887,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
 
 if ( PointerStyle::Null != nPointer &&
 // i#35543 - Enhanced table selection is explicitly allowed in 
table mode
-( !bChkTableSel || !rSh.IsTableMode() ) )
+( !bChkTableSel || !rSh.IsTableMode() ) &&
+!comphelper::LibreOfficeKit::isActive() )
 {
 SetPointer( nPointer );
 }
___
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.2' - sw/source

2019-09-03 Thread Ashod Nakashian (via logerrit)
 sw/source/core/doc/docredln.cxx   |4 +-
 sw/source/uibase/uno/unotxdoc.cxx |   69 ++
 2 files changed, 44 insertions(+), 29 deletions(-)

New commits:
commit cbff1b6f6d71ab721eb8dff1638cb441ac367959
Author: Ashod Nakashian 
AuthorDate: Thu Nov 8 11:02:26 2018 -0500
Commit: Andras Timar 
CommitDate: Tue Sep 3 13:36:19 2019 +0200

LOK: don't emit redline comments

Change tracking can be quite numerous. Showing the
markers (and their comments" as comment-boxes is
sensible where there is limited change in a doc.

However with extensively modified doc, this becomes
overwhelming both in terms of browser load and
editing performance. As such, we disable them
as they don't add much value. The user can still
access them from the Track Changes > Manage menu.

Use a rather nasty env. var hack to propagate this
setting from WSD for now.

Change-Id: I3f964816b4a10f565012b273added8a8413cd309
Signed-off-by: Michael Meeks 
(cherry picked from commit c99e885565f9d741a659e7e18c22d092ed90b9de)
Reviewed-on: https://gerrit.libreoffice.org/78431
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index a323b595f0fc..5656f35fb3d1 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -360,7 +360,9 @@ void lcl_LOKInvalidateStartEndFrames(SwShellCursor& rCursor)
 /// Emits LOK notification about one addition / removal of a redline item.
 void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, 
SwRangeRedline* pRedline)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+// Disable since usability is very low beyond some small number of changes.
+static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
+if (!comphelper::LibreOfficeKit::isActive() || bDisableRedlineComments)
 return;
 
 boost::property_tree::ptree aRedline;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index d4f98f8f44ec..2c3366d575fc 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3280,40 +3280,53 @@ Pointer SwXTextDocument::getPointer()
 
 OUString SwXTextDocument::getTrackedChanges()
 {
-const SwRedlineTable& rRedlineTable = 
pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
 boost::property_tree::ptree aTrackedChanges;
-for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
-{
-boost::property_tree::ptree aTrackedChange;
-aTrackedChange.put("index", rRedlineTable[i]->GetId());
-aTrackedChange.put("author", 
rRedlineTable[i]->GetAuthorString(1).toUtf8().getStr());
-aTrackedChange.put("type", 
nsRedlineType_t::SwRedlineTypeToOUString(rRedlineTable[i]->GetRedlineData().GetType()).toUtf8().getStr());
-aTrackedChange.put("comment", 
rRedlineTable[i]->GetRedlineData().GetComment().toUtf8().getStr());
-aTrackedChange.put("description", 
rRedlineTable[i]->GetDescr().toUtf8().getStr());
-OUString sDateTime = 
utl::toISO8601(rRedlineTable[i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
-aTrackedChange.put("dateTime", sDateTime.toUtf8().getStr());
-
-SwContentNode* pContentNd = rRedlineTable[i]->GetContentNode();
-SwView* pView = dynamic_cast(SfxViewShell::Current());
-if (pView && pContentNd)
+
+// Disable since usability is very low beyond some small number of changes.
+static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
+if (!bDisableRedlineComments)
+{
+const SwRedlineTable& rRedlineTable
+= 
pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
+for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
 {
-SwShellCursor aCursor(pView->GetWrtShell(), 
*(rRedlineTable[i]->Start()));
-aCursor.SetMark();
-aCursor.GetMark()->nNode = *pContentNd;
-aCursor.GetMark()->nContent.Assign(pContentNd, 
rRedlineTable[i]->End()->nContent.GetIndex());
+boost::property_tree::ptree aTrackedChange;
+aTrackedChange.put("index", rRedlineTable[i]->GetId());
+aTrackedChange.put("author", 
rRedlineTable[i]->GetAuthorString(1).toUtf8().getStr());
+aTrackedChange.put("type", 
nsRedlineType_t::SwRedlineTypeToOUString(
+   
rRedlineTable[i]->GetRedlineData().GetType())
+   .toUtf8()
+   .getStr());
+aTrackedChange.put("comment",
+   
rRedlineTable[i]->GetRedlineData().GetComment().toUtf8().getStr());
+aTrackedChange.put("description", 
rRedlineTable[i]->GetDescr().toUtf8().getStr());
+OUString sDateTime 

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

2019-08-30 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentRedlineManager.cxx   |1 +
 sw/source/core/fields/docufld.cxx   |2 ++
 sw/source/core/frmedt/feshview.cxx  |1 +
 sw/source/core/inc/flowfrm.hxx  |4 +++-
 sw/source/core/inc/frmtool.hxx  |3 ++-
 sw/source/core/inc/txtfrm.hxx   |4 +++-
 sw/source/core/layout/anchoredobject.cxx|1 +
 sw/source/core/layout/dbg_lay.cxx   |1 +
 sw/source/core/layout/findfrm.cxx   |1 +
 sw/source/core/layout/frmtool.cxx   |   12 
 sw/source/core/layout/pagechg.cxx   |1 +
 sw/source/core/layout/paintfrm.cxx  |2 ++
 sw/source/core/layout/sectfrm.cxx   |2 ++
 sw/source/core/layout/ssfrm.cxx |1 +
 sw/source/core/layout/tabfrm.cxx|2 ++
 sw/source/core/layout/trvlfrm.cxx   |2 ++
 sw/source/core/layout/wsfrm.cxx |2 ++
 sw/source/core/text/EnhancedPDFExportHelper.cxx |1 +
 sw/source/core/text/porfld.hxx  |2 ++
 sw/source/core/text/txtfrm.cxx  |   11 +--
 sw/source/core/tox/ToxTabStopTokenHandler.cxx   |2 ++
 sw/source/core/txtnode/ndtxt.cxx|2 +-
 22 files changed, 50 insertions(+), 10 deletions(-)

New commits:
commit d8d2340a2ee130852d3be1d8330e6e7a720f999a
Author: Michael Stahl 
AuthorDate: Fri Aug 9 16:03:44 2019 +0200
Commit: Andras Timar 
CommitDate: Fri Aug 30 10:38:09 2019 +0200

tdf#126627 sw_redlinehide: fix corner case in SwUndoDelete::UndoImpl()

The assumption that the merge by the moved nodes would be sufficient to
handle the end node's frames is wrong: the MakeFrames() uses
FrameMode::New, so the frames on the end node are not deleted, even if a
previous node is merged with the end node, so the end node has 2 frames
in the same layout, which will cause all sorts of problems.

Ensure that the ::MakeFrames() that is called from SwUndoDelete will
*once* use FrameMode::Existing, which will delete the existing frames on
the end node *iff* it is merged.  Subsequent SwTextNode::MakeFrames()
calls on the nodes must use FrameMode::New of course, to prevent
deleting the newly created frames immediately.

Hopefully the SwUndoDelete is the only caller of MakeFrames() that will
run into this corner case, as the others typically operate on a
nodes-array section...

(regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)

Reviewed-on: https://gerrit.libreoffice.org/77211
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit f6a7dee56c984f36261c75a1056cc3a5bf43b2f1)
Reviewed-on: https://gerrit.libreoffice.org/77220
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 4093811d1327e83edf216639d7b1173d8ebf7165)

Backport needs some tweak to includes to avoid cyclic headers.

Change-Id: I829c1e7a92434f93d56e3c88a4ba4a55bab818d4
Reviewed-on: https://gerrit.libreoffice.org/77340
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/77907
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index a46dc49db8ee..fc28e74798c7 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index c6da204043ba..c5dce86e1eb8 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -45,6 +45,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index d3fa9b126e86..69bfd77ca14e 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 6f08a70bd39f..33e342851789 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -20,7 +20,9 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_FLOWFRM_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_FLOWFRM_HXX
 
-#include "frmtool.hxx"
+#include "frame.hxx"
+#include "layfrm.hxx"
+#include 
 
 class SvxFormatKeepItem;
 class SvxFormatBreakItem;
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index a031d11ea136..eea90deeb271 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -23,6 +23,7 @@
 #include 
 #include "layfrm.hxx"
 #include 
+#include 

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

2019-08-29 Thread Tomáš Chvátal (via logerrit)
 sw/source/core/layout/calcmove.cxx |8 
 sw/source/core/layout/flowfrm.cxx  |4 
 2 files changed, 12 insertions(+)

New commits:
commit 35208b451b5d8bdf496f83dd8acaf5917131b50b
Author: Tomáš Chvátal 
AuthorDate: Mon Aug 19 13:30:23 2019 +0200
Commit: Andras Timar 
CommitDate: Thu Aug 29 11:33:04 2019 +0200

Fix buidling with older boost

Change-Id: I49691e8bf708aa9146d5c4f61532e7a215f4ac2d
Reviewed-on: https://gerrit.libreoffice.org/77716
Reviewed-by: Tomáš Chvátal 
Tested-by: Tomáš Chvátal 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/77922
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 8ae94ce1fe7b..2f700131c2a9 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -409,12 +409,20 @@ void SwFrame::PrepareCursor()
 
 if ( bTab )
 {
+#if BOOST_VERSION < 105600
+tabGuard.reset(static_cast(this)); // tdf#125741
+#else
 tabGuard.emplace(static_cast(this)); // tdf#125741
+#endif
 pThis = static_cast(this);
 }
 else if (IsRowFrame())
 {
+#if BOOST_VERSION < 105600
+rowGuard.reset(SwFrameDeleteGuard(this)); // tdf#125741 keep this 
alive
+#else
 rowGuard.emplace(this); // tdf#125741 keep this alive
+#endif
 }
 else if( IsSctFrame() )
 {
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 6c9e61595f23..dbe7d9c7feec 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2527,7 +2527,11 @@ bool SwFlowFrame::MoveBwd( bool  )
 && pTabFrame->GetFirstNonHeadlineRow() == 
m_rThis.GetUpper()->GetUpper())
 {
 // lock follow-flow-row (similar to sections above)
+#if BOOST_VERSION < 105600
+
g.reset(SwFrameDeleteGuard(m_rThis.GetUpper()->GetUpper()));
+#else
 g.emplace(m_rThis.GetUpper()->GetUpper());
+#endif
 
assert(m_rThis.GetUpper()->GetUpper()->IsDeleteForbidden());
 }
 }
___
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.2' - sw/source

2019-08-22 Thread Tamás Zolnai (via logerrit)
 sw/source/filter/ww8/docxsdrexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 085fd577ec0f3e3f92efd5f78d16b47f16591b22
Author: Tamás Zolnai 
AuthorDate: Tue Aug 13 14:27:05 2019 +0200
Commit: Andras Timar 
CommitDate: Thu Aug 22 14:48:25 2019 +0200

missing space (code formatting)

Change-Id: I42de376c69d0b1caa0a03622506d1bf6385ca57e
Reviewed-on: https://gerrit.libreoffice.org/77919
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 6ff1bdb54b8c..61da8449791f 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1365,7 +1365,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* 
pParentFrame, int nAncho
 // We need to init padding to 0, if it's not set.
 // In LO the default is 0 and so ins attributes are not set when padding 
is 0
 // but in MSO the default is 254 / 127, so we need to set 0 padding 
explicitly
-if(m_pImpl->m_pBodyPrAttrList)
+if (m_pImpl->m_pBodyPrAttrList)
 {
 if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_lIns))
 m_pImpl->m_pBodyPrAttrList->add(XML_lIns, OString::number(0));
___
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.2' - sw/source

2019-08-21 Thread Vasily Melenchuk (via logerrit)
 sw/source/core/inc/UndoCore.hxx |4 ++--
 sw/source/core/undo/undobj1.cxx |   21 +++--
 2 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 8c8524cca37c81b9eb3055812fd142a35b341a19
Author: Vasily Melenchuk 
AuthorDate: Fri Jul 26 10:45:59 2019 +0300
Commit: Andras Timar 
CommitDate: Wed Aug 21 20:30:12 2019 +0200

tdf#126168: sw undo/redo crash fixed

After undo of style creation we have a dangling pointers to
deleted style in SwUndoSetFlyFormat. So instead of keeping
pointers to SwFrameFormat which can be invalidated, we could
keep style name and find style by name.

Reviewed-on: https://gerrit.libreoffice.org/76351
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 20e7632919f4bbefabb4190d10ee79c65b89dca7)
Reviewed-on: https://gerrit.libreoffice.org/76798
Reviewed-by: Xisco Faulí 
Signed-off-by: Xisco Fauli 

Change-Id: I9a60d6b3311278d7391d676010c31c862189fd08
Reviewed-on: https://gerrit.libreoffice.org/76857
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/77894
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index d5b7c2561141..16277759486f 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -189,8 +189,8 @@ public:
 class SwUndoSetFlyFormat : public SwUndo, public SwClient
 {
 SwFrameFormat* pFrameFormat;  // saved FlyFormat
-SwFrameFormat* const pOldFormat;
-SwFrameFormat* pNewFormat;
+const OUString m_DerivedFromFormatName;
+const OUString m_NewFormatName;
 std::unique_ptr pItemSet;   // the re-/ set 
attributes
 sal_uLong nOldNode, nNewNode;
 sal_Int32 nOldContent, nNewContent;
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 763b2ed5b221..eab00fcd3e31 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -456,7 +456,8 @@ void SwUndoDelLayFormat::RedoForRollback()
 
 SwUndoSetFlyFormat::SwUndoSetFlyFormat( SwFrameFormat& rFlyFormat, 
SwFrameFormat& rNewFrameFormat )
 : SwUndo( SwUndoId::SETFLYFRMFMT, rFlyFormat.GetDoc() ), SwClient( 
 ), pFrameFormat(  ),
-pOldFormat( static_cast(rFlyFormat.DerivedFrom()) ), 
pNewFormat(  ),
+m_DerivedFromFormatName( rFlyFormat.IsDefault() ? "" : 
rFlyFormat.DerivedFrom()->GetName() ),
+m_NewFormatName( rNewFrameFormat.GetName() ),
 pItemSet( new SfxItemSet( *rFlyFormat.GetAttrSet().GetPool(),
 rFlyFormat.GetAttrSet().GetRanges() )),
 nOldNode( 0 ), nNewNode( 0 ),
@@ -469,8 +470,7 @@ SwRewriter SwUndoSetFlyFormat::GetRewriter() const
 {
 SwRewriter aRewriter;
 
-if (pNewFormat)
-aRewriter.AddRule(UndoArg1, pNewFormat->GetName());
+aRewriter.AddRule(UndoArg1, m_NewFormatName);
 
 return aRewriter;
 }
@@ -531,13 +531,14 @@ void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & 
rContext)
 SwDoc & rDoc = rContext.GetDoc();
 
 // Is the new Format still existent?
-if (rDoc.GetFrameFormats()->IsAlive(pOldFormat))
+SwFrameFormat* pDerivedFromFrameFormat = 
rDoc.FindFrameFormatByName(m_DerivedFromFormatName);
+if (pDerivedFromFrameFormat)
 {
 if( bAnchorChgd )
 pFrameFormat->DelFrames();
 
-if( pFrameFormat->DerivedFrom() != pOldFormat )
-pFrameFormat->SetDerivedFrom( pOldFormat );
+if( pFrameFormat->DerivedFrom() != pDerivedFromFrameFormat )
+pFrameFormat->SetDerivedFrom( pDerivedFromFrameFormat );
 
 SfxItemIter aIter( *pItemSet );
 const SfxPoolItem* pItem = aIter.GetCurItem();
@@ -605,19 +606,19 @@ void SwUndoSetFlyFormat::RedoImpl(::sw::UndoRedoContext & 
rContext)
 SwDoc & rDoc = rContext.GetDoc();
 
 // Is the new Format still existent?
-if (rDoc.GetFrameFormats()->IsAlive(pNewFormat))
+SwFrameFormat* pNewFrameFormat = 
rDoc.FindFrameFormatByName(m_NewFormatName);
+if (pNewFrameFormat)
 {
-
 if( bAnchorChgd )
 {
 SwFormatAnchor aNewAnchor( nNewAnchorTyp );
 GetAnchor( aNewAnchor, nNewNode, nNewContent );
 SfxItemSet aSet( rDoc.GetAttrPool(), aFrameFormatSetRange );
 aSet.Put( aNewAnchor );
-rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFormat,  );
+rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFrameFormat,  );
 }
 else
-rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFormat );
+rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFrameFormat );
 
 rContext.SetSelections(pFrameFormat, nullptr);
 }
___
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.2' - sw/source

2019-08-19 Thread Andrea Gelmini (via logerrit)
 sw/source/uibase/shells/textfld.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df983c2f9fc75d619c3a83b0d326ab85331cd426
Author: Andrea Gelmini 
AuthorDate: Fri Jul 12 17:25:05 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 19 09:36:45 2019 +0200

Fix typo

Change-Id: I07929ffe015e1d22fcac6969b00644b82620d4cc
Reviewed-on: https://gerrit.libreoffice.org/75506
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 
(cherry picked from commit a41984d0d71f6b76d0e56604b17b52774e39197d)
Reviewed-on: https://gerrit.libreoffice.org/77577
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 795cb38866ae..28d4d7762594 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -671,7 +671,7 @@ FIELD_INSERT:
 SwPaM* pCursorPos = rSh.GetCursor();
 if(pCursorPos)
 {
-// Insert five enspace into the text field so the field 
has extent
+// Insert five En Space into the text field so the field 
has extent
 sal_Unicode vEnSpaces[ODF_FORMFIELD_DEFAULT_LENGTH] = 
{8194, 8194, 8194, 8194, 8194};
 bool bSuccess = 
rSh.GetDoc()->getIDocumentContentOperations().InsertString(*pCursorPos, 
OUString(vEnSpaces, ODF_FORMFIELD_DEFAULT_LENGTH));
 if(bSuccess)
___
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.2' - sw/source

2019-08-13 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/uiview/view0.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 3280ef1815339cd46a66b77244121d9e245c8620
Author: Tor Lillqvist 
AuthorDate: Mon Mar 25 17:46:13 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Aug 13 14:21:52 2019 +0200

tdf#124172: Remove DESKTOP ifdef as the code is needed for tunnelled dialogs

Back in the days it could be assumed that no dialog-related code would
be needed on non-DESKTOP platforms. That changed when we started using
Online-style tunnelled dialogs in the iOS app.

Change-Id: I30ea85493cbb89bdbce422e4b6bff6c42e393a2f
(cherry picked from commit 5eb0e0afbe70a0c9e0bdb0d1864e7ae7589098e0)
Reviewed-on: https://gerrit.libreoffice.org/77401
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index a51e3c5cbd1c..a47b720dcbcb 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -88,7 +88,6 @@ SFX_IMPL_INTERFACE(SwView, SfxViewShell)
 
 void SwView::InitInterface_Impl()
 {
-#if HAVE_FEATURE_DESKTOP
 GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true);
 
 
GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
@@ -108,7 +107,6 @@ void SwView::InitInterface_Impl()
 
 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, 
SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server,
 ToolbarId::Tools_Toolbox);
-#endif
 }
 
 
___
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.2' - sw/source

2019-08-13 Thread Tor Lillqvist (via logerrit)
 sw/source/uibase/app/swdll.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit f88617711302864aebcd538c56197030d8c0f3f3
Author: Tor Lillqvist 
AuthorDate: Wed Mar 13 16:25:48 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Aug 13 14:21:30 2019 +0200

tdf#124057: Do call RegisterControls() on non-DESKTOP

Otherwise the Tools > Word Count dialog doesn't show up in the iOS
app.

Change-Id: Ic425749cc8f3245d7a16d7784d77b02f6d47253f
Reviewed-on: https://gerrit.libreoffice.org/77400
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index 59e95d141295..9fbe2561155c 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -18,7 +18,6 @@
  */
 
 #include 
-#include 
 
 #include 
 
@@ -132,10 +131,8 @@ SwDLL::SwDLL()
 // register your shell-interfaces here
 RegisterInterfaces();
 
-#if HAVE_FEATURE_DESKTOP
 // register your controllers here
 RegisterControls();
-#endif
 
 if (!utl::ConfigManager::IsFuzzing())
 {
___
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.2' - sw/source

2019-08-13 Thread Tamás Zolnai (via logerrit)
 sw/source/filter/ww8/docxsdrexport.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 026d2fb2b79837ee8d31efd90cbe3b735445f956
Author: Tamás Zolnai 
AuthorDate: Tue Aug 13 10:29:40 2019 +0200
Commit: Tamás Zolnai 
CommitDate: Tue Aug 13 12:58:19 2019 +0200

bccu#4204: Writer: Saving this damaged file as DOCX crashes

Change-Id: I526864d6a425220d342bcf0b5a195f420cbf1563
Reviewed-on: https://gerrit.libreoffice.org/77382
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 69c0e5f3e578..6ff1bdb54b8c 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1365,14 +1365,17 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* 
pParentFrame, int nAncho
 // We need to init padding to 0, if it's not set.
 // In LO the default is 0 and so ins attributes are not set when padding 
is 0
 // but in MSO the default is 254 / 127, so we need to set 0 padding 
explicitly
-if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_lIns))
-m_pImpl->m_pBodyPrAttrList->add(XML_lIns, OString::number(0));
-if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_tIns))
-m_pImpl->m_pBodyPrAttrList->add(XML_tIns, OString::number(0));
-if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_rIns))
-m_pImpl->m_pBodyPrAttrList->add(XML_rIns, OString::number(0));
-if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_bIns))
-m_pImpl->m_pBodyPrAttrList->add(XML_bIns, OString::number(0));
+if(m_pImpl->m_pBodyPrAttrList)
+{
+if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_lIns))
+m_pImpl->m_pBodyPrAttrList->add(XML_lIns, OString::number(0));
+if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_tIns))
+m_pImpl->m_pBodyPrAttrList->add(XML_tIns, OString::number(0));
+if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_rIns))
+m_pImpl->m_pBodyPrAttrList->add(XML_rIns, OString::number(0));
+if (!m_pImpl->m_pBodyPrAttrList->hasAttribute(XML_bIns))
+m_pImpl->m_pBodyPrAttrList->add(XML_bIns, OString::number(0));
+}
 
 sax_fastparser::XFastAttributeListRef 
xBodyPrAttrList(m_pImpl->m_pBodyPrAttrList);
 m_pImpl->m_pBodyPrAttrList = nullptr;
___
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.2' - sw/source

2019-08-05 Thread Michael Weghorn (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 8c3b2a3f821542450d51306e0e134014b8397714
Author: Michael Weghorn 
AuthorDate: Fri Jul 19 08:16:54 2019 +0200
Commit: Andras Timar 
CommitDate: Mon Aug 5 10:52:24 2019 +0200

tdf#126471 Apply selected MM printer on dialog open

Calling 'PrinterChangeHdl_Impl' in
'SwMMResultPrintDialog::FillInPrinterSettings' makes
sure that a preselected printer is actually taken
into account (i.e. 'm_pTempPrinter' set accordingly
etc.) as soon as the dialog is created, not only when
explicitly selecting another printer.

Since 'PrinterChangeHdl_Impl' is now called initially
and every time another printer is selected, there's no
more need to do so in 'PrinterSetupHdl_Impl' any more.

This fixes the issue that printout would always
happen on default printer instead of the preselected one
when SwMMResultPrintDialog was opened a second time.

Change-Id: I5c930ed56d1025a7e94cc98fb70c01612bda0d22
Reviewed-on: https://gerrit.libreoffice.org/75933
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 0f0adc34889ff68da584cea97a9de649174b0333)
Reviewed-on: https://gerrit.libreoffice.org/75968
Reviewed-by: Michael Stahl 
(cherry picked from commit 9711e8ed4c7353e453aa5a9b59187f6cd31f24f1)
Reviewed-on: https://gerrit.libreoffice.org/76941
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 b7b55baca56c..d102faec4103 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -341,6 +341,7 @@ void SwMMResultPrintDialog::FillInPrinterSettings()
 {
 m_xPrinterLB->set_active_text(xConfigItem->GetSelectedPrinter());
 }
+PrinterChangeHdl_Impl(*m_xPrinterLB);
 
 sal_Int32 count = xConfigItem->GetMergedDocumentCount();
 m_xToNF->set_value(count);
@@ -782,8 +783,6 @@ IMPL_LINK_NOARG(SwMMResultPrintDialog, PrintHdl_Impl, 
weld::Button&, void)
 
 IMPL_LINK_NOARG(SwMMResultPrintDialog, PrinterSetupHdl_Impl, weld::Button&, 
void)
 {
-if (!m_pTempPrinter)
-PrinterChangeHdl_Impl(*m_xPrinterLB);
 if (m_pTempPrinter)
 m_pTempPrinter->Setup(m_xDialog.get());
 }
___
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.2' - sw/source

2019-08-05 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/fly.cxx   |2 ++
 sw/source/core/layout/ssfrm.cxx |2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b7ce5fce07db79af245dcca6c48d78c170487acb
Author: Michael Stahl 
AuthorDate: Thu Jul 18 14:07:06 2019 +0200
Commit: Andras Timar 
CommitDate: Mon Aug 5 09:56:07 2019 +0200

sw: fix use after free on tdf117215-1.odt

Move the fix from 6d0ea082889c89eb8b408779f2de08da7441ff54 to
SwFlyFrame::DestroyImpl() so we unregister every SwFlyFrame.

==1550==ERROR: AddressSanitizer: heap-use-after-free on address 
0x615000383f56 at pc 0x7efcd70d5ab9 bp 0x7ffeb7ac7c40 sp 0x7ffeb7ac7c38
WRITE of size 1 at 0x615000383f56 thread T0
0 SwAnchoredObject::SetTmpConsiderWrapInfluence(bool) 
sw/source/core/layout/anchoredobject.cxx:743:32
1 SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() 
sw/source/core/layout/objstmpconsiderwrapinfl.cxx:53:23
2 SwLayouter::ClearObjsTmpConsiderWrapInfluence(SwDoc const&) 
sw/source/core/layout/layouter.cxx:387:84
3 sw::DocumentLayoutManager::ClearSwLayouterEntries() 
sw/source/core/doc/DocumentLayoutManager.cxx:497:5
4 sw::DocumentStateManager::SetModified() 
sw/source/core/doc/DocumentStateManager.cxx:45:39
5 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) 
sw/source/core/doc/DocumentContentOperationsManager.cxx:3942:36

0x615000383f56 is located 342 bytes inside of 504-byte region 
[0x615000383e00,0x615000383ff8)
freed by thread T0 here:
1 SwFlyAtContentFrame::~SwFlyAtContentFrame() 
sw/source/core/inc/flyfrms.hxx:159:7
2 SwFrame::DestroyFrame(SwFrame*) sw/source/core/layout/ssfrm.cxx:389:9
3 SwFrameFormat::DelFrames() sw/source/core/layout/atrfrm.cxx:2624:17
4 SwUndoFlyBase::DelFly(SwDoc*) sw/source/core/undo/undobj1.cxx:161:19
5 SwUndoDelLayFormat::SwUndoDelLayFormat(SwFrameFormat*) 
sw/source/core/undo/undobj1.cxx:403:5
6 SwHistoryTextFlyCnt::SwHistoryTextFlyCnt(SwFrameFormat*) 
sw/source/core/undo/rolbck.cxx:538:20
7 SwHistory::Add(SwFlyFrameFormat&, unsigned short&) 
sw/source/core/undo/rolbck.cxx:1083:50
8 SwUndoSaveContent::DelContentIndex(SwPosition const&, SwPosition 
const&, DelContentType) sw/source/core/undo/undobj.cxx:1020:39
9 SwUndoDelete::SwUndoDelete(SwPaM&, bool, bool) 
sw/source/core/undo/undel.cxx:229:9
11 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) 
sw/source/core/doc/DocumentContentOperationsManager.cxx:3939:55

Change-Id: Ia0c28c9d5792615cbb566e502374efd0f4056daf
Reviewed-on: https://gerrit.libreoffice.org/75857
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit dea72ef111ee8a0b1b178f8cd48757514d5ca831)
Reviewed-on: https://gerrit.libreoffice.org/75941
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 4b9324b93dcbd72c8c8949309d45790dd8f7d5fd)
Reviewed-on: https://gerrit.libreoffice.org/76936
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 a96532f5da55..8953d9f07d00 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -277,6 +277,8 @@ void SwFlyFrame::DestroyImpl()
 
 if( GetFormat() && !GetFormat()->GetDoc()->IsInDtor() )
 {
+ClearTmpConsiderWrapInfluence(); // remove this from SwLayouter
+
 // OD 2004-01-19 #110582#
 Unchain();
 
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index e1c8ec770646..ab8ed0a8fb5a 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -493,7 +493,6 @@ void SwLayoutFrame::DestroyImpl()
 const size_t nCnt = pFrame->GetDrawObjs()->size();
 // #i28701#
 SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[0];
-pAnchoredObj->ClearTmpConsiderWrapInfluence();
 if (SwFlyFrame* pFlyFrame = 
dynamic_cast(pAnchoredObj))
 {
 SwFrame::DestroyFrame(pFlyFrame);
@@ -501,6 +500,7 @@ void SwLayoutFrame::DestroyImpl()
 }
 else
 {
+pAnchoredObj->ClearTmpConsiderWrapInfluence();
 SdrObject* pSdrObj = pAnchoredObj->DrawObj();
 SwDrawContact* pContact =
 
static_cast(pSdrObj->GetUserCall());
___
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.2' - sw/source

2019-08-05 Thread Michael Stahl (via logerrit)
 sw/source/core/unocore/unoframe.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 08564eaa7346809f787d0ce6baa59c6faf5e3617
Author: Michael Stahl 
AuthorDate: Wed Jul 17 17:40:50 2019 +0200
Commit: Andras Timar 
CommitDate: Mon Aug 5 09:55:13 2019 +0200

sw: missing SolarMutexGuard in SwXFrame::attach()

Causes assert in a test i'm adding...

Change-Id: I5be24aa9683ec0d31494c0c97270d1d58692f764
Reviewed-on: https://gerrit.libreoffice.org/75796
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 8dfe166a879a17bd8c2e0859d027ff923258a9d8)
Reviewed-on: https://gerrit.libreoffice.org/75827
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 922aacddc86a5ae6cc3eeab9d47219bcb45ef1bc)
Reviewed-on: https://gerrit.libreoffice.org/76935
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index a7eede4e14e6..831d9dc7e41b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3042,6 +3042,8 @@ void SwXFrame::attachToRange(const uno::Reference< 
text::XTextRange > & xTextRan
 
 void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
 {
+SolarMutexGuard g;
+
 SwFrameFormat* pFormat;
 if(IsDescriptor())
 attachToRange(xTextRange);
___
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.2' - sw/source

2019-08-04 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/docvw/HeaderFooterWin.cxx |5 ++---
 sw/source/uibase/wrtsh/wrtsh1.cxx  |2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit ec1882e38139094399dc7404d68ba7ca61f7e9f3
Author: Jim Raykowski 
AuthorDate: Tue Jul 2 08:54:02 2019 -0800
Commit: Andras Timar 
CommitDate: Sun Aug 4 18:13:27 2019 +0200

tdf#125863 Rework tdf#107593 so header footer delete doesn't crash

Header footer delete from the last page when last page is unneeded
(stack level 24 SwRootFrame::RemoveSuperfluous /// remove pages that are
not needed at all) causes SwFrameMenuButtonBase::dispose() which sets
m_pFrame to nullptr which causes crash when IsEmptyHeaderFooter calls
GetPageFrame(). Doing ToggleHeaderFooterEdit() when header or footer
deletion is accepted in SwWrtShell::ChangeHeaderOrFooter avoids the
crash. SwHeaderFooterWin is also disposed which would make the
GrabFocusToDocument crash if it got that far so use the shell window
which is still valid here to GrabFocusToDocument.

Change-Id: Iaced23e6716442671c5ea29b79be178f4fc836d3
Reviewed-on: https://gerrit.libreoffice.org/75010
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
(cherry picked from commit 151eae314358f9ee0df017cb89fbc8c87c969cdb)
Reviewed-on: https://gerrit.libreoffice.org/75206
Tested-by: Jenkins
(cherry picked from commit 3597e95c6ec921fff04fc6387ff9427be54302bc)
Reviewed-on: https://gerrit.libreoffice.org/76915
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 411c1f3c87d2..c2e8cf6b0688 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -441,9 +441,8 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& 
rIdent)
 else if (rIdent == "delete")
 {
 rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
-if ( IsEmptyHeaderFooter() )
-rSh.ToggleHeaderFooterEdit();
-GrabFocusToDocument();
+// warning: "this" may be disposed now
+rSh.GetWin()->GrabFocusToDocument();
 }
 else if (rIdent == "insert_pagenumber")
 {
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 6c67f3da69ad..fc176630e498 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1802,6 +1802,8 @@ void SwWrtShell::ChangeHeaderOrFooter(
 
 bExecute = nResult == RET_YES;
 StartAllAction();
+if (nResult == RET_YES)
+ToggleHeaderFooterEdit();
 }
 if( bExecute )
 {
___
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.2' - sw/source

2019-07-26 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |4 +---
 sw/source/filter/ww8/docxattributeoutput.hxx |3 ---
 2 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit c1fde0fb9ad90aca779dc3a58b5225ca2b66a1f8
Author: Noel Grandin 
AuthorDate: Fri Mar 8 16:21:53 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 26 18:37:13 2019 +0200

loplugin:singlevalfields

(cherry picked from commit bd4d702054d65b8e907c54835c579f14278e5899)

Change-Id: I7f9ff0fc58adf51eae7fef5ce925b91b8d1f4922
Reviewed-on: https://gerrit.libreoffice.org/76383
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5254c445d7f1..ea3bb3800e69 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3696,7 +3696,6 @@ void DocxAttributeOutput::EndTableCell(sal_uInt32 nCell)
 
 m_pSerializer->endElementNS( XML_w, XML_tc );
 
-m_bBtLr = false;
 m_tableReference->m_bTableCellOpen = false;
 m_tableReference->m_bTableCellParaSdtOpen = false;
 }
@@ -7302,7 +7301,7 @@ void DocxAttributeOutput::CharIdctHint( const 
SfxPoolItem& )
 void DocxAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
 {
 // Not rotated or we the rotation already handled?
-if ( !rRotate.GetValue() || m_bBtLr || 
m_rExport.SdrExporter().getFrameBtLr())
+if ( !rRotate.GetValue() || m_rExport.SdrExporter().getFrameBtLr())
 return;
 
 AddToAttrList( m_pEastAsianLayoutAttrList, FSNS( XML_w, XML_vert ), "true" 
);
@@ -9336,7 +9335,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport 
, const FSHelperPtr
   m_nextFontId( 1 ),
   m_tableReference(new TableReference()),
   m_bIgnoreNextFill(false),
-  m_bBtLr(false),
   m_pTableStyleExport(new DocxTableStyleExport(rExport.m_pDoc, 
pSerializer)),
   m_bParaBeforeAutoSpacing(false),
   m_bParaAfterAutoSpacing(false),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 201d0f1a31d6..7bbb2554a96d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -911,9 +911,6 @@ private:
 /// If FormatBox() already handled fill style / gradient.
 bool m_bIgnoreNextFill;
 
-/// Is fake rotation detected, so rotation with 90 degrees should be 
ignored in this cell?
-bool m_bBtLr;
-
 editeng::WordPageMargins m_pageMargins;
 
 std::shared_ptr m_pTableStyleExport;
___
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.2' - sw/source

2019-06-29 Thread Muhammet Kara (via logerrit)
 sw/source/uibase/shells/drwbassh.cxx |  176 ++-
 1 file changed, 94 insertions(+), 82 deletions(-)

New commits:
commit 80413cdc7bb0e5350d6b67d2334efa0faa67a7c3
Author: Muhammet Kara 
AuthorDate: Fri Jun 28 22:44:10 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Jun 29 14:02:32 2019 +0200

lokdialog: Convert the Format -> Position and Size... to async exec for sw

Change-Id: Ie3383ebe7a712d711e28c626be9e0aaeed5379bb
Reviewed-on: https://gerrit.libreoffice.org/74860
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 
Reviewed-on: https://gerrit.libreoffice.org/74872
Tested-by: Muhammet Kara 

diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 91c9bcf9090a..831c7f4c2a3e 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -170,7 +170,7 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 if( rMarkList.GetMark(0) != nullptr )
 {
 SdrObject* pObj = 
rMarkList.GetMark(0)->GetMarkedSdrObj();
-ScopedVclPtr pDlg;
+VclPtr pDlg;
 bool bCaption = false;
 
 // Allowed anchorages:
@@ -189,7 +189,7 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
 VclPtr pCaptionDlg =
 pFact->CreateCaptionDialog( 
rReq.GetFrameWeld(), pSdrView, nAllowedAnchors );
-pDlg.disposeAndReset(pCaptionDlg);
+pDlg.reset(pCaptionDlg);
 pCaptionDlg->SetValidateFramePosLink( LINK(this, 
SwDrawBaseShell, ValidatePosition) );
 }
 else
@@ -197,7 +197,7 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
 VclPtr pTransform =
 
pFact->CreateSvxTransformTabDialog(rReq.GetFrameWeld(), nullptr, pSdrView, 
nAllowedAnchors);
-pDlg.disposeAndReset(pTransform);
+pDlg.reset(pTransform);
 pTransform->SetValidateFramePosLink( LINK(this, 
SwDrawBaseShell, ValidatePosition) );
 }
 SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
@@ -237,99 +237,111 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 
 pDlg->SetInputSet(  );
 
-if (pDlg->Execute() == RET_OK)
-{
-const SfxItemSet* pOutSet = 
pDlg->GetOutputItemSet();
-pSh->StartAllAction();
+pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+if (nResult == RET_OK)
+{
+SwFormatVertOrient 
aVOrientFinal(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));
+SwFormatHoriOrient 
aHOrientFinal(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT));
 
-// #i30451#
-pSh->StartUndo(SwUndoId::INSFMTATTR);
+const SfxItemSet* pOutSet = 
pDlg->GetOutputItemSet();
+pSh->StartAllAction();
 
-pSdrView->SetGeoAttrToMarked(*pOutSet);
+// #i30451#
+pSh->StartUndo(SwUndoId::INSFMTATTR);
 
-if (bCaption)
-pSdrView->SetAttributes(*pOutSet);
+pSdrView->SetGeoAttrToMarked(*pOutSet);
 
-bool bPosCorr =
-SfxItemState::SET != pOutSet->GetItemState(
-SID_ATTR_TRANSFORM_POS_X, false ) &&
-SfxItemState::SET != pOutSet->GetItemState(
-SID_ATTR_TRANSFORM_POS_Y, false );
+if (bCaption)
+pSdrView->SetAttributes(*pOutSet);
 
-SfxItemSet aFrameAttrSet(GetPool(), 
svl::Items{});
+bool bPosCorr =
+SfxItemState::SET != pOutSet->GetItemState(
+SID_ATTR_TRANSFORM_POS_X, false ) &&
+SfxItemState::SET != pOutSet->GetItemState(
+SID_ATTR_TRANSFORM_POS_Y, false );
 
-bool bSingleSelection = rMarkList.GetMarkCount() 
== 1;
+ 

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

2019-06-29 Thread Muhammet Kara (via logerrit)
 sw/source/uibase/shells/drwbassh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 171118e14977cc3b8184f38daa447c660c37517b
Author: Muhammet Kara 
AuthorDate: Thu Jun 27 23:10:16 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Jun 29 14:02:03 2019 +0200

Give a parent to the Position and Size (Transform) dialog

So that it can be used on lool side

Change-Id: If4b4e286f2f21ed8a5e9907f182878690c65bf5a
Reviewed-on: https://gerrit.libreoffice.org/74824
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 
Reviewed-on: https://gerrit.libreoffice.org/74871
Tested-by: Muhammet Kara 

diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 6c77a0dc1eab..91c9bcf9090a 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -188,7 +188,7 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 {
 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
 VclPtr pCaptionDlg =
-pFact->CreateCaptionDialog( nullptr, 
pSdrView, nAllowedAnchors );
+pFact->CreateCaptionDialog( 
rReq.GetFrameWeld(), pSdrView, nAllowedAnchors );
 pDlg.disposeAndReset(pCaptionDlg);
 pCaptionDlg->SetValidateFramePosLink( LINK(this, 
SwDrawBaseShell, ValidatePosition) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits