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

2018-01-15 Thread Stephan Bergmann
 onlineupdate/source/update/updater/bspatch.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 337f8922edbdae7cb3e6659ea6bf3bde9ba8adb0
Author: Stephan Bergmann 
Date:   Tue Jan 16 08:51:10 2018 +0100

Missing include

Change-Id: Id5c7ff8b9d342b557bc87b1ac6f3e2fbc8437d69

diff --git a/onlineupdate/source/update/updater/bspatch.cxx 
b/onlineupdate/source/update/updater/bspatch.cxx
index 10ec56200511..b77d3ea1097b 100644
--- a/onlineupdate/source/update/updater/bspatch.cxx
+++ b/onlineupdate/source/update/updater/bspatch.cxx
@@ -32,6 +32,7 @@
 #include "bspatch.h"
 #include "errors.h"
 
+#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: 2 commits - include/svtools include/vcl

2018-01-15 Thread Stephan Bergmann
 include/svtools/imapobj.hxx |1 -
 include/vcl/gdimtf.hxx  |1 -
 2 files changed, 2 deletions(-)

New commits:
commit 420059de8576693b23661c64e55792ae992780ef
Author: Stephan Bergmann 
Date:   Mon Jan 15 21:35:32 2018 +0100

Remove unused GDI_METAFILE_LABEL_NOTFOUND

...unused since 22bd00fa7f6b90964e5eca03c314cdfa7ac2be12 "remove unused 
#defines
METAFILE_END and METAFILE_LABEL_NOTFOUND"

Change-Id: Ia9bcd4100f03c12c8e97b57cbfabfbf634248014
Reviewed-on: https://gerrit.libreoffice.org/47918
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 6785a7b9e3c3..2a0baaded027 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -41,7 +41,6 @@ class Gradient;
 
 
 #define GDI_METAFILE_END(size_t(0x))
-#define GDI_METAFILE_LABEL_NOTFOUND ((size_t)0x)
 
 enum class MtfConversion
 {
commit 6c5a1601d2ef47723a130e73953dd569f2cc856f
Author: Stephan Bergmann 
Date:   Mon Jan 15 21:19:39 2018 +0100

Remove unused IMAP_OBJ_NONE

...no other traces of it apart from its definition in
2351b6d4ba452ed9a261541cd8581ad43788d4db "INTEGRATION: CWS hedaburemove01:
 #72503# get rid of hedabu procedure: Moving headers to svtools/inc/svtools 
and
correspondent necessary changes"

Change-Id: I8a919b35f90acde5a72616b311a3e66c591c1e36
Reviewed-on: https://gerrit.libreoffice.org/47917
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/svtools/imapobj.hxx b/include/svtools/imapobj.hxx
index 04da290dda0d..9e396842ccf8 100644
--- a/include/svtools/imapobj.hxx
+++ b/include/svtools/imapobj.hxx
@@ -28,7 +28,6 @@ class Point;
 namespace tools { class Rectangle; }
 class SvStream;
 
-#define IMAP_OBJ_NONE   ((sal_uInt16)0x)
 #define IMAP_OBJ_RECTANGLE  (sal_uInt16(0x0001))
 #define IMAP_OBJ_CIRCLE (sal_uInt16(0x0002))
 #define IMAP_OBJ_POLYGON(sal_uInt16(0x0003))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Pranav Kant
 cui/source/dialogs/cuicharmap.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f1ec1b1f6e24fce5e496fd7c97c93884068dfba2
Author: Pranav Kant 
Date:   Tue Jan 16 12:27:56 2018 +0530

svx: chain up correctly for SvxCharacterMap::Execute()

Change-Id: I2ff70f7b2ade8e2aad96cff31bd313822779094c

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index ef849a56f8d6..77df333aa0c4 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -172,7 +172,7 @@ short SvxCharacterMap::Execute()
 m_pOKBtn->Enable();
 }
 
-return ModalDialog::Execute();
+return SfxModalDialog::Execute();
 }
 
 void SvxCharacterMap::dispose()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: download.lst external/harfbuzz

2018-01-15 Thread Khaled Hosny
 download.lst  |4 
 external/harfbuzz/UnpackedTarball_harfbuzz.mk |2 
 external/harfbuzz/revert-make-inert.patch |  200 --
 3 files changed, 2 insertions(+), 204 deletions(-)

New commits:
commit 3b773d5b41628c1ccf52bdd0d7962183d54c4138
Author: Khaled Hosny 
Date:   Mon Jan 15 15:22:13 2018 +0200

Upload HarfBuzz 1.7.4

Change-Id: I7dd1f87dc95d0fb190755a8742d28ef8679d7b1e
Reviewed-on: https://gerrit.libreoffice.org/47897
Tested-by: Jenkins 
Reviewed-by: Khaled Hosny 

diff --git a/download.lst b/download.lst
index f574617147c9..ae825299d6cf 100644
--- a/download.lst
+++ b/download.lst
@@ -94,8 +94,8 @@ export GPGME_SHA256SUM := 
1b29fedb8bfad775e70eafac5b0590621683b2d9869db994568e64
 export GPGME_TARBALL := gpgme-1.9.0.tar.bz2
 export GRAPHITE_SHA256SUM := 
aa5e58356cd084000609ebbd93fef456a1bc0ab9e46fea20e81552fb286232a9
 export GRAPHITE_TARBALL := graphite2-minimal-1.3.10.tgz
-export HARFBUZZ_SHA256SUM := 
042742d6ec67bc6719b69cf38a3fba24fbd120e207e3fdc18530dc730fb6a029
-export HARFBUZZ_TARBALL := harfbuzz-1.7.0.tar.bz2
+export HARFBUZZ_SHA256SUM := 
b5d6ac8415f97f3540d73f3f91c41c5c10f8a4d76350f11a7184062aae88ac0b
+export HARFBUZZ_TARBALL := harfbuzz-1.7.4.tar.bz2
 export HSQLDB_SHA256SUM := 
d30b13f4ba2e3b6a2d4f020c0dee0a9fb9fc6fbcc2d561f36b78da4bf3802370
 export HSQLDB_TARBALL := 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
 export HUNSPELL_SHA256SUM := 
3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce180cac4d6f4c4
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk 
b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 537862531bfd..8ec1c8d3ab23 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -17,8 +17,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
 external/harfbuzz/clang-cl.patch \
-external/harfbuzz/ubsan.patch \
-   external/harfbuzz/revert-make-inert.patch \
 ))
 
 ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
diff --git a/external/harfbuzz/revert-make-inert.patch 
b/external/harfbuzz/revert-make-inert.patch
deleted file mode 100644
index 366750d87fb9..
--- a/external/harfbuzz/revert-make-inert.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-From 93f7c1652a05e806c2e3ac7edf498d2f4a508a3a Mon Sep 17 00:00:00 2001
-From: Behdad Esfahbod 
-Date: Tue, 14 Nov 2017 10:59:54 -0800
-Subject: [PATCH] Revert "[glib/ucdn/icu/ft/ot] Make returned funcs inert"
-
-This reverts commit 5daf3bd4494cce6b4fb074533be9e99c4d9e0edd.
-
-If other atexit callbacks try to destruct the objects we destruct
-in atexit callbacks, bad things will happen.
-
-I'll come up with some other way to catch premature destruction
-of HB-owned objects.
-
-Fixes https://github.com/behdad/harfbuzz/issues/618

- src/hb-ft.cc |  3 ---
- src/hb-glib.cc   |  3 ---
- src/hb-icu.cc|  3 ---
- src/hb-object-private.hh | 37 ++---
- src/hb-ot-font.cc|  3 ---
- src/hb-ucdn.cc   |  3 ---
- 6 files changed, 6 insertions(+), 46 deletions(-)
-
-diff --git src/hb-ft.cc src/hb-ft.cc
-index 68c774547..0f15f8c3d 100644
 src/hb-ft.cc
-+++ src/hb-ft.cc
-@@ -423,7 +423,6 @@ static hb_font_funcs_t *static_ft_funcs = nullptr;
- static
- void free_static_ft_funcs (void)
- {
--  hb_object_undo_inert (static_ft_funcs);
-   hb_font_funcs_destroy (static_ft_funcs);
- }
- #endif
-@@ -454,10 +453,8 @@ _hb_ft_font_set_funcs (hb_font_t *font, FT_Face ft_face, 
bool unref)
- hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, 
nullptr, nullptr);
- 
- hb_font_funcs_make_immutable (funcs);
--hb_object_make_inert (funcs);
- 
- if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, nullptr, funcs)) {
--  hb_object_undo_inert (funcs);
-   hb_font_funcs_destroy (funcs);
-   goto retry;
- }
-diff --git src/hb-glib.cc src/hb-glib.cc
-index 31de68e86..50c30e9c7 100644
 src/hb-glib.cc
-+++ src/hb-glib.cc
-@@ -370,7 +370,6 @@ static hb_unicode_funcs_t *static_glib_funcs = nullptr;
- static
- void free_static_glib_funcs (void)
- {
--  hb_object_undo_inert (static_glib_funcs);
-   hb_unicode_funcs_destroy (static_glib_funcs);
- }
- #endif
-@@ -391,10 +390,8 @@ hb_glib_get_unicode_funcs (void)
- #undef HB_UNICODE_FUNC_IMPLEMENT
- 
- hb_unicode_funcs_make_immutable (funcs);
--hb_object_make_inert (funcs);
- 
- if (!hb_atomic_ptr_cmpexch (&static_glib_funcs, nullptr, funcs)) {
--  hb_object_undo_inert (funcs);
-   hb_unicode_funcs_destroy (funcs);
-   goto retry;
- }
-diff --git src/hb-icu.cc src/hb-icu.cc
-index 44a198937..552eaeca5 100644
 src/hb-icu.cc
-+++ src/hb-icu.cc
-@@ -351,7 +351,6 @@ static hb_unicode_funcs_t *static_icu_funcs = nullptr;
- static
- void free_static_icu_funcs (void)
- {
--  hb_object_undo_inert (static_icu_funcs);
-   hb_unicode_funcs_de

Re: Infra call on Tue, Jan 16 at 17:30 UTC

2018-01-15 Thread Guilhem Moulin
On Tue, 09 Jan 2018 at 18:47:41 +0100, Guilhem Moulin wrote:
> The next infra call will take place at `date -d 'Tue Jan 16 17:30:00 UTC 
> 2018'`
> (18:30:00 Berlin time).
> 
> See https://pad.documentfoundation.org/p/infra for details; agenda TBA.

Reminder: that's tomorrow!

-- 
Guilhem.


signature.asc
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'private/bansan/chardraw' - cui/source cui/uiconfig

2018-01-15 Thread Vincent Le Garrec
 cui/source/dialogs/cuicharmap.cxx|   93 +++
 cui/source/inc/cuicharmap.hxx|   24 -
 cui/uiconfig/ui/specialcharacters.ui |6 --
 3 files changed, 118 insertions(+), 5 deletions(-)

New commits:
commit 7fd8902e6b423f76aae473f78b210d175e539433
Author: Vincent Le Garrec 
Date:   Mon Jan 15 23:28:40 2018 +0100

Allow draw symbol with mouse

Use left click to draw black symbol.
Use right click to rub the symbol.

Change-Id: I3cb2155f105452f8b0f92a7fe2873ce98168cf2d

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 4c6a2b3a3d82..7ca01ffba5b1 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -1281,4 +1281,97 @@ void SvxShowText::SetText( const OUString& rText )
 }
 
 
+VCL_BUILDER_FACTORY(DrawingAreaOcr)
+
+void DrawingAreaOcr::MouseButtonDown (const MouseEvent &rMEvt)
+{
+if (rMEvt.IsLeft())
+{
+state = State::DRAW;
+}
+else if (rMEvt.IsRight())
+{
+state = State::DELETE;
+}
+
+if (state != State::NONE)
+{
+const Point & mouse_pos = rMEvt.GetPosPixel();
+
+data.emplace_back(mouse_pos.X(), mouse_pos.Y(), state);
+}
+}
+
+void DrawingAreaOcr::MouseMove( const MouseEvent &rMEvt )
+{
+const Point & mouse_pos = rMEvt.GetPosPixel();
+
+if (state != State::NONE)
+{
+data.emplace_back(mouse_pos.X(), mouse_pos.Y(), state);
+}
+
+Invalidate();
+Update();
+std::cout << static_cast(state) << std::endl;
+}
+
+void DrawingAreaOcr::MouseButtonUp (const MouseEvent &rMEvt)
+{
+const Point & mouse_pos = rMEvt.GetPosPixel();
+state = State::NONE;
+data.emplace_back(mouse_pos.X(), mouse_pos.Y(), state);
+}
+
+void DrawingAreaOcr::Paint(vcl::RenderContext& rRenderContext, const 
::tools::Rectangle&)
+{
+Color aTextCol = rRenderContext.GetLineColor();
+
+rRenderContext.SetLineColor(Color( COL_WHITE ));
+rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), 
Size(GetOutputSizePixel().Width(), GetOutputSizePixel().Height(;
+
+const auto * i_1 = &data.front();
+basegfx::B2DPolygon aB2DPolyLine;
+for (const auto & i : data)
+{
+if (i_1->state == i.state)
+{
+aB2DPolyLine.append(basegfx::B2DPoint(i.x, i.y));
+}
+else
+{
+if (i_1->state == State::DRAW)
+{
+rRenderContext.SetLineColor(Color( COL_BLACK ));
+rRenderContext.DrawPolyLine(aB2DPolyLine, 10.0);
+}
+else if (i_1->state == State::DELETE)
+{
+rRenderContext.SetLineColor(Color( COL_WHITE ));
+rRenderContext.DrawPolyLine(aB2DPolyLine, 10.0);
+}
+aB2DPolyLine.clear();
+}
+i_1 = &i;
+}
+
+size_t size = data.size();
+if (size >= 2)
+{
+if (data[size-2].state == State::DRAW)
+{
+rRenderContext.SetLineColor(Color( COL_BLACK ));
+rRenderContext.DrawPolyLine(aB2DPolyLine, 10.0);
+}
+else if (data[size-2].state == State::DELETE)
+{
+rRenderContext.SetLineColor(Color( COL_WHITE ));
+rRenderContext.DrawPolyLine(aB2DPolyLine, 10.0);
+}
+aB2DPolyLine.clear();
+}
+
+rRenderContext.SetTextLineColor(aTextCol);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 7e2619efc10b..752678e1ad91 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -39,6 +39,28 @@ namespace svx
 struct SvxShowCharSetItem;
 }
 
+class DrawingAreaOcr : public Control
+{
+public:
+DrawingAreaOcr(vcl::Window* pParent) : Control(pParent, WB_BORDER), 
state(State::NONE) {}
+void MouseButtonDown (const MouseEvent &rMEvt) override;
+void MouseMove( const MouseEvent &rMEvt ) override;
+void MouseButtonUp (const MouseEvent &rMEvt) override;
+void Paint( vcl::RenderContext& rRenderContext, const ::tools::Rectangle& 
) override;
+
+private:
+enum class State {DRAW, DELETE, NONE};
+State state;
+struct DrawPoint
+{
+int x;
+int y;
+State state;
+DrawPoint(int x_, int y_, State state_) : x(x_), y(y_), state(state_) 
{};
+};
+std::vector data;
+};
+
 class SvxShowText : public Control
 {
 public:
@@ -79,7 +101,7 @@ private:
 VclPtrm_pSubsetLB;
 VclPtrm_pShowChar;
 VclPtr   m_pDrawChk;
-VclPtrm_pDrawingArea;
+VclPtr m_pDrawingArea;
 VclPtr   m_pSearchText;
 VclPtr   m_pHexCodeText;
 VclPtr   m_pDecimalCodeText;
diff --git a/cui/uiconfig/ui/specialcharacters.ui 
b/cui/uiconfig/ui/specialcharacters.ui
index ca21156de36c..9067d6fbb163 100644
--- a/cui/uiconfig/ui/specialcharacters.ui
+++ b/cui/uiconfig/ui/specialcharacters.ui
@@ -202,17 

[Libreoffice-commits] core.git: Branch 'private/bansan/chardraw' - 2 commits - cui/source cui/uiconfig

2018-01-15 Thread Vincent Le Garrec
 cui/source/dialogs/cuicharmap.cxx|   19 ++
 cui/source/inc/cuicharmap.hxx|3 ++
 cui/uiconfig/ui/specialcharacters.ui |   47 +--
 3 files changed, 62 insertions(+), 7 deletions(-)

New commits:
commit 98a44dbadab9fee22ddebebb0b3e08691b818021
Author: Vincent Le Garrec 
Date:   Mon Jan 15 23:20:29 2018 +0100

Add event to draw checkbox

When box is checked, the drawingarea is visible instead of the showchar.

Change-Id: I1f1219eb0087a8aff4d70c856c4b2823249b0ceb

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index ef849a56f8d6..4c6a2b3a3d82 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -64,6 +64,8 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, const 
SfxItemSet* pSet,
 get(m_pShowSet, "showcharset");
 get(m_pSearchSet, "searchcharset");
 get(m_pShowChar, "showchar");
+get(m_pDrawChk, "drawcheckbutton");
+get(m_pDrawingArea, "drawingarea");
 m_pShowChar->SetCentered(true);
 if (m_bHasInsert) get(m_pOKBtn, "insert");
 else get(m_pOKBtn, "ok");
@@ -188,6 +190,8 @@ void SvxCharacterMap::dispose()
 m_pSubsetText.clear();
 m_pSubsetLB.clear();
 m_pShowChar.clear();
+m_pDrawChk.clear();
+m_pDrawingArea.clear();
 m_pHexCodeText.clear();
 m_pDecimalCodeText.clear();
 m_pCharName.clear();
@@ -486,6 +490,8 @@ void SvxCharacterMap::init()
 m_pShowSet->SetPreSelectHdl( LINK( this, SvxCharacterMap, CharPreSelectHdl 
) );
 m_pShowSet->SetFavClickHdl( LINK( this, SvxCharacterMap, FavClickHdl ) );
 
+m_pDrawChk->SetClickHdl( LINK( this, SvxCharacterMap, DrawToggleHdl ) );
+
 m_pSearchSet->SetDoubleClickHdl( LINK( this, SvxCharacterMap, 
SearchCharDoubleClickHdl ) );
 m_pSearchSet->SetSelectHdl( LINK( this, SvxCharacterMap, 
SearchCharSelectHdl ) );
 m_pSearchSet->SetHighlightHdl( LINK( this, SvxCharacterMap, 
SearchCharHighlightHdl ) );
@@ -939,6 +945,19 @@ IMPL_LINK_NOARG(SvxCharacterMap, InsertClickHdl, Button*, 
void)
EndDialog(RET_OK);
 }
 
+IMPL_LINK_NOARG(SvxCharacterMap, DrawToggleHdl, Button*, void)
+{
+if (m_pDrawChk->IsChecked())
+{
+m_pDrawingArea->Show();
+m_pShowChar->Hide();
+}
+else
+{
+m_pDrawingArea->Hide();
+m_pShowChar->Show();
+}
+}
 
 IMPL_STATIC_LINK(SvxCharacterMap, LoseFocusHdl, Control&, pItem, void)
 {
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index b1a06b4540e3..7e2619efc10b 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -78,6 +78,8 @@ private:
 VclPtr  m_pSubsetText;
 VclPtrm_pSubsetLB;
 VclPtrm_pShowChar;
+VclPtr   m_pDrawChk;
+VclPtrm_pDrawingArea;
 VclPtr   m_pSearchText;
 VclPtr   m_pHexCodeText;
 VclPtr   m_pDecimalCodeText;
@@ -105,6 +107,7 @@ private:
 DECL_LINK(SubsetSelectHdl, ListBox&, void);
 DECL_LINK(CharDoubleClickHdl, SvxShowCharSet*,void);
 DECL_LINK(CharSelectHdl, SvxShowCharSet*, void);
+DECL_LINK(DrawToggleHdl, Button*, void);
 DECL_LINK(CharHighlightHdl, SvxShowCharSet*, void);
 DECL_LINK(CharPreSelectHdl, SvxShowCharSet*, void);
 DECL_LINK(FavClickHdl, SvxShowCharSet*,void);
commit c61d6a88c0f991b70c4bf19466eb671523f84aae
Author: Vincent Le Garrec 
Date:   Mon Jan 15 23:16:41 2018 +0100

Add draw functions to specialchar ui

Change-Id: I6b732127cdd48b5e0acf8c409d586426d9b13c8e

diff --git a/cui/uiconfig/ui/specialcharacters.ui 
b/cui/uiconfig/ui/specialcharacters.ui
index 09a18b37b90a..ca21156de36c 100644
--- a/cui/uiconfig/ui/specialcharacters.ui
+++ b/cui/uiconfig/ui/specialcharacters.ui
@@ -202,6 +202,22 @@
   
 
 
+  
+80
+150
+False
+True
+True
+True
+  
+  
+False
+True
+0
+1
+  
+
+
   
 True
 False
@@ -212,7 +228,7 @@
   
   
 0
-1
+2
   
 
 
@@ -224,6 +240,23 @@
 6
 True
 
+  
+Draw
+True
+True
+False
+True
+start
+0
+True
+  
+  
+0
+0
+2
+  

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

2018-01-15 Thread Jan Holesovsky
 include/vcl/dialog.hxx|4 -
 vcl/inc/svdata.hxx|2 
 vcl/source/app/svmain.cxx |2 
 vcl/source/uitest/uitest.cxx  |4 -
 vcl/source/window/dialog.cxx  |   95 --
 vcl/source/window/winproc.cxx |6 +-
 6 files changed, 46 insertions(+), 67 deletions(-)

New commits:
commit 1a156644e27a380daed217707a9cff9319f70a49
Author: Jan Holesovsky 
Date:   Mon Jan 15 19:56:52 2018 +0100

vcl: No need for a double-linked list of dialogs in Execute().

Instead use a simple vector.

Change-Id: I50652468cf06ba681d5caccb74a52b32c6c507a0
Reviewed-on: https://gerrit.libreoffice.org/47910
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 6dea53f47058..7fe00ba1c8c3 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -45,9 +45,7 @@ public:
 };
 
 private:
-VclPtr  mpPrevExecuteDlg;
-VclPtr  mpNextExecuteDlg;
-std::unique_ptr mpDialogImpl;
+std::unique_ptr mpDialogImpl;
 longmnMousePositioned;
 boolmbInExecute;
 boolmbInClose;
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index c88f8a4ce356..7949de3c0861 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -204,7 +204,7 @@ struct ImplSVWinData
 VclPtr mpCaptureWin;   // window, that 
has the mouse capture
 VclPtr mpLastDeacWin;  // Window, that 
need a deactivate (FloatingWindow-Handling)
 VclPtr  mpFirstFloat;   // First 
FloatingWindow in PopupMode
-VclPtr  mpLastExecuteDlg;   // First Dialog 
that is in Execute
+std::vector> mpExecuteDialogs;   ///< Stack of 
dialogs that are Execute()'d - the last one is the top most one.
 VclPtr mpExtTextInputWin;  // Window, which 
is in ExtTextInput
 VclPtr mpTrackWin; // window, that is 
in tracking mode
 AutoTimer*  mpTrackTimer = nullptr; // tracking timer
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 10d65ad2802c..500eb3060c19 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -606,7 +606,7 @@ void DeInitVCL()
 pSVData->maWinData.mpCaptureWin = nullptr;
 pSVData->maWinData.mpLastDeacWin = nullptr;
 pSVData->maWinData.mpFirstFloat = nullptr;
-pSVData->maWinData.mpLastExecuteDlg = nullptr;
+pSVData->maWinData.mpExecuteDialogs.clear();
 pSVData->maWinData.mpExtTextInputWin = nullptr;
 pSVData->maWinData.mpTrackWin = nullptr;
 pSVData->maWinData.mpAutoScrollWin = nullptr;
diff --git a/vcl/source/uitest/uitest.cxx b/vcl/source/uitest/uitest.cxx
index 3234108ca7ed..658b8cf75a82 100644
--- a/vcl/source/uitest/uitest.cxx
+++ b/vcl/source/uitest/uitest.cxx
@@ -38,9 +38,9 @@ std::unique_ptr UITest::getFocusTopWindow()
 ImplSVData* pSVData = ImplGetSVData();
 ImplSVWinData& rWinData = pSVData->maWinData;
 
-if (rWinData.mpLastExecuteDlg)
+if (!rWinData.mpExecuteDialogs.empty())
 {
-return 
rWinData.mpLastExecuteDlg->GetUITestFactory()(rWinData.mpLastExecuteDlg);
+return 
rWinData.mpExecuteDialogs.back()->GetUITestFactory()(rWinData.mpExecuteDialogs.back());
 }
 
 return rWinData.mpFirstFrame->GetUITestFactory()(rWinData.mpFirstFrame);
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index b2f97bdcd081..972b6671f0ed 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -350,8 +350,6 @@ struct DialogImpl
 void Dialog::ImplInitDialogData()
 {
 mpWindowImpl->mbDialog  = true;
-mpPrevExecuteDlg= nullptr;
-mpNextExecuteDlg= nullptr;
 mbInExecute = false;
 mbInClose   = false;
 mbModalMode = false;
@@ -373,19 +371,17 @@ vcl::Window* Dialog::GetDefaultParent(WinBits nStyle)
 if (pParent && (!pParent->IsInputEnabled() || pParent->IsInModalMode()))
 {
 ImplSVData* pSVData = ImplGetSVData();
-Dialog* pExeDlg = pSVData->maWinData.mpLastExecuteDlg;
-while (pExeDlg)
+auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+for (auto it = rExecuteDialogs.rbegin(); it != rExecuteDialogs.rend(); 
++it)
 {
 // only if visible and enabled
-if (pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild(pExeDlg, 
true) &&
-pExeDlg->IsReallyVisible() &&
-pExeDlg->IsEnabled() && pExeDlg->IsInputEnabled() && 
!pExeDlg->IsInModalMode())
+if (pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild(*it, 
true) &&
+(*it)->IsReallyVisible() &&
+(*it)->IsEnabled() && (*it)->IsInputEnabled() && 
!(*it)->IsInModalMode())
 {
-pParent = pExeDlg;
+pParent = it->get();
 bre

[Libreoffice-commits] core.git: 2 commits - include/sfx2 include/sot

2018-01-15 Thread Stephan Bergmann
 include/sfx2/thumbnailview.hxx |1 -
 include/sot/exchange.hxx   |5 -
 2 files changed, 6 deletions(-)

New commits:
commit f2e3d8d34b3d3993d46e38c660a60cdfc7950090
Author: Stephan Bergmann 
Date:   Mon Jan 15 20:42:54 2018 +0100

Remove unused EXCHG_OUT_ACTION_*

..._INSERT_BOOKMARK and ..._MOVE_FILE unused since
ef80b69819cbf9618041350b46ce4db892e42a80 "remve all the old/not used 
destination
defines", and no other traces of ..._INSERT_OBJ, ..._MOVE_FILELIST,
..._UPDATE_RANGE use apart from their definitions in
f108f9423b744fb97557539530f901962efbd8d0 "INTEGRATION: CWS hedaburemove01:
 #72503# get rid of hedabu procedure: Moving headers to sot/inc/sot and
correspondent necessary changes"

Change-Id: Ia352add990d120b8b7562c62f2f2ca8afda92f47
Reviewed-on: https://gerrit.libreoffice.org/47914
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/sot/exchange.hxx b/include/sot/exchange.hxx
index aed90f28a82f..3ea611799506 100644
--- a/include/sot/exchange.hxx
+++ b/include/sot/exchange.hxx
@@ -54,17 +54,12 @@ SOT_DLLPUBLIC bool IsFormatSupported( const 
DataFlavorExVector& rDataFlavorExVec
 #define EXCHG_IN_ACTION_MOVE
(sal_uInt8(css::datatransfer::dnd::DNDConstants::ACTION_MOVE))
 #define EXCHG_IN_ACTION_COPY
(sal_uInt8(css::datatransfer::dnd::DNDConstants::ACTION_COPY))
 #define EXCHG_IN_ACTION_LINK
(sal_uInt8(css::datatransfer::dnd::DNDConstants::ACTION_LINK))
-#define EXCHG_OUT_ACTION_INSERT_OBJ ((sal_uInt8)17)
-#define EXCHG_OUT_ACTION_INSERT_BOOKMARK((sal_uInt8)18)
 #define EXCHG_OUT_ACTION_INSERT_FILE(sal_uInt8(20))
 #define EXCHG_OUT_ACTION_INSERT_IMAGEMAP(sal_uInt8(22))
 #define EXCHG_OUT_ACTION_INSERT_OLE (sal_uInt8(23))
 #define EXCHG_OUT_ACTION_INSERT_INTERACTIVE (sal_uInt8(24))
 #define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP   (sal_uInt8(29))
 #define EXCHG_OUT_ACTION_GET_ATTRIBUTES (sal_uInt8(30))
-#define EXCHG_OUT_ACTION_MOVE_FILE  ((sal_uInt8)32)
-#define EXCHG_OUT_ACTION_MOVE_FILELIST  ((sal_uInt8)33)
-#define EXCHG_OUT_ACTION_UPDATE_RANGE   ((sal_uInt8)34)
 #define EXCHG_OUT_ACTION_INSERT_PRIVATE (sal_uInt8(35))
 #define EXCHG_OUT_ACTION_INSERT_HTML(sal_uInt8(36))
 #define EXCHG_OUT_ACTION_MOVE_PRIVATE   (sal_uInt8(37))
commit 84184cc396ce11389e0e93f649c9320b14710bb4
Author: Stephan Bergmann 
Date:   Mon Jan 15 20:18:55 2018 +0100

Remove unused THUMBNAILVIEW_APPEND

...unused since 6affa4be69aa31e27af9d50e9ab6bd740319c379 "callcatcher: 
update
list, stop hiding uncalled tests :-)"

Change-Id: I0a5a7ed3be508703887f00750e11b811162e6fc3
Reviewed-on: https://gerrit.libreoffice.org/47912
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 7b1face96c87..e3cbca77ec0a 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -156,7 +156,6 @@ namespace drawinglayer {
 
 /* ThumbnailView types */
 
-#define THUMBNAILVIEW_APPEND ((sal_uInt16)-1)
 #define THUMBNAILVIEW_ITEM_NOTFOUND  (sal_uInt16(-1))
 
 // Display all the available items in the thumbnail.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Mert Tümer
 android/source/res/values/strings.xml |2 +
 android/source/res/xml/libreoffice_preferences.xml|5 ++
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   17 
+-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 2733ca6c0aed6468c26fd7a80b0b50e32fd608c4
Author: Mert Tümer 
Date:   Mon Jan 8 13:15:21 2018 +0300

tdf#103083 option to show/hide hidden files/folders on Android

The patch was sent for the ULAKBIM/PARDUS project.
Signed-off-by: Mert Tümer 

Change-Id: Iadbb688a1a976279b23d246001818ac1c21b3d47
Reviewed-on: https://gerrit.libreoffice.org/47637
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/android/source/res/values/strings.xml 
b/android/source/res/values/strings.xml
index 1fb23a528c06..9b6ff7abff9c 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -49,6 +49,8 @@
 General
 Experimental Mode
 Enable the experimental 
editing mode. Use at your own risk.
+Hidden Files/Folders
+Enable to show hidden 
files/folders
 
 About
 Parts
diff --git a/android/source/res/xml/libreoffice_preferences.xml 
b/android/source/res/xml/libreoffice_preferences.xml
index 347709b7d017..17236434daa2 100644
--- a/android/source/res/xml/libreoffice_preferences.xml
+++ b/android/source/res/xml/libreoffice_preferences.xml
@@ -20,6 +20,11 @@
 android:title="File explorer layout"
 android:key="EXPLORER_VIEW_TYPE"
 android:summary="View files as a grid or in a list." />
+
 
  paths = 
currentDirectory.listFiles(FileUtilities
 .getFileFilter(filterMode));
+filePaths = new ArrayList();
+for(IFile file: paths) {
+if(showHiddenFiles){
+filePaths.add(file);
+} else {
+if(!file.getName().startsWith(".")){
+filePaths.add(file);
+}
+}
+}
 }
 catch (final RuntimeException e) {
 final Activity activity = LibreOfficeUIActivity.this;
@@ -813,6 +825,7 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
 SharedPreferences defaultPrefs = 
PreferenceManager.getDefaultSharedPreferences(getBaseContext());
 viewMode = 
Integer.valueOf(defaultPrefs.getString(EXPLORER_VIEW_TYPE_KEY, ""+ GRID_VIEW));
 filterMode = Integer.valueOf(defaultPrefs.getString(FILTER_MODE_KEY , 
"-1"));
+showHiddenFiles = 
Boolean.valueOf(defaultPrefs.getBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, false));
 
 Intent i = this.getIntent();
 if (i.hasExtra(CURRENT_DIRECTORY_KEY)) {
@@ -850,6 +863,7 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
 outState.putInt(FILTER_MODE_KEY, filterMode);
 outState.putInt(EXPLORER_VIEW_TYPE_KEY , viewMode);
 outState.putInt(DOC_PROVIDER_KEY, documentProvider.getId());
+outState.putBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY , showHiddenFiles);
 
 Log.d(LOGTAG, currentDirectory.toString() + 
Integer.toString(filterMode) + Integer.toString(viewMode));
 //prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
@@ -876,6 +890,7 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
 }
 filterMode = savedInstanceState.getInt(FILTER_MODE_KEY, 
FileUtilities.ALL);
 viewMode = savedInstanceState.getInt(EXPLORER_VIEW_TYPE_KEY, 
GRID_VIEW);
+showHiddenFiles = 
savedInstanceState.getBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, false);
 //openDirectory(currentDirectory);
 Log.d(LOGTAG, "onRestoreInstanceState");
 Log.d(LOGTAG, currentDirectory.toString() + 
Integer.toString(filterMode) + Integer.toString(viewMode));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Mert Tümer
 android/source/res/layout/activity_document_browser.xml   |9 
+
 android/source/res/values/strings.xml |1 +
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |5 
-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 55ecc98376dbeffc366820e718fd906b8935a17b
Author: Mert Tümer 
Date:   Mon Jan 8 12:52:01 2018 +0300

tdf#89639 added path text for the document browser

The patch was sent for the ULAKBIM/PARDUS project.
Signed-off-by: Mert Tümer 

Change-Id: I14ce3bb7c11f4cc2fe9194a99b433764209b1528
Reviewed-on: https://gerrit.libreoffice.org/47635
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/android/source/res/layout/activity_document_browser.xml 
b/android/source/res/layout/activity_document_browser.xml
index fab1b095035e..9f62f5f22a3e 100644
--- a/android/source/res/layout/activity_document_browser.xml
+++ b/android/source/res/layout/activity_document_browser.xml
@@ -86,6 +86,15 @@
 android:padding="16dp"
 android:textStyle="bold" />
 
+
+
 
 
 Go
 Choose Directory
 Invalid directory path
+Current Directory:
 
 
 Save the document before 
closing?
diff --git 
a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java 
b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 786b949bb504..530644667aa9 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -464,12 +464,15 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
 findViewById(R.id.header_browser).setVisibility((View.VISIBLE));
 findViewById(R.id.header_recents).setVisibility((View.VISIBLE));
 actionBar.setTitle(R.string.app_name);
+findViewById(R.id.text_directory_path).setVisibility(View.GONE);
 } else {
 recentRecyclerView.setVisibility(View.GONE);
 findViewById(R.id.header_browser).setVisibility((View.GONE));
 findViewById(R.id.header_recents).setVisibility((View.GONE));
 actionBar.setTitle(dir.getName());
-
+findViewById(R.id.text_directory_path).setVisibility(View.VISIBLE);
+
((TextView)findViewById(R.id.text_directory_path)).setText(getString(R.string.current_dir)
 +
+" " + dir.getUri().getPath());
 }
 
 new AsyncTask() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Jim Raykowski
 include/svtools/treelistbox.hxx   |2 +-
 svtools/source/contnr/treelistbox.cxx |2 +-
 sw/source/uibase/utlui/content.cxx|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 77acf66a3414c46edecfbc04b65e4a507eb857cb
Author: Jim Raykowski 
Date:   Sun Jan 14 11:24:10 2018 -0900

change Not to Dont in tdf#36308 fix

Change-Id: I05806eea3363b7363d7a377277c63785aadc5386
Reviewed-on: https://gerrit.libreoffice.org/47870
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 12bfa4a11439..adf8a079a2a2 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -649,7 +649,7 @@ public:
 
 voidSetSublistOpenWithReturn();  // open/close sublist 
with return/enter
 voidSetSublistOpenWithLeftRight();   // open/close sublist 
with cursor left/right
-voidSetSublistNotOpenWithDoubleClick(); // do not open/close 
sublist with mouse double click on entry
+voidSetSublistDontOpenWithDoubleClick(); // do not open/close 
sublist with mouse double click on entry
 
 voidEnableInplaceEditing( bool bEnable );
 // Edits the Entry's first StringItem, 0 == Cursor
diff --git a/svtools/source/contnr/treelistbox.cxx 
b/svtools/source/contnr/treelistbox.cxx
index 5f1c37606785..1a8c07d521a6 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1434,7 +1434,7 @@ void SvTreeListBox::SetSublistOpenWithLeftRight()
 pImpl->bSubLstOpLR = true;
 }
 
-void SvTreeListBox::SetSublistNotOpenWithDoubleClick()
+void SvTreeListBox::SetSublistDontOpenWithDoubleClick()
 {
 pImpl->bSubLstOpDblClick = false;
 }
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index f58c15a6e358..df7f1bbb29c1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -858,7 +858,7 @@ SwContentTree::SwContentTree(vcl::Window* pParent, 
SwNavigationPI* pDialog)
 , m_bViewHasChanged(false)
 , m_bIsKeySpace(false)
 {
-SetSublistNotOpenWithDoubleClick();
+SetSublistDontOpenWithDoubleClick();
 SetHelpId(HID_NAVIGATOR_TREELIST);
 
 SetNodeDefaultImages();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sw/qa sw/source

2018-01-15 Thread Serge Krot
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx |   51 +-
 sw/source/filter/xml/xmlimp.cxx|  240 
+++---
 sw/source/filter/xml/xmlimp.hxx|1 
 4 files changed, 228 insertions(+), 64 deletions(-)

New commits:
commit 1b04fae2b10d258d71e9e29ea659495b6d949367
Author: Serge Krot 
Date:   Fri Jan 12 13:55:59 2018 +0100

tdf#113877 Insert document: merge two lists into one

When inserting a new document into current position we need to
concat to lists into one only when they have the same list
properties.

(cherry picked from commit 311ea730cb225bca167af2e4111445608a14a263)

Change-Id: I2766d5856418338fd5920968ac136899eeac7d74
Reviewed-on: https://gerrit.libreoffice.org/47913
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt
new file mode 100755
index ..47fe7e0760fe
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 39190dffc906..90c13315ad77 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -208,6 +208,7 @@ public:
 void testTdf112025();
 void testTdf114306();
 void testTdf113877();
+void testTdf113877NoMerge();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -315,6 +316,7 @@ public:
 CPPUNIT_TEST(testTdf112025);
 CPPUNIT_TEST(testTdf114306);
 CPPUNIT_TEST(testTdf113877);
+CPPUNIT_TEST(testTdf113877NoMerge);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -3814,6 +3816,8 @@ void SwUiWriterTest::testTdf114306()
 xmlXPathFreeObject(pXmlObj);
 }
 
+// During insert of the document with list inside into the main document 
inside the list
+// we should merge both lists into one, when they have the same list properties
 void SwUiWriterTest::testTdf113877()
 {
 load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
@@ -3831,13 +3835,52 @@ void SwUiWriterTest::testTdf113877()
 lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
 }
 
+const OUString listId1 = getProperty(getParagraph(1), "ListId");
+const OUString listId4 = getProperty(getParagraph(4), "ListId");
+const OUString listId5 = getProperty(getParagraph(5), "ListId");
+const OUString listId6 = getProperty(getParagraph(6), "ListId");
+const OUString listId7 = getProperty(getParagraph(7), "ListId");
+
+// the initial list with 4 list items
+CPPUNIT_ASSERT_EQUAL(listId1, listId4);
+
+// the last of the first list, and the first of the inserted list
+CPPUNIT_ASSERT_EQUAL(listId4, listId5);
+CPPUNIT_ASSERT_EQUAL(listId5, listId6);
+CPPUNIT_ASSERT_EQUAL(listId6, listId7);
+}
+
+// The same test as testTdf113877() but merging of two list should not be 
performed.
+void SwUiWriterTest::testTdf113877NoMerge()
+{
+load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+
+// set a page cursor into the end of the document
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+uno::Reference 
xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+xCursor->jumpToEndOfPage();
+
+// insert the same document at current cursor position
+{
+const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf113877_insert_numbered_list_abcd.odt";
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({ { "Name", 
uno::makeAny(insertFileid) } }));
+lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+}
+
+const OUString listId1 = getProperty(getParagraph(1), "ListId");
+const OUString listId4 = getProperty(getParagraph(4), "ListId");
+const OUString listId5 = getProperty(getParagraph(5), "ListId");
+const OUString listId6 = getProperty(getParagraph(6), "ListId");
+const OUString listId7 = getProperty(getParagraph(7), "ListId");
+
 // the initial list with 4 list items
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(1), "ListId"), 
getProperty(getParagraph(4), "ListId"));
+CPPUNIT_ASSERT_EQUAL(listId1, listId4);
 
 // the last of the first list, and the first of the inserted list
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(4), "ListId"), 
getProperty(getParagraph(5), "ListId"));
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(5), "ListId"), 
getProperty(getParagraph(6), "ListId"));
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(6), "ListId"), 
getProperty(getParagraph(7), "ListId"));
+CPPUNIT_ASSERT(list

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

2018-01-15 Thread Serge Krot
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx |   51 +-
 sw/source/filter/xml/xmlimp.cxx|  239 
+++---
 sw/source/filter/xml/xmlimp.hxx|1 
 4 files changed, 227 insertions(+), 64 deletions(-)

New commits:
commit 311ea730cb225bca167af2e4111445608a14a263
Author: Serge Krot 
Date:   Fri Jan 12 13:55:59 2018 +0100

tdf#113877 Insert document: merge two lists into one

When inserting a new document into current position we need to
concat to lists into one only when they have the same list
properties.

Added unit test.

Change-Id: I66a8090fdeacd3a630700113d6a26a1cad75dc41
Reviewed-on: https://gerrit.libreoffice.org/47814
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt
new file mode 100755
index ..47fe7e0760fe
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7d39895f39bd..1bfb252c4899 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -264,6 +264,7 @@ public:
 void testTdf58604();
 void testTdf112025();
 void testTdf113877();
+void testTdf113877NoMerge();
 void testMsWordCompTrailingBlanks();
 void testCreateDocxAnnotation();
 void testTdf107976();
@@ -437,6 +438,7 @@ public:
 CPPUNIT_TEST(testTdf58604);
 CPPUNIT_TEST(testTdf112025);
 CPPUNIT_TEST(testTdf113877);
+CPPUNIT_TEST(testTdf113877NoMerge);
 CPPUNIT_TEST(testMsWordCompTrailingBlanks);
 CPPUNIT_TEST(testCreateDocxAnnotation);
 CPPUNIT_TEST(testTdf107976);
@@ -5281,6 +5283,8 @@ void SwUiWriterTest::testTdf114306()
 assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt", 1);
 }
 
+// During insert of the document with list inside into the main document 
inside the list
+// we should merge both lists into one, when they have the same list properties
 void SwUiWriterTest::testTdf113877()
 {
 load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
@@ -5298,13 +5302,52 @@ void SwUiWriterTest::testTdf113877()
 lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
 }
 
+const OUString listId1 = getProperty(getParagraph(1), "ListId");
+const OUString listId4 = getProperty(getParagraph(4), "ListId");
+const OUString listId5 = getProperty(getParagraph(5), "ListId");
+const OUString listId6 = getProperty(getParagraph(6), "ListId");
+const OUString listId7 = getProperty(getParagraph(7), "ListId");
+
+// the initial list with 4 list items
+CPPUNIT_ASSERT_EQUAL(listId1, listId4);
+
+// the last of the first list, and the first of the inserted list
+CPPUNIT_ASSERT_EQUAL(listId4, listId5);
+CPPUNIT_ASSERT_EQUAL(listId5, listId6);
+CPPUNIT_ASSERT_EQUAL(listId6, listId7);
+}
+
+// The same test as testTdf113877() but merging of two list should not be 
performed.
+void SwUiWriterTest::testTdf113877NoMerge()
+{
+load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+
+// set a page cursor into the end of the document
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+uno::Reference 
xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+xCursor->jumpToEndOfPage();
+
+// insert the same document at current cursor position
+{
+const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf113877_insert_numbered_list_abcd.odt";
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({ { "Name", 
uno::makeAny(insertFileid) } }));
+lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+}
+
+const OUString listId1 = getProperty(getParagraph(1), "ListId");
+const OUString listId4 = getProperty(getParagraph(4), "ListId");
+const OUString listId5 = getProperty(getParagraph(5), "ListId");
+const OUString listId6 = getProperty(getParagraph(6), "ListId");
+const OUString listId7 = getProperty(getParagraph(7), "ListId");
+
 // the initial list with 4 list items
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(1), "ListId"), 
getProperty(getParagraph(4), "ListId"));
+CPPUNIT_ASSERT_EQUAL(listId1, listId4);
 
 // the last of the first list, and the first of the inserted list
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(4), "ListId"), 
getProperty(getParagraph(5), "ListId"));
-CPPUNIT_ASSERT_EQUAL(getProperty(getParagraph(5), "ListId"), 
getProperty(getParagraph(6), "ListId"));
-CPPUNIT_ASSERT_EQUAL(getProperty(get

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

2018-01-15 Thread Stephan Bergmann
 include/editeng/lrspitem.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 8f28db9515e049fa7e0aa26fe32513e3486dcfaf
Author: Stephan Bergmann 
Date:   Mon Jan 15 20:10:21 2018 +0100

Remove unused LRSPACE_{16,AUTOFIRST}_VERSION

...unused since 1e4b1e4a1aca3b333820b0a865997e6f62e80064 "Removing unused
SfxItemPool serialisation from editeng"

Change-Id: Iecc91d21a3c02985259e985c4092652efe877b50
Reviewed-on: https://gerrit.libreoffice.org/47911
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index 4a2d9bd3992d..6a1a16d61144 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -43,9 +43,7 @@
 700   -500   200   700 -500
 */
 
-#define LRSPACE_16_VERSION  ((sal_uInt16)0x0001)
 #define LRSPACE_TXTLEFT_VERSION (sal_uInt16(0x0002))
-#define LRSPACE_AUTOFIRST_VERSION ((sal_uInt16)0x0003)
 #define LRSPACE_NEGATIVE_VERSION (sal_uInt16(0x0004))
 
 class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Help needed !!! SolarMutex

2018-01-15 Thread jan iversen
Hi

I need help. I am debugging the iOS version of LibreOfficeKit init() to
find a missing SolarMutex release (Xcode 9 debugger).

Can someone please tell me how to "see" (in the debugger) if the SolarMutex
is locked, and if so to which task.

rgds
jan I.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-01-15 Thread Vasily Melenchuk
 chart2/source/controller/main/ChartController.cxx |   10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

New commits:
commit 5836d2be26af9ba4c38e8677e4c9f6f640f273be
Author: Vasily Melenchuk 
Date:   Mon Jan 15 20:02:53 2018 +0300

Code simplification: both if branches are doing same.

Change-Id: I92a51fc62a051390a5e1b3790906cbd2135a53a7
Reviewed-on: https://gerrit.libreoffice.org/47909
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index b2b8dbdc9720..1348c7aedb1b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -717,15 +717,7 @@ sal_Bool SAL_CALL ChartController::suspend( sal_Bool 
bSuspend )
 }
 
 //change suspend mode
-if(bSuspend)
-{
-m_bSuspended = bSuspend;
-return true;
-}
-else
-{
-m_bSuspended = bSuspend;
-}
+m_bSuspended = bSuspend;
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loolkitconfig.xcu

2018-01-15 Thread Pranav Kant
 loolkitconfig.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0150762d141f24fb048a069209c2b0de1f77e969
Author: Pranav Kant 
Date:   Fri Jan 12 18:39:34 2018 +0530

loolkitconfig.xcu: /home is only available in debug builds, not release

... so the problem as mentioned in
831c79c0acbca6a7053080061b14381640c4abb7 was only fixed for debug
builds.

Change-Id: I549a4765af558a7969e5a96717b36612bd89f22b
(cherry picked from commit 57387bf2b42caca704b3df30045d33e295f202ea)
Reviewed-on: https://gerrit.libreoffice.org/47809
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loolkitconfig.xcu b/loolkitconfig.xcu
index ae2cd1ed..a80508aa 100644
--- a/loolkitconfig.xcu
+++ b/loolkitconfig.xcu
@@ -11,6 +11,6 @@
 false
 
 
-file:///home
+file:///tmp
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/dist

2018-01-15 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |5 +
 1 file changed, 5 insertions(+)

New commits:
commit f3cb71180b5814eb36f0e0bfaac77f7f8b758841
Author: Pranav Kant 
Date:   Fri Jan 12 18:19:50 2018 +0530

loleaflet: Don't allow selecting the dialog canvas

Change-Id: I8c88183f0fbb29b5cd815240105153b71c5eb2ce
Reviewed-on: https://gerrit.libreoffice.org/47808
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 79e04619..57185f0e 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -352,4 +352,9 @@ body {
 cursor: default;
 display: block; /* required to remove all borders around canvas 
element */
 caret-color: transparent; /* firefox shows a caret otherwise on 
top-left of the canvas */
+user-select: none;
+-moz-user-select: none;
+-khtml-user-select: none;
+-webkit-user-select: none;
+-o-user-select: none;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/dist

2018-01-15 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 57621181fd3f1ca774129fb31a939114333f97f1
Author: Pranav Kant 
Date:   Fri Jan 12 18:14:16 2018 +0530

loleaflet: hide the caret on dialog canvas

Otherwise, on firefox, when the dialog canvas has the focus, a caret
different from the one overlayed by LOK, is shown.

Change-Id: Ie38aae59f01a3811becca0bcf50c9d7d240bfa9b
Reviewed-on: https://gerrit.libreoffice.org/47807
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 38d9383e..79e04619 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -351,4 +351,5 @@ body {
 .lokdialog_canvas {
 cursor: default;
 display: block; /* required to remove all borders around canvas 
element */
+caret-color: transparent; /* firefox shows a caret otherwise on 
top-left of the canvas */
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - wsd/DocumentBroker.cpp

2018-01-15 Thread Michael Meeks
 wsd/DocumentBroker.cpp |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 0da449bbd9968fb580b90fbeb0672437b7f5f832
Author: Michael Meeks 
Date:   Fri Jan 12 16:16:56 2018 +

Warn if we exit with a modified document around.

Change-Id: Ie38ab49c66358f674e14820a6ffa993c25aa9e92
Reviewed-on: https://gerrit.libreoffice.org/47822
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index f149f36c..6c6da1f5 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -297,6 +297,13 @@ void DocumentBroker::pollThread()
 _poll->continuePolling() << ", ShutdownRequestFlag: " << 
ShutdownRequestFlag <<
 ", TerminationFlag: " << TerminationFlag << ".");
 
+if (_isModified)
+{
+std::stringstream state;
+dumpState(state);
+LOG_ERR("DocumentBroker stopping although modified " << state.str());
+}
+
 // Flush socket data first.
 const int flushTimeoutMs = POLL_TIMEOUT_MS * 2; // ~1000ms
 const auto flushStartTime = std::chrono::steady_clock::now();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9f44565598e6da9d8e2d9efb63c0a47cfb4f1611
Author: Andras Timar 
Date:   Tue Jan 9 10:45:53 2018 +0100

Put checkmark if spell checking language 'None' is selected

Change-Id: Iccbcbce2590b70c115199fcdb57bd5174d9c3a80
Reviewed-on: https://gerrit.libreoffice.org/47639
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 68d6fb9c..1a458b1b 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -538,6 +538,8 @@ L.Control.Menubar = L.Control.extend({
var data = 
decodeURIComponent($(aItem).data('uno'));
if (data.indexOf(lang) !== -1) {

$(aItem).addClass('lo-menu-item-checked');
+   } else if 
(data.indexOf('LANGUAGE_NONE') !== -1 && lang === '[None]') {
+   
$(aItem).addClass('lo-menu-item-checked');
} else {

$(aItem).removeClass('lo-menu-item-checked');
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src loleaflet/unocommands.js

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |   42 ++-
 loleaflet/unocommands.js |1 
 2 files changed, 5 insertions(+), 38 deletions(-)

New commits:
commit d61ce94ebf0d1ed78f1f71423f6ba7d33290b983
Author: Andras Timar 
Date:   Tue Jan 9 10:17:02 2018 +0100

Format - Page... dialog instead of custom Page menus

Change-Id: I7b91505a7f875fa67d4e5214bd697451c4b3c5e2
Reviewed-on: https://gerrit.libreoffice.org/47634
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 353672fd..68d6fb9c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -157,18 +157,10 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:FontDialog'},
{uno: '.uno:ParagraphDialog'},
{uno: '.uno:OutlineBullet'},
+   {uno: '.uno:PageDialog'},
{type: 'separator'},
-   {uno: '.uno:ResetAttributes'},
-   {name: _('Page'), type: 'menu', menu: [
-   {name: 'A4, ' + _('Portrait'), type: 
'action', id: 'a4portrait'},
-   {name: 'A4, ' + _('Landscape'), type: 
'action', id: 'a4landscape'},
-   {name: 'A5, ' + _('Portrait'), type: 
'action', id: 'a5portrait'},
-   {name: 'A5, ' + _('Landscape'), type: 
'action', id: 'a5landscape'},
-   {name: 'Letter, ' + _('Portrait'), 
type: 'action', id: 'letterportrait'},
-   {name: 'Letter, ' + _('Landscape'), 
type: 'action', id: 'letterlandscape'},
-   {name: 'Legal, ' + _('Portrait'), type: 
'action', id: 'legalportrait'},
-   {name: 'Legal, ' + _('Landscape'), 
type: 'action', id: 'legallandscape'}]}]
-   },
+   {uno: '.uno:ResetAttributes'}
+   ]},
{name: _UNO('.uno:TableMenu', 'text'), type: 'menu', 
menu: [
{name: _UNO('.uno:TableInsertMenu', 'text'), 
type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
@@ -658,35 +650,9 @@ L.Control.Menubar = L.Control.extend({
map.fire('postMessage', {msgId: 'close', args: 
{EverModified: map._everModified, Deprecated: true}});
map.fire('postMessage', {msgId: 'UI_Close', args: 
{EverModified: map._everModified}});
map.remove();
-   }
-   else if (id === 'repair') {
+   } else if (id === 'repair') {
map._socket.sendMessage('commandvalues 
command=.uno:DocumentRepair');
-   } else if (id === 'a4portrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"21000"},"AttributePageSize.Height":{"type":"long", "value": "29700"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-   } else if (id === 'a4landscape') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Height":{"type":"long", "value": 
"21000"},"AttributePageSize.Width":{"type":"long", "value": "29700"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-   } else if (id === 'a5portrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"14800"},"AttributePageSize.Height":{"type":"long", "value": "21000"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-   } else if (id === 'a5landscape') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Height":{"type":"long", "value": 
"14800"},"AttributePageSize.Width":{"type":"long", "value": "21000"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-   } else if (id === 'letterportrait') {
-   map.sendUnoCommand('.uno:AttributePageSize 
{"AttributePageSize.Width":{"type":"long", "value": 
"21950"},"AttributePageSize.Height":{"type":"long", "value": "27940"}}');
-   map.sendUnoCommand('.uno:AttributePage 
{"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-   } else if (id === 'letterland

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Andras Timar
 loleaflet/src/control/Control.Menubar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4decf25294f636f0b61546f49a99f7066ed0ae6f
Author: Andras Timar 
Date:   Tue Jan 9 09:36:35 2018 +0100

Only show checkmarks in Language -> For selection menu

Change-Id: I420b7f9fd1559fdeeedf8836c09021bee36dcbb6
Reviewed-on: https://gerrit.libreoffice.org/47631
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 89bbc507..353672fd 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -541,7 +541,7 @@ L.Control.Menubar = L.Control.extend({
} else {

$(aItem).removeClass('disabled');
}
-   if 
(unoCommand.indexOf('.uno:LanguageStatus') !== -1) {
+   if 
(unoCommand.indexOf('.uno:LanguageStatus?Language:string=Current_') !== -1) {
var lang = 
map['stateChangeHandler'].getItemValue('.uno:LanguageStatus');
var data = 
decodeURIComponent($(aItem).data('uno'));
if (data.indexOf(lang) !== -1) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - translations

2018-01-15 Thread Christian Lohmaier
 translations |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24b339c8a7aa01c51aa36cd81da0e66dbeecb8b8
Author: Christian Lohmaier 
Date:   Mon Jan 15 19:42:56 2018 +0100

Updated core
Project: translations  e871217990589c0b78633ce5d460e70075a32015

update translations after first de-fuzzying round

Change-Id: Ie6b488bf4cb510522eb8d92b479b4ab42226698d
(cherry picked from commit 030ab61d2b016aaebac10ecaea1774a69b240ce8)

diff --git a/translations b/translations
index 321ffe14cfa9..e87121799058 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 321ffe14cfa93dce92d2bc4c32f0ca41dda39c47
+Subproject commit e871217990589c0b78633ce5d460e70075a32015
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: translations

2018-01-15 Thread Christian Lohmaier
 translations |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 33aa58d66e97c48009bcbae6cf2cab349382fb4d
Author: Christian Lohmaier 
Date:   Mon Jan 15 19:42:56 2018 +0100

Updated core
Project: translations  030ab61d2b016aaebac10ecaea1774a69b240ce8

update translations after first de-fuzzying round

Change-Id: Ie6b488bf4cb510522eb8d92b479b4ab42226698d

diff --git a/translations b/translations
index 37dce4e45765..030ab61d2b01 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 37dce4e45765761dcf3ade415b7197a1d7026cdc
+Subproject commit 030ab61d2b016aaebac10ecaea1774a69b240ce8
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - lotuswordpro/inc lotuswordpro/source

2018-01-15 Thread Caolán McNamara
 lotuswordpro/inc/lwpfrib.hxx|4 
 lotuswordpro/source/filter/lwpchangemgr.cxx |2 ++
 lotuswordpro/source/filter/lwpfrib.cxx  |   18 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit a4bae5beeb71edb8b3ac51f9775e16a889560524
Author: Caolán McNamara 
Date:   Fri Jan 12 09:43:41 2018 +

ofz#5254 Bad-cast

Change-Id: I318d441d841dd4c783f87ac2f3f699852e8b1039
Reviewed-on: https://gerrit.libreoffice.org/47804
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/lotuswordpro/inc/lwpfrib.hxx b/lotuswordpro/inc/lwpfrib.hxx
index 4e824c0002f4..6ff3cad39a98 100644
--- a/lotuswordpro/inc/lwpfrib.hxx
+++ b/lotuswordpro/inc/lwpfrib.hxx
@@ -97,6 +97,7 @@ public:
 OUString GetEditor();
 XFColor GetHighlightColor();
 protected:
+std::map* m_pFribMap;
 LwpPara* m_pPara;
 LwpFrib* m_pNext;
 sal_uInt8 m_nFribType;
@@ -119,6 +120,9 @@ public:
 REV_INSERT =0,
 REV_DELETE = 1,
 };
+
+void Register(std::map* pFribMap);
+void Deregister();
 private:
 static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* 
pModInfo);
 protected:
diff --git a/lotuswordpro/source/filter/lwpchangemgr.cxx 
b/lotuswordpro/source/filter/lwpchangemgr.cxx
index e08ee979869d..c04241aaccb4 100644
--- a/lotuswordpro/source/filter/lwpchangemgr.cxx
+++ b/lotuswordpro/source/filter/lwpchangemgr.cxx
@@ -89,6 +89,7 @@ LwpChangeMgr::LwpChangeMgr()
 m_pFribMap = &m_DocFribMap;
 m_ChangeList.clear();
 }
+
 LwpChangeMgr::~LwpChangeMgr()
 {
 m_pFribMap=nullptr;
@@ -102,6 +103,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib)
 m_nCounter++;
 OUString sID = "ct"+ OUString::number(m_nCounter);
 m_pFribMap->insert(std::pair(pFrib,sID));
+pFrib->Register(m_pFribMap);
 }
 
 OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib)
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx 
b/lotuswordpro/source/filter/lwpfrib.cxx
index f9b3ad759d3c..919b257be043 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -87,7 +87,8 @@
 
 
 LwpFrib::LwpFrib(LwpPara* pPara)
-: m_pPara(pPara)
+: m_pFribMap(nullptr)
+, m_pPara(pPara)
 , m_pNext(nullptr)
 , m_nFribType(0)
 , m_pModifiers(nullptr)
@@ -100,6 +101,7 @@ LwpFrib::LwpFrib(LwpPara* pPara)
 
 LwpFrib::~LwpFrib()
 {
+Deregister();
 }
 
 LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, 
sal_uInt8 fribtag,sal_uInt8 editID)
@@ -447,4 +449,18 @@ XFColor LwpFrib::GetHighlightColor()
 return pGlobal->GetHighlightColor(m_nEditor);
 }
 
+void LwpFrib::Register(std::map* pFribMap)
+{
+m_pFribMap = pFribMap;
+}
+
+void LwpFrib::Deregister()
+{
+if (m_pFribMap)
+{
+m_pFribMap->erase(this);
+m_pFribMap = nullptr;
+}
+}
+
 /* 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 'libreoffice-5-4' - lotuswordpro/source

2018-01-15 Thread Caolán McNamara
 lotuswordpro/source/filter/lwpchangemgr.cxx |2 ++
 lotuswordpro/source/filter/lwpfrib.cxx  |   18 +-
 lotuswordpro/source/filter/lwpfrib.hxx  |4 
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit f8a1dd7ae35ea0307a9282378a9300897df6fb42
Author: Caolán McNamara 
Date:   Fri Jan 12 09:43:41 2018 +

ofz#5254 Bad-cast

Change-Id: I318d441d841dd4c783f87ac2f3f699852e8b1039
Reviewed-on: https://gerrit.libreoffice.org/47805
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/lotuswordpro/source/filter/lwpchangemgr.cxx 
b/lotuswordpro/source/filter/lwpchangemgr.cxx
index 30b272e35ccc..cbd9b58aa805 100644
--- a/lotuswordpro/source/filter/lwpchangemgr.cxx
+++ b/lotuswordpro/source/filter/lwpchangemgr.cxx
@@ -89,6 +89,7 @@ LwpChangeMgr::LwpChangeMgr()
 m_pFribMap = &m_DocFribMap;
 m_ChangeList.clear();
 }
+
 LwpChangeMgr::~LwpChangeMgr()
 {
 m_pFribMap=nullptr;
@@ -102,6 +103,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib)
 m_nCounter++;
 OUString sID = "ct"+ OUString::number(m_nCounter);
 m_pFribMap->insert(std::pair(pFrib,sID));
+pFrib->Register(m_pFribMap);
 }
 
 OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib)
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx 
b/lotuswordpro/source/filter/lwpfrib.cxx
index bd951118d48d..baebf753ed03 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -87,7 +87,8 @@
 
 
 LwpFrib::LwpFrib(LwpPara* pPara)
-: m_pPara(pPara)
+: m_pFribMap(nullptr)
+, m_pPara(pPara)
 , m_pNext(nullptr)
 , m_nFribType(0)
 , m_pModifiers(nullptr)
@@ -100,6 +101,7 @@ LwpFrib::LwpFrib(LwpPara* pPara)
 
 LwpFrib::~LwpFrib()
 {
+Deregister();
 }
 
 LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, 
sal_uInt8 fribtag,sal_uInt8 editID)
@@ -447,4 +449,18 @@ XFColor LwpFrib::GetHighlightColor()
 return pGlobal->GetHighlightColor(m_nEditor);
 }
 
+void LwpFrib::Register(std::map* pFribMap)
+{
+m_pFribMap = pFribMap;
+}
+
+void LwpFrib::Deregister()
+{
+if (m_pFribMap)
+{
+m_pFribMap->erase(this);
+m_pFribMap = nullptr;
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpfrib.hxx 
b/lotuswordpro/source/filter/lwpfrib.hxx
index 910f85dee08f..6fde006a649e 100644
--- a/lotuswordpro/source/filter/lwpfrib.hxx
+++ b/lotuswordpro/source/filter/lwpfrib.hxx
@@ -97,6 +97,7 @@ public:
 OUString GetEditor();
 XFColor GetHighlightColor();
 protected:
+std::map* m_pFribMap;
 LwpPara* m_pPara;
 LwpFrib* m_pNext;
 sal_uInt8 m_nFribType;
@@ -119,6 +120,9 @@ public:
 REV_INSERT =0,
 REV_DELETE = 1,
 };
+
+void Register(std::map* pFribMap);
+void Deregister();
 private:
 static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* 
pModInfo);
 protected:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Jan Holesovsky
 include/sfx2/tabdlg.hxx|1 
 include/vcl/abstdlg.hxx|   18 ++
 include/vcl/dialog.hxx |   17 ++
 sc/source/ui/attrdlg/scdlgfact.hxx |5 +
 sc/source/ui/view/tabvwsha.cxx |   34 ++--
 sfx2/source/control/request.cxx|   17 ++
 sfx2/source/dialog/tabdlg.cxx  |   37 -
 vcl/source/window/abstdlg.cxx  |6 ++
 vcl/source/window/dialog.cxx   |  100 +
 vcl/source/window/window.cxx   |5 +
 10 files changed, 179 insertions(+), 61 deletions(-)

New commits:
commit c40dfabd56ade10fe35690dc9810955c2e99e2c0
Author: Jan Holesovsky 
Date:   Fri Jan 12 11:57:22 2018 +

lokdialog: Allow closing the Format Cell dialogs in any order.

Includes also lots of infrastructural changes, making the
conversion of the rest of the dialogs much easier.

StartExecuteAsync should be used in-place of StartExecuteModal
and the latter removed from the code-base incrementally. More
common code from Dialog::Execute should be moved to
ImplStartExecuteModal in a next step, as this is used more widely.

Change-Id: Idb2c1ec790e38f582438471a0419a56cdcf1439d
Reviewed-on: https://gerrit.libreoffice.org/47722
Tested-by: Jenkins 
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 06f99318c3c0..409b15196307 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -190,6 +190,7 @@ public:
 
 short   Execute() override;
 voidStartExecuteModal( const Link& 
rEndDialogHdl ) override;
+boolStartExecuteAsync( VclAbstractDialog::AsyncContext 
&rCtx ) override;
 voidStart();
 
 const SfxItemSet*   GetExampleSet() const { return m_pExampleSet; }
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 40f75ed293b6..87336e0d5a5f 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace vcl { class Window; }
 class Dialog;
@@ -42,6 +43,23 @@ protected:
 public:
 virtual short   Execute() = 0;
 
+struct AsyncContext {
+VclPtr mxOwner;
+std::function maEndDialogFn;
+bool isSet() { return !!maEndDialogFn; }
+};
+
+bool StartExecuteAsync(const std::function &rEndDialogFn, 
VclPtr xOwner)
+{
+AsyncContext aCtx;
+aCtx.mxOwner = xOwner;
+aCtx.maEndDialogFn = rEndDialogFn;
+return StartExecuteAsync(aCtx);
+}
+
+/// Commence execution of a modal dialog.
+virtual bool StartExecuteAsync(AsyncContext &);
+
 // Screenshot interface
 virtual std::vector getAllPageUIXMLDescriptions() const;
 virtual bool selectPageByUIXMLDescription(const OString& 
rUIXMLDescription);
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 3da4ec0cb59a..6dea53f47058 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct DialogImpl;
 class VclBox;
@@ -45,6 +46,7 @@ public:
 
 private:
 VclPtr  mpPrevExecuteDlg;
+VclPtr  mpNextExecuteDlg;
 std::unique_ptr mpDialogImpl;
 longmnMousePositioned;
 boolmbInExecute;
@@ -57,6 +59,7 @@ private:
 VclPtr mpActionArea;
 VclPtr   mpContentArea;
 
+SAL_DLLPRIVATE voidRemoveFromDlgList();
 SAL_DLLPRIVATE voidImplInitDialogData();
 SAL_DLLPRIVATE voidImplInitSettings();
 SAL_DLLPRIVATE VclPtr AddBorderWindow(vcl::Window* pParent, 
WinBits nBits);
@@ -138,6 +141,20 @@ private:
 voidImplSetModalInputMode(bool bModal);
 public:
 
+// FIXME: Need to remove old StartExecuteModal in favour of this one.
+/// Returns true of the dialog successfully starts
+bool StartExecuteAsync(const std::function &rEndDialogFn,
+   VclPtr xOwner = 
VclPtr())
+{
+VclAbstractDialog::AsyncContext aCtx;
+aCtx.mxOwner = xOwner;
+aCtx.maEndDialogFn = rEndDialogFn;
+return StartExecuteAsync(aCtx);
+}
+
+/// Commence execution of a modal dialog, disposes owner on failure
+virtual boolStartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx);
+
 // Dialog::Execute replacement API
 
 
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index 5684f1245825..a1a3806f059c 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -65,6 +65,7 @@ public: \
  {} \
 virtual ~Class() override;   \
 virtual short   Execute() override ;\
+virtual boolStartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) 
override; \
 std::vector getAllPageUIXM

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

2018-01-15 Thread Tamás Zolnai
 sw/source/core/doc/docredln.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit 3dc73ae6978521c3b334d5bbff44deb85bc6a108
Author: Tamás Zolnai 
Date:   Sun Jan 14 00:16:26 2018 +0100

lok: Tile not invalidated with certain changes

Calling FillRects caused this issue, which updates text area, so
the invalidation, runing after that call, won't now where was the old text.
We call invalidation here on the whole frame not only on the rects where
the actual text is.

Change-Id: I23db4b9579aa5710540b5d241506726630219b02
Reviewed-on: https://gerrit.libreoffice.org/47848
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 39dd42b5aa34d0960cdab0c9fd967d4ae5cc6801)
Reviewed-on: https://gerrit.libreoffice.org/47904
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index d30ebdb1cf1f..0803609ae963 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -393,6 +393,20 @@ void 
SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRe
 aRedline.put("textRange", sRects.getStr());
 
 lcl_LOKInvalidateStartEndFrames(aCursor);
+
+// When this notify method is called text invalidation is not done yet
+// Calling FillRects updates the text area so invalidation will not 
run on the correct rects
+// So we need to do an own invalidation here. It invalidates text 
frames continging the redlining
+SwDoc* pDoc = pRedline->GetDoc();
+SwViewShell* pSh;
+if( pDoc && !pDoc->IsInDtor() &&
+nullptr != ( pSh = 
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()) )
+{
+for(SwNodeIndex nIdx = pStartPos->nNode; nIdx <= pEndPos->nNode; 
++nIdx)
+{
+pSh->InvalidateWindows( 
nIdx.GetNode().GetContentNode()->FindLayoutRect() );
+}
+}
 }
 
 boost::property_tree::ptree aTree;
___
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-5.3' - include/sfx2 include/vcl sc/source sfx2/source vcl/source

2018-01-15 Thread Jan Holesovsky
 include/sfx2/tabdlg.hxx|1 
 include/vcl/abstdlg.hxx|   18 ++
 include/vcl/dialog.hxx |   17 ++
 sc/source/ui/attrdlg/scdlgfact.hxx |5 +
 sc/source/ui/view/tabvwsha.cxx |   34 ++--
 sfx2/source/control/request.cxx|   17 ++
 sfx2/source/dialog/tabdlg.cxx  |   37 -
 vcl/source/window/abstdlg.cxx  |6 ++
 vcl/source/window/dialog.cxx   |   99 +
 vcl/source/window/window.cxx   |5 +
 10 files changed, 178 insertions(+), 61 deletions(-)

New commits:
commit d0f4f27465da113748ca63103692c45da64af6f5
Author: Jan Holesovsky 
Date:   Sat Jan 13 12:10:43 2018 +

lokdialog: Allow closing the Format Cell dialogs in any order.

Includes also lots of infrastructural changes, making the
conversion of the rest of the dialogs much easier.

StartExecuteAsync should be used in-place of StartExecuteModal
and the latter removed from the code-base incrementally. More
common code from Dialog::Execute should be moved to
ImplStartExecuteModal in a next step, as this is used more widely.

Change-Id: Idb2c1ec790e38f582438471a0419a56cdcf1439d
Reviewed-on: https://gerrit.libreoffice.org/47817
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index efed3fff4d35..a758d4544291 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -190,6 +190,7 @@ public:
 
 short   Execute() override;
 voidStartExecuteModal( const Link& 
rEndDialogHdl ) override;
+boolStartExecuteAsync( VclAbstractDialog::AsyncContext 
&rCtx ) override;
 voidStart();
 
 const SfxItemSet*   GetExampleSet() const { return m_pExampleSet; }
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index c173326706c8..55260f51aef3 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace vcl { class Window; }
 class Dialog;
@@ -41,6 +42,23 @@ protected:
 public:
 virtual short   Execute() = 0;
 
+struct AsyncContext {
+VclPtr mxOwner;
+std::function maEndDialogFn;
+bool isSet() { return !!maEndDialogFn; }
+};
+
+bool StartExecuteAsync(const std::function &rEndDialogFn, 
VclPtr xOwner)
+{
+AsyncContext aCtx;
+aCtx.mxOwner = xOwner;
+aCtx.maEndDialogFn = rEndDialogFn;
+return StartExecuteAsync(aCtx);
+}
+
+/// Commence execution of a modal dialog.
+virtual bool StartExecuteAsync(AsyncContext &);
+
 // Screenshot interface
 virtual std::vector getAllPageUIXMLDescriptions() const;
 virtual bool selectPageByUIXMLDescription(const OString& 
rUIXMLDescription);
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 706cd762db94..aa837f741c2c 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct DialogImpl;
 class VclBox;
@@ -37,6 +38,7 @@ public:
 
 private:
 VclPtr  mpPrevExecuteDlg;
+VclPtr  mpNextExecuteDlg;
 std::unique_ptr mpDialogImpl;
 longmnMousePositioned;
 boolmbInExecute;
@@ -48,6 +50,7 @@ private:
 VclPtr mpActionArea;
 VclPtr   mpContentArea;
 
+SAL_DLLPRIVATE voidRemoveFromDlgList();
 SAL_DLLPRIVATE voidImplInitDialogData();
 SAL_DLLPRIVATE voidImplInitSettings();
 
@@ -124,6 +127,20 @@ private:
 static void ImplEndExecuteModal();
 public:
 
+// FIXME: Need to remove old StartExecuteModal in favour of this one.
+/// Returns true of the dialog successfully starts
+bool StartExecuteAsync(const std::function &rEndDialogFn,
+   VclPtr xOwner = 
VclPtr())
+{
+VclAbstractDialog::AsyncContext aCtx;
+aCtx.mxOwner = xOwner;
+aCtx.maEndDialogFn = rEndDialogFn;
+return StartExecuteAsync(aCtx);
+}
+
+/// Commence execution of a modal dialog, disposes owner on failure
+virtual boolStartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx);
+
 // Dialog::Execute replacement API
 
 
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index b069c779efb2..ef6e0a6a1057 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -65,6 +65,7 @@ public: \
  {} \
 virtual ~Class() override;   \
 virtual short   Execute() override ;\
+virtual boolStartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) 
override; \
 std::vector getAllPageUIXMLDescriptions() const override; \
 bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) 
override;

Weekly QA Report (W02-2018)

2018-01-15 Thread Xisco Fauli
Hello,

What have happened in QA in the last 7 days?

  * 107 bugs have been created, of which, 41 are still unconfirmed (
Total Unconfirmed bugs: 408 )
    Link: http://tinyurl.com/ycdh8r2o

  * 948 comments have been written.

== STATUSES CHANGED ==
  * 13 bugs have been changed to 'ASSIGNED'.
    Link: http://tinyurl.com/yal793rq
    Done by: Tamás Zolnai ( 2 ), Armin Le Grand (CIB) ( 2 ), Xisco Faulí
( 1 ), Miklos Vajna ( 1 ), Samuel Mehrbrodt (CIB) ( 1 ), Paul Trojahn (
1 ), Maxim Monastirsky ( 1 ), Mert Tumer ( 1 ), Gülşah Köse ( 1 ),
Bartosz ( 1 ), Caolán McNamara ( 1 )

  * 1 bug has been changed to 'CLOSED'.
    Link: http://tinyurl.com/y9u28vj4
    Done by: Harald Koester ( 1 )

  * 30 bugs have been changed to 'NEEDINFO'.
    Link: http://tinyurl.com/ycrzj6yk
    Done by: Xisco Faulí ( 14 ), Alex Thurgood ( 5 ), Heiko Tietze ( 2
), raal ( 2 ), m.a.riosv ( 2 ), Dieter Praas ( 2 ), Buovjaga ( 1 ),
Julien Nabet ( 1 ), Aron Budea ( 1 )

  * 57 bugs have been changed to 'NEW'.
    Link: http://tinyurl.com/y8t7tz57
    Done by: Xisco Faulí ( 8 ), raal ( 6 ), Alex Thurgood ( 6 ), Jacques
Guilleron ( 4 ), Telesto ( 3 ), Yousuf Philips (jay) ( 3 ), V Stuart
Foote ( 2 ), Heiko Tietze ( 2 ), Thomas Lendo ( 2 ), Regina Henschel ( 2
), Michael Meeks ( 2 ), Timur ( 2 ), Tamás Zolnai ( 1 ), Buovjaga ( 1 ),
Tor Lillqvist ( 1 ), Mahesh ( 1 ), Julien Nabet ( 1 ), Samuel Mehrbrodt
(CIB) ( 1 ), dynapb ( 1 ), m.a.riosv ( 1 ), tagezi ( 1 ), andreas_k ( 1
), Justin L ( 1 ), Harald Koester ( 1 ), Adolfo Jayme ( 1 ), Caolán
McNamara ( 1 ), Rainer Bielefeld Retired ( 1 )

  * 27 bugs have been changed to 'RESOLVED DUPLICATE'.
    Link: http://tinyurl.com/y8klvhlh
    Done by: Heiko Tietze ( 6 ), Aron Budea ( 6 ), Xisco Faulí ( 5 ),
Buovjaga ( 2 ), Julien Nabet ( 1 ), robert ( 1 ), Regina Henschel ( 1 ),
Mike Kaganski ( 1 ), Gabor Kelemen ( 1 ), jorojmaqui ( 1 ), Justin L ( 1
), J22Gim ( 1 )

  * 28 bugs have been changed to 'RESOLVED FIXED'.
    Link: http://tinyurl.com/y9zhhq2e
    Done by: Heiko Tietze ( 4 ), Julien Nabet ( 3 ), Xisco Faulí ( 2 ),
Thorsten Behrens (CIB) ( 2 ), Bartosz ( 2 ), Caolán McNamara ( 2 ),
Tamás Zolnai ( 1 ), Serge Krot (CIB) ( 1 ), Stephan Bergmann ( 1 ),
Samuel Mehrbrodt (CIB) ( 1 ), Jim Raykowski ( 1 ), Pranav Kant ( 1 ),
Patrick Jaap ( 1 ), László Németh ( 1 ), Mike Kaganski ( 1 ), Michael
Meeks ( 1 ), Markus Mohrhard ( 1 ), Gülşah Köse ( 1 ), Aron Budea ( 1 )

  * 3 bugs have been changed to 'RESOLVED INSUFFICIENTDATA'.
    Link: http://tinyurl.com/ycqjkeeu
    Done by: Buovjaga ( 1 ), Justin L ( 1 ), Adolfo Jayme ( 1 )

  * 8 bugs have been changed to 'RESOLVED INVALID'.
    Link: http://tinyurl.com/y862vk3y
    Done by: Xisco Faulí ( 1 ), Heiko Tietze ( 1 ), robert ( 1 ), Mike
Kaganski ( 1 ), Gabor Kelemen ( 1 ), Alex Thurgood ( 1 ), Timur ( 1 ),
Adolfo Jayme ( 1 )

  * 1 bug has been changed to 'RESOLVED MOVED'.
    Link: http://tinyurl.com/y7trzgv7
    Done by: Xisco Faulí ( 1 )

  * 6 bugs have been changed to 'RESOLVED NOTABUG'.
    Link: http://tinyurl.com/y9aqtfnn
    Done by: Xisco Faulí ( 3 ), Buovjaga ( 1 ), Heiko Tietze ( 1 ), raal
( 1 )

  * 1 bug has been changed to 'RESOLVED NOTOURBUG'.
    Link: http://tinyurl.com/ybhxextx
    Done by: Buovjaga ( 1 )

  * 3 bugs have been changed to 'RESOLVED WONTFIX'.
    Link: http://tinyurl.com/ybh9ygvz
    Done by: Heiko Tietze ( 3 )

  * 15 bugs have been changed to 'RESOLVED WORKSFORME'.
    Link: http://tinyurl.com/yax3hnku
    Done by: Xisco Faulí ( 6 ), Buovjaga ( 1 ), Heiko Tietze ( 1 ), raal
( 1 ), Anton Derbenev ( 1 ), Jean-Baptiste Faure ( 1 ), Timur ( 1 ),
Emil Tanev ( 1 ), clemty ( 1 ), Aron Budea ( 1 )

  * 10 bugs have been changed to 'UNCONFIRMED'.
    Link: http://tinyurl.com/ycn93m9p
    Done by: Xisco Faulí ( 1 ), Thomas Lendo ( 1 ), raal ( 1 ), Per
Nystrom ( 1 ), Óvári ( 1 ), Mark Hung ( 1 ), Kamil Landa ( 1 ), Alan ( 1
), gmarco ( 1 ), Dushan Mitrovich ( 1 )

  * 6 bugs have been changed to 'VERIFIED FIXED'.
    Link: http://tinyurl.com/yaf3mg8t
    Done by: Xisco Faulí ( 4 ), Justin L ( 1 ), Jean-Baptiste Faure ( 1 )

== KEYWORDS ADDED ==
  * 'bibisectRequest' has been added to 2 bugs.
    Link: http://tinyurl.com/y8f3bo64
    Done by: Buovjaga ( 1 ), Telesto ( 1 )

  * 'bibisected' has been added to 13 bugs.
    Link: http://tinyurl.com/yc7dm6gr
    Done by: Xisco Faulí ( 7 ), raal ( 3 ), Aron Budea ( 2 ), Telesto ( 1 )

  * 'bisected' has been added to 13 bugs.
    Link: http://tinyurl.com/yc7dm6gr
    Done by: Xisco Faulí ( 7 ), raal ( 3 ), Aron Budea ( 2 ), Telesto ( 1 )

  * 'easyHack' has been added to 2 bugs.
    Link: http://tinyurl.com/yczer9xn
    Done by: Heiko Tietze ( 1 ), Michael Meeks ( 1 )

  * 'filter:docx' has been added to 3 bugs.
    Link: http://tinyurl.com/y8vzfeyg
    Done by: Xisco Faulí ( 1 ), raal ( 1 ), Justin L ( 1 )

  * 'haveBacktrace' has been added to 3 bugs.
    Link: http://tinyurl.com/y8lroye8
    Done by: Xisco Faulí ( 2 ), Aron Budea ( 1 )

  * 'implementationError' has been added

[Libreoffice-commits] core.git: helpcontent2

2018-01-15 Thread Ilmari Lauhakangas
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5942140c5149065ffb5adf9d33b21aeceeabf957
Author: Ilmari Lauhakangas 
Date:   Mon Jan 15 16:29:20 2018 +0200

Updated core
Project: help  ff44bbe7087cf87977103627f55a8b1b5c9ffb89

tdf#114907 Expand and collapse symbols for Contents

Unicode like it's 1993.

Change-Id: I625dc220341db788dd578c210ef2f368bec58199
Reviewed-on: https://gerrit.libreoffice.org/47902
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 7ffe2eafbaa4..ff44bbe7087c 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 7ffe2eafbaa401f4bdea26d7b41f357567544afc
+Subproject commit ff44bbe7087cf87977103627f55a8b1b5c9ffb89
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: help3xsl/default.css

2018-01-15 Thread Ilmari Lauhakangas
 help3xsl/default.css |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit ff44bbe7087cf87977103627f55a8b1b5c9ffb89
Author: Ilmari Lauhakangas 
Date:   Mon Jan 15 16:29:20 2018 +0200

tdf#114907 Expand and collapse symbols for Contents

Unicode like it's 1993.

Change-Id: I625dc220341db788dd578c210ef2f368bec58199
Reviewed-on: https://gerrit.libreoffice.org/47902
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/help3xsl/default.css b/help3xsl/default.css
index 0236011dc..9efce4d33 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -485,15 +485,14 @@ aside input[type=checkbox]:checked ~ .contents-treeview {
 background-position: 18px 0;
 }
 .contents-treeview label:before {
-content: "🖿";
+content: "⊞";
 color: #18A303;
 width: 16px;
 margin: 0 5px 0 0;
-background-position: 0 -32px;
 display: inline-block;
 }
 .contents-treeview input:checked + label::before {
-background-position: 0 -16px;
+content: "⊟";
 }
 /* webkit adjacent element selector bugfix */
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Marco Cecchetti
 sc/source/ui/view/viewfun2.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit d5b38f415ba4e65012db4b9d01ea29a4ca3ffa08
Author: Marco Cecchetti 
Date:   Thu Jan 11 16:03:30 2018 +0100

lok: sc: invalidate cached positions and row header on font resizing

Change-Id: I9678d6bd730d09d1cc47a8633368c99abe1f9bd9
Reviewed-on: https://gerrit.libreoffice.org/47762
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 729cad4210eb..d718c7c1fcd5 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -114,6 +114,12 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
 aMarkedRows.emplace_back(nCurRow, nCurRow);
 }
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+SCCOLROW nStart = aMarkedRows[0].mnStart;
+OnLOKSetWidthOrHeight(nStart, /*width: */ false);
+}
+
 double nPPTX = GetViewData().GetPPTX();
 double nPPTY = GetViewData().GetPPTY();
 Fraction aZoomX = GetViewData().GetZoomX();
@@ -160,11 +166,19 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
 if ( bPaint && bAnyChanged )
 pDocSh->UpdateOle(&GetViewData());
 
+if (comphelper::LibreOfficeKit::isActive())
+ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, 
GetViewData().GetTabNo());
+
 return bAnyChanged;
 }
 
 bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+OnLOKSetWidthOrHeight(nStartRow, /*width: */ false);
+}
+
 ScDocShell* pDocSh = GetViewData().GetDocShell();
 ScDocument& rDoc = pDocSh->GetDocument();
 SCTAB nTab = GetViewData().GetTabNo();
@@ -201,6 +215,9 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW 
nEndRow )
 pDocSh->PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab,
 PaintPartFlags::Grid | 
PaintPartFlags::Left );
 
+if (comphelper::LibreOfficeKit::isActive())
+ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, 
GetViewData().GetTabNo());
+
 return bChanged;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Marco Cecchetti
 sc/inc/clipparam.hxx  |6 --
 sc/source/core/data/clipparam.cxx |6 ++
 sc/source/ui/view/viewfun3.cxx|   22 --
 3 files changed, 2 insertions(+), 32 deletions(-)

New commits:
commit 183fd9a58ae3eeb749b78e6f4ca5783c79b43acb
Author: Marco Cecchetti 
Date:   Wed Jan 10 17:31:35 2018 +0100

Revert "lok: sc: copy / paste confusion -- workaround"

This reverts commit f0684222540b96d8366ce175c522b64472361b80.

This workaround is no more needed because of commit 1b7a827

Change-Id: Icd13b245d5965c2b2ece326f7f5705cf06cf1b64
Reviewed-on: https://gerrit.libreoffice.org/47761
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 

diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index 16555225d074..2e5dece711e8 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -26,8 +26,6 @@
 
 #include 
 
-class SfxViewShell;
-
 /**
  * This struct stores general clipboard parameters associated with a
  * ScDocument instance created in clipboard mode.
@@ -40,7 +38,6 @@ struct ScClipParam
 Direction   meDirection;
 boolmbCutMode;
 sal_uInt32  mnSourceDocID;
-SfxViewShell*   mpSourceView;
 ScRangeListVector   maProtectedChartRangesVector;
 
 ScClipParam();
@@ -70,9 +67,6 @@ struct ScClipParam
 
 sal_uInt32 getSourceDocID() const { return mnSourceDocID; }
 void setSourceDocID( sal_uInt32 nVal ) { mnSourceDocID = nVal; }
-
-SfxViewShell* getSourceView() const { return mpSourceView; }
-void setSourceView( SfxViewShell* pSourceView ) { mpSourceView = 
pSourceView; }
 };
 
 #endif
diff --git a/sc/source/core/data/clipparam.cxx 
b/sc/source/core/data/clipparam.cxx
index c80521045691..51738c9532e3 100644
--- a/sc/source/core/data/clipparam.cxx
+++ b/sc/source/core/data/clipparam.cxx
@@ -23,16 +23,14 @@
 ScClipParam::ScClipParam() :
 meDirection(Unspecified),
 mbCutMode(false),
-mnSourceDocID(0),
-mpSourceView(nullptr)
+mnSourceDocID(0)
 {
 }
 
 ScClipParam::ScClipParam(const ScRange& rRange, bool bCutMode) :
 meDirection(Unspecified),
 mbCutMode(bCutMode),
-mnSourceDocID(0),
-mpSourceView(nullptr)
+mnSourceDocID(0)
 {
 maRanges.Append(rRange);
 }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 689ffe0e3c77..83b3a51edd86 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -227,14 +227,6 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const 
ScRangeList& rRanges, b
 // and lose the 'if' above
 aClipParam.setSourceDocID( pDoc->GetDocumentID() );
 
-// This is only a workaround, which doesn't allow to paste content
-// in one view which has been copied in a different view.
-// TODO: implement a solution providing one clipboard per view
-if (comphelper::LibreOfficeKit::isActive())
-{
-aClipParam.setSourceView(GetViewData().GetViewShell());
-}
-
 if (SfxObjectShell* pObjectShell = pDoc->GetDocumentShell())
 {
 // Copy document properties from pObjectShell to pClipDoc (to 
its clip options, as it has no object shell).
@@ -875,20 +867,6 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
 if (GetViewData().SelectionForbidsCellFill())
 return false;
 
-// This is only a workaround, which doesn't allow to paste content
-// in one view which has been copied in a different view.
-// TODO: implement a solution providing one clipboard per view
-if (comphelper::LibreOfficeKit::isActive())
-{
-ScTabViewShell* pThisView = GetViewData().GetViewShell();
-ScTabViewShell* pSourceView = 
dynamic_cast(pClipDoc->GetClipParam().getSourceView());
-
-if (pThisView && pSourceView && pThisView != pSourceView)
-{
-return false;
-}
-}
-
 //  undo: save all or no content
 InsertDeleteFlags nContFlags = InsertDeleteFlags::NONE;
 if (nFlags & InsertDeleteFlags::CONTENTS)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Marco Cecchetti
 sc/source/ui/inc/viewdata.hxx  |   52 
 sc/source/ui/view/gridwin4.cxx |   92 ---
 sc/source/ui/view/tabview.cxx  |  247 -
 sc/source/ui/view/viewdata.cxx |  198 
 4 files changed, 301 insertions(+), 288 deletions(-)

New commits:
commit dee9ccaef8a01e7eb68f8d20210060c49fa6feaa
Author: Marco Cecchetti 
Date:   Sun Jan 7 16:54:47 2018 +0100

lok: sc: exploiting cached position helper for tile rendering

Change-Id: I02b21c5979d1dfb6bb60a05d891c632602fb44ee
Reviewed-on: https://gerrit.libreoffice.org/47540
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 26f372a33767..a114f4fb7a37 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -148,6 +148,58 @@ public:
 long getPosition(index_type nIndex) const;
 };
 
+class ScBoundsProvider
+{
+typedef ScPositionHelper::value_type value_type;
+typedef SCCOLROW index_type;
+
+ScDocument* pDoc;
+const SCTAB nTab;
+const bool bColumnHeader;
+const index_type MAX_INDEX;
+
+index_type nFirstIndex;
+index_type nSecondIndex;
+long nFirstPositionPx;
+long nSecondPositionPx;
+
+public:
+ScBoundsProvider(ScDocument* pD, SCTAB nT, bool bColumnHeader);
+
+void GetStartIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
+void GetEndIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
+void GetStartIndexAndPosition(SCROW& nIndex, long& nPosition) const;
+void GetEndIndexAndPosition(SCROW& nIndex, long& nPosition) const;
+
+void Compute(value_type aFirstNearest, value_type aSecondNearest,
+ long nFirstBound, long nSecondBound);
+
+void EnlargeStartBy(long nOffset);
+
+void EnlargeEndBy(long nOffset);
+
+void EnlargeBy(long nOffset)
+{
+EnlargeStartBy(nOffset);
+EnlargeEndBy(nOffset);
+}
+
+private:
+long GetSize(index_type nIndex) const;
+
+void GetIndexAndPos(index_type nNearestIndex, long nNearestPosition,
+long nBound, index_type& nFoundIndex, long& nPosition,
+bool bTowards, long nDiff);
+
+void GeIndexBackwards(index_type nNearestIndex, long nNearestPosition,
+  long nBound, index_type& nFoundIndex, long& 
nPosition,
+  bool bTowards);
+
+void GetIndexTowards(index_type nNearestIndex, long nNearestPosition,
+ long nBound, index_type& nFoundIndex, long& nPosition,
+ bool bTowards);
+};
+
 class ScViewDataTable   // per-sheet data
 {
 friend class ScViewData;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 5bfda7ea5915..22e07763decb 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1052,41 +1052,41 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 mpNoteMarker->Draw(); // Above the cursor, in drawing map mode
 }
 
-namespace {
-// Find the row/col just -before- the nPosition in pixels and its offset
-inline void mapConservativeToRowCol(const ScDocument *pDoc,
-sal_Int32  *nIndex,
-sal_Int32  *nOffset,
-sal_Int32  *nOrigin,
-sal_Int32   nTabNo,
-sal_Int32   nPosition,
-boolbRowNotCol,
-double  nPPTX,
-double  nPPTY)
+namespace
+{
+template
+inline
+void lcl_getBoundingRowColumnforTile(ScViewData* pViewData,
+long nTileStartPosPx, long nTileEndPosPx,
+sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin,
+sal_Int32& nTopLeftTileIndex, sal_Int32& nBottomRightTileIndex)
 {
-long nTmp = 0; // row/col to render for nPosition
-long nLastScrPos = 0, nScrPos = 0;
-const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL;
-while (nScrPos <= nPosition && nTmp < nMaxIndex)
-{
-long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo )
-: pDoc->GetColWidth( nTmp, nTabNo );
-if (nSize)
-{
-nLastScrPos = nScrPos;
-nScrPos += ScViewData::ToPixel( nSize, bRowNotCol ? nPPTY : 
nPPTX );
-} // else - FIXME 'skip multiple hidden rows'
+const bool bColumnHeader = std::is_same::value;
 
-*nIndex = nTmp;
-nTmp++;
-}
+SCTAB nTab = pViewData->GetTabNo();
+ScDocument* pDoc = pViewData->GetDocument();
 
-// offset into that row/col for nPosition
-ass

[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp

2018-01-15 Thread Ashod Nakashian
 wsd/DocumentBroker.cpp |   36 
 wsd/DocumentBroker.hpp |5 +
 2 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit f7fc3f494ca824253a2af6ad604622bcd1340b81
Author: Ashod Nakashian 
Date:   Mon Jan 15 00:49:14 2018 -0500

wsd: save before stopping

We don't force saving unconditionally now. Only
when the doc is reasonably expected to be modified
do we force saving (to circumvent the minimum duration
between auto-saves).

We invoke auto-saving before stopping the DocBroker
polling loop, whether due to idleness or server recycling.

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

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 28a4920d..476ad544 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -275,8 +275,12 @@ void DocumentBroker::pollThread()
 
 if (ShutdownRequestFlag)
 {
-autoSave(true);
-stop("recycling");
+LOG_INF("Autosaving DocumentBroker for docKey [" << getDocKey() << 
"] to recycle server.");
+if (!autoSave(isPossiblyModified()))
+{
+LOG_INF("Terminating DocumentBroker for docKey [" << 
getDocKey() << "] to recycle server.");
+stop("recycling");
+}
 }
 else if (AutoSaveEnabled && !_stop &&
  std::chrono::duration_cast(now - 
last30SecCheckTime).count() >= 30)
@@ -287,14 +291,22 @@ void DocumentBroker::pollThread()
 }
 
 // Remove idle documents after 1 hour.
-const bool idle = (getIdleTimeSecs() >= IdleDocTimeoutSecs);
-
-// If all sessions have been removed, no reason to linger.
-if ((isLoaded() || _markToDestroy) && (_sessions.empty() || idle))
+const bool idle = (isLoaded() && getIdleTimeSecs() >= 
IdleDocTimeoutSecs);
+if (idle)
+{
+// Stop if there is nothing to save.
+LOG_INF("Autosaving idle DocumentBroker for docKey [" << 
getDocKey() << "] to kill.");
+if (!autoSave(isPossiblyModified()))
+{
+LOG_INF("Terminating idle DocumentBroker for docKey [" << 
getDocKey() << "].");
+stop("idle");
+}
+}
+else if (_sessions.empty() && (isLoaded() || _markToDestroy))
 {
-LOG_INF("Terminating " << (idle ? "idle" : "dead") <<
-" DocumentBroker for docKey [" << getDocKey() << "].");
-stop(idle ? "idle" : "dead");
+// If all sessions have been removed, no reason to linger.
+LOG_INF("Terminating dead DocumentBroker for docKey [" << 
getDocKey() << "].");
+stop("dead");
 }
 }
 
@@ -864,8 +876,8 @@ bool DocumentBroker::autoSave(const bool force)
 std::string savingSessionId;
 for (auto& sessionIt : _sessions)
 {
-// Save the document using first session available ...
-if (savingSessionId.empty())
+// Save the document using an editable session, or first ...
+if (savingSessionId.empty() || !sessionIt.second->isReadOnly())
 {
 savingSessionId = sessionIt.second->getId();
 }
@@ -1058,7 +1070,7 @@ size_t DocumentBroker::removeSession(const std::string& 
id)
 ", LastEditableSession: " << lastEditableSession);
 
 // If last editable, save and don't remove until after uploading to 
storage.
-if (!lastEditableSession || !autoSave(true))
+if (!lastEditableSession || !autoSave(isPossiblyModified()))
 removeSessionInternal(id);
 }
 catch (const std::exception& ex)
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 1e8e0746..1571e426 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -367,6 +367,11 @@ private:
 /// True iff a save is in progress (requested but not completed).
 bool isSaving() const { return _lastSaveResponseTime < 
_lastSaveRequestTime; }
 
+/// True if we know the doc is modified or
+/// if there has been activity from a client after we last *requested* 
saving,
+/// since there are race conditions vis-a-vis user activity while saving.
+bool isPossiblyModified() const { return _isModified || 
(_lastSaveRequestTime < _lastActivityTime); }
+
 /// True iff there is at least one non-readonly session other than the 
given.
 /// Since only editable sessions can save, we need to use the last to
 /// save modified documents, otherwise we'll potentially have to save on
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/LOOLWSD.cpp

2018-01-15 Thread Ashod Nakashian
 wsd/ClientSession.cpp  |2 +-
 wsd/DocumentBroker.cpp |   30 ++
 wsd/DocumentBroker.hpp |2 +-
 wsd/LOOLWSD.cpp|4 ++--
 4 files changed, 22 insertions(+), 16 deletions(-)

New commits:
commit b5baf3672fab052e5d7457fdb3a8c60c8fa70107
Author: Ashod Nakashian 
Date:   Sun Jan 14 20:49:11 2018 -0500

wsd: stop DocBroker using only stop() member

Now always given a proper reason too.

Also, stop polling thread and cleanup when
failing to acquire/spawn a child process.

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

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 061504c3..f644ae2c 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -716,7 +716,7 @@ bool ClientSession::handleKitToClientMessage(const char* 
buffer, const int lengt
 docBroker->removeSession(getId());
 
 // Now terminate.
-docBroker->stop();
+docBroker->stop("Finished saveas handler.");
 }
 
 return true;
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 44574aab..28a4920d 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -198,7 +198,7 @@ void DocumentBroker::pollThread()
   
_threadStart).count() > timeoutMs)
 break;
 
-// Nominal time between retries, lest we  busy-loop. getNewChild could 
also wait, so don't double that here.
+// Nominal time between retries, lest we busy-loop. getNewChild could 
also wait, so don't double that here.
 
std::this_thread::sleep_for(std::chrono::milliseconds(CHILD_REBALANCE_INTERVAL_MS
 / 10));
 }
 while (!_stop && _poll->continuePolling() && !TerminationFlag && 
!ShutdownRequestFlag);
@@ -209,14 +209,21 @@ void DocumentBroker::pollThread()
 LOG_ERR("Failed to get new child.");
 
 // FIXME: need to notify all clients and shut this down ...
+// FIXME: return something good down the websocket ...
 #if 0
 const std::string msg = SERVICE_UNAVAILABLE_INTERNAL_ERROR;
 ws.sendMessage(msg);
 // abnormal close frame handshake
 ws.shutdown(WebSocketHandler::StatusCodes::ENDPOINT_GOING_AWAY);
 #endif
-// FIXME: return something good down the websocket ...
-_stop = true;
+stop("Failed to get new child.");
+
+// Stop to mark it done and cleanup.
+_poll->stop();
+_poll->removeSockets();
+
+// Async cleanup.
+LOOLWSD::doHousekeeping();
 
 LOG_INF("Finished docBroker polling thread for docKey [" << _docKey << 
"].");
 return;
@@ -269,8 +276,7 @@ void DocumentBroker::pollThread()
 if (ShutdownRequestFlag)
 {
 autoSave(true);
-_closeReason = "recycling";
-_stop = true;
+stop("recycling");
 }
 else if (AutoSaveEnabled && !_stop &&
  std::chrono::duration_cast(now - 
last30SecCheckTime).count() >= 30)
@@ -288,8 +294,7 @@ void DocumentBroker::pollThread()
 {
 LOG_INF("Terminating " << (idle ? "idle" : "dead") <<
 " DocumentBroker for docKey [" << getDocKey() << "].");
-_closeReason = (idle ? "idle" : "dead");
-_stop = true;
+stop(idle ? "idle" : "dead");
 }
 }
 
@@ -374,8 +379,10 @@ void DocumentBroker::joinThread()
 _poll->joinThread();
 }
 
-void DocumentBroker::stop()
+void DocumentBroker::stop(const std::string& reason)
 {
+LOG_DBG("Closing DocumentBroker for docKey [" << _docKey << "] with 
reason: " << reason);
+_closeReason = reason; // used later in the polling loop
 _stop = true;
 _poll->wakeup();
 }
@@ -1553,7 +1560,7 @@ void DocumentBroker::terminateChild(const std::string& 
closeReason)
 
 LOG_INF("Terminating doc [" << _docKey << "] with reason: " << 
closeReason);
 
-// Close all running sessions
+// Close all running sessions first.
 shutdownClients(closeReason);
 
 if (_childProcess)
@@ -1566,7 +1573,7 @@ void DocumentBroker::terminateChild(const std::string& 
closeReason)
 _childProcess->close(false);
 }
 
-_stop = true;
+stop(closeReason);
 }
 
 void DocumentBroker::closeDocument(const std::string& reason)
@@ -1574,8 +1581,7 @@ void DocumentBroker::closeDocument(const std::string& 
reason)
 assertCorrectThread();
 
 LOG_DBG("Closing DocumentBroker for docKey [" << _docKey << "] with 
reason: " << reason);
-_closeReason = reason; // used later in the polling loop
-stop();
+stop(reason);
 }
 
 void DocumentBroker::broadcastMessage(const std::string& message)
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 0b8153ad..1e8e0746 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/Document

[Libreoffice-commits] online.git: 2 commits - wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/Storage.hpp

2018-01-15 Thread Ashod Nakashian
 wsd/ClientSession.cpp  |4 --
 wsd/DocumentBroker.cpp |   87 +
 wsd/DocumentBroker.hpp |   20 +--
 wsd/Storage.hpp|2 -
 4 files changed, 56 insertions(+), 57 deletions(-)

New commits:
commit 8ad29ee05006899a256016ed2ba00720dfc9b79f
Author: Ashod Nakashian 
Date:   Sun Jan 14 18:59:11 2018 -0500

wsd: separate lastSaveTime from lastSaveResponseTime

Previously we assumed we are saving based on
lastSaveTime, which is incorrect because it
is set only upon successful saving and storing,
which might fail.

Now lastSaveResponseTime is used to track whether
there are saving requests in flight. And lastSaveTime
is only used when we do store the document in storage.

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

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index bc363bc4..44574aab 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -258,7 +258,7 @@ void DocumentBroker::pollThread()
 adminRecv = recv;
 }
 
-if (_lastSaveTime < _lastSaveRequestTime &&
+if (isSaving() &&
 std::chrono::duration_cast
 (now - _lastSaveRequestTime).count() <= COMMAND_TIMEOUT_MS)
 {
@@ -698,6 +698,9 @@ bool DocumentBroker::saveToStorageInternal(const 
std::string& sessionId,
 {
 assertCorrectThread();
 
+// Record that we got a response to avoid timeing out on saving.
+_lastSaveResponseTime = std::chrono::steady_clock::now();
+
 const bool isSaveAs = !saveAsPath.empty();
 
 // If save requested, but core didn't save because document was unmodified
@@ -737,7 +740,6 @@ bool DocumentBroker::saveToStorageInternal(const 
std::string& sessionId,
 // Nothing to do.
 LOG_DBG("Skipping unnecessary saving to URI [" << uri << "] with 
docKey [" << _docKey <<
 "]. File last modified " << _lastFileModifiedTime.elapsed() / 
100 << " seconds ago.");
-_lastSaveTime = std::chrono::steady_clock::now();
 _poll->wakeup();
 return true;
 }
@@ -750,13 +752,13 @@ bool DocumentBroker::saveToStorageInternal(const 
std::string& sessionId,
 {
 if (!isSaveAs)
 {
+// Saved and stored; update flags.
 setModified(false);
 _lastFileModifiedTime = newFileModifiedTime;
 _tileCache->saveLastModified(_lastFileModifiedTime);
 _lastSaveTime = std::chrono::steady_clock::now();
-_poll->wakeup();
 
-// So set _documentLastModifiedTime then
+// Save the storage timestamp.
 _documentLastModifiedTime = _storage->getFileInfo()._modifiedTime;
 
 // After a successful save, we are sure that document in the 
storage is same as ours
@@ -765,6 +767,9 @@ bool DocumentBroker::saveToStorageInternal(const 
std::string& sessionId,
 Log::debug() << "Saved docKey [" << _docKey << "] to URI [" << uri
  << "] and updated tile cache. Document modified 
timestamp: "
  << _documentLastModifiedTime << Log::end;
+
+// Resume polling.
+_poll->wakeup();
 }
 else
 {
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 18c6e624..0b8153ad 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -364,6 +364,9 @@ private:
 /// Saves the doc to the storage.
 bool saveToStorageInternal(const std::string& sesionId, bool success, 
const std::string& result = "", const std::string& saveAsPath = std::string(), 
const std::string& saveAsFilename = std::string());
 
+/// True iff a save is in progress (requested but not completed).
+bool isSaving() const { return _lastSaveResponseTime < 
_lastSaveRequestTime; }
+
 /// True iff there is at least one non-readonly session other than the 
given.
 /// Since only editable sessions can save, we need to use the last to
 /// save modified documents, otherwise we'll potentially have to save on
@@ -408,14 +411,19 @@ private:
 /// document was modified and saved or not.
 std::chrono::steady_clock::time_point _lastSaveTime;
 
-/// The last time we sent a save request.
+/// The last time we sent a save request to lokit.
 std::chrono::steady_clock::time_point _lastSaveRequestTime;
 
+/// The last time we received a response for a save request from lokit.
+std::chrono::steady_clock::time_point _lastSaveResponseTime;
+
 /// The document's last-modified time on storage.
 Poco::Timestamp _documentLastModifiedTime;
 
 /// The jailed file last-modified time.
 Poco::Timestamp _lastFileModifiedTime;
+
+/// All session of this DocBroker by ID.
 std::map > _sessions;
 
 std::unique_ptr _storage;
diff --git a/wsd/

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

2018-01-15 Thread Miklos Vajna
 sw/inc/breakit.hxx|4 ++--
 sw/inc/docufld.hxx|6 +++---
 sw/source/core/bastyp/breakit.cxx |4 ++--
 sw/source/core/fields/docufld.cxx |   24 
 4 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit d54824438b29e433e6178a822e9207dfe28ef9af
Author: Miklos Vajna 
Date:   Mon Jan 15 09:09:35 2018 +0100

sw: prefix members of SwAuthorField, SwBreakIt and SwCombinedCharField

Change-Id: Ic277b91a75602b0997ff68feb46a9cad9dae4e46
Reviewed-on: https://gerrit.libreoffice.org/47891
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sw/inc/breakit.hxx b/sw/inc/breakit.hxx
index 4b0017a79a13..2dc5af732927 100644
--- a/sw/inc/breakit.hxx
+++ b/sw/inc/breakit.hxx
@@ -39,7 +39,7 @@ class SW_DLLPUBLIC SwBreakIt
 std::unique_ptr m_xLanguageTag;   ///< language tag of the 
current locale
 std::unique_ptr m_xForbidden;
 
-LanguageType aForbiddenLang; ///< language of the current forbiddenChar 
struct
+LanguageType m_aForbiddenLang; ///< language of the current forbiddenChar 
struct
 
 void GetLocale_( const LanguageType aLang );
 void GetLocale_( const LanguageTag& rLanguageTag );
@@ -103,7 +103,7 @@ public:
 
 const css::i18n::ForbiddenCharacters& GetForbidden( const LanguageType 
aLang )
 {
-if (!m_xForbidden || aForbiddenLang != aLang)
+if (!m_xForbidden || m_aForbiddenLang != aLang)
 GetForbidden_( aLang );
 return *m_xForbidden;
 }
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 1ab24e66a326..2295ce77fc2a 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -181,7 +181,7 @@ public:
 
 class SwAuthorField : public SwField
 {
-OUString aContent;
+OUString m_aContent;
 
 public:
 SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFormat);
@@ -189,7 +189,7 @@ public:
 virtual OUStringExpand() const override;
 virtual SwField*Copy() const override;
 
-void SetExpansion(const OUString& rStr) { aContent = rStr; }
+void SetExpansion(const OUString& rStr) { m_aContent = rStr; }
 
 virtual boolQueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) 
const override;
 virtual boolPutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
@@ -718,7 +718,7 @@ public:
 
 class SW_DLLPUBLIC SwCombinedCharField : public SwField
 {
-OUString sCharacters;///< combine these characters
+OUString m_sCharacters;///< combine these characters
 
 public:
 SwCombinedCharField( SwCombinedCharFieldType*, const OUString& rChars );
diff --git a/sw/source/core/bastyp/breakit.cxx 
b/sw/source/core/bastyp/breakit.cxx
index 5287dd3286fd..75e961e22130 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -54,7 +54,7 @@ SwBreakIt * SwBreakIt::Get()
 SwBreakIt::SwBreakIt( const uno::Reference & rxContext 
)
 : m_xContext(rxContext)
 , m_xBreak(i18n::BreakIterator::create(m_xContext))
-, aForbiddenLang(LANGUAGE_DONTKNOW)
+, m_aForbiddenLang(LANGUAGE_DONTKNOW)
 {
 }
 
@@ -78,7 +78,7 @@ void SwBreakIt::GetForbidden_( const LanguageType aLang )
 {
 LocaleDataWrapper aWrap(m_xContext, GetLanguageTag(aLang));
 
-aForbiddenLang = aLang;
+m_aForbiddenLang = aLang;
 m_xForbidden.reset(new 
i18n::ForbiddenCharacters(aWrap.getForbiddenCharacters()));
 }
 
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 2b9158b52a6e..47a7463b298e 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -330,23 +330,23 @@ SwFieldType* SwAuthorFieldType::Copy() const
 SwAuthorField::SwAuthorField(SwAuthorFieldType* pTyp, sal_uInt32 nFormat)
 : SwField(pTyp, nFormat)
 {
-aContent = SwAuthorFieldType::Expand(GetFormat());
+m_aContent = SwAuthorFieldType::Expand(GetFormat());
 }
 
 OUString SwAuthorField::Expand() const
 {
 if (!IsFixed())
-const_cast(this)->aContent =
+const_cast(this)->m_aContent =
 SwAuthorFieldType::Expand(GetFormat());
 
-return aContent;
+return m_aContent;
 }
 
 SwField* SwAuthorField::Copy() const
 {
 SwAuthorField *pTmp = new SwAuthorField( 
static_cast(GetTyp()),
 GetFormat());
-pTmp->SetExpansion(aContent);
+pTmp->SetExpansion(m_aContent);
 return pTmp;
 }
 
@@ -363,7 +363,7 @@ bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 
nWhichId ) const
 break;
 
 case FIELD_PROP_PAR1:
-rAny <<= aContent;
+rAny <<= m_aContent;
 break;
 
 default:
@@ -388,7 +388,7 @@ bool SwAuthorField::PutValue( const uno::Any& rAny, 
sal_uInt16 nWhichId )
 break;
 
 case FIELD_PROP_PAR1:
-rAny >>= aContent;
+rAny >>= m_aContent;
 break;
 
 default:
@@ -2539,29 +2539,29 @@ SwFieldType* SwCombinedCharFieldType::Copy() const
 SwCombinedCharFi

[Libreoffice-commits] core.git: Branch 'libreoffice-6-0-0' - 2 commits - comphelper/source configure.ac include/comphelper package/inc package/source sfx2/source xmlsecurity/qa

2018-01-15 Thread Thorsten Behrens
 comphelper/source/misc/docpasswordhelper.cxx  |   96 
 comphelper/source/misc/storagehelper.cxx  |4 
 configure.ac  |2 
 include/comphelper/docpasswordhelper.hxx  |3 
 package/inc/ZipPackageEntry.hxx   |1 
 package/inc/ZipPackageFolder.hxx  |2 
 package/inc/ZipPackageStream.hxx  |1 
 package/source/manifest/ManifestImport.cxx|  172 +-
 package/source/manifest/ManifestImport.hxx|   25 +++
 package/source/xstor/xstorage.cxx |4 
 package/source/zipapi/XUnbufferedStream.cxx   |5 
 package/source/zipapi/ZipFile.cxx |9 +
 package/source/zippackage/ZipPackage.cxx  |   62 +++
 package/source/zippackage/ZipPackageFolder.cxx|   10 -
 package/source/zippackage/ZipPackageStream.cxx|3 
 sfx2/source/appl/appopen.cxx  |9 +
 xmlsecurity/qa/unit/signing/data/encryptedGPG.odt |binary
 xmlsecurity/qa/unit/signing/data/pubring.gpg  |binary
 xmlsecurity/qa/unit/signing/data/secring.gpg  |binary
 xmlsecurity/qa/unit/signing/data/trustdb.gpg  |binary
 xmlsecurity/qa/unit/signing/signing.cxx   |   13 +
 21 files changed, 404 insertions(+), 17 deletions(-)

New commits:
commit 534d31fc2f06f36d7eb5d33cb6cb71f487c58586
Author: Thorsten Behrens 
Date:   Sun Dec 10 23:40:00 2017 +0100

tdf#114550: load back PGP encrypted files

This squashes the following commits from master:

 gpg4libre: import PGP encryption manifest
 Change-Id: Iadd7f8f1194299cb50907d8594114c89c668ebd0

 gpg4libre: open encrypted files also via gpg
 Change-Id: I1f626143e6c8443b4ad0c4fc5bdbd5ab8d56a451

 tdf#114550 use 32 bit random session key for gpg encryption
 Change-Id: I7303be71fd855aa454d07fcae04d7f42e3c9cd9c

 tdf#114550 recognize sym key & init vec as valid f/ decrypt
 Change-Id: Ie366f086a3c14d6b54b91b4edee8cfef1a42c44b

 tdf#114550 don't use PBKDF2 in package for gpg encryption
 Change-Id: Ic96b2193f8541bbd109795fb9c0212a0a10c7344

 gpg4libre: add initial unit test for encryption
 Change-Id: Id782dd865878ae7b8a60c7c80821b1370f6ac7e7

Change-Id: Id77b67a275bf91614ab62b65fdc69e4872247ffc
Reviewed-on: https://gerrit.libreoffice.org/47784
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 01c7a60c051ac4562e3a317dde3c29c507f3f40b)
Reviewed-on: https://gerrit.libreoffice.org/47834
Reviewed-by: Miklos Vajna 
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Thorsten Behrens 

diff --git a/comphelper/source/misc/docpasswordhelper.cxx 
b/comphelper/source/misc/docpasswordhelper.cxx
index 7d761bb9c740..81fe3bc5268c 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -17,11 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
 #include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,6 +33,13 @@
 #include 
 #include 
 
+#if HAVE_FEATURE_GPGME
+# include 
+# include 
+# include 
+# include 
+#endif
+
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Exception;
 using ::com::sun::star::uno::Reference;
@@ -420,6 +431,91 @@ Sequence< sal_Int8 > 
DocPasswordHelper::GetXLHashAsSequence(
 return (eResult == DocPasswordVerifierResult::OK) ? aEncData : 
uno::Sequence< beans::NamedValue >();
 }
 
+/*static*/ uno::Sequence< css::beans::NamedValue >
+DocPasswordHelper::decryptGpgSession(
+const uno::Sequence< uno::Sequence< beans::NamedValue > >& 
rGpgProperties )
+{
+#if HAVE_FEATURE_GPGME
+if ( !rGpgProperties.hasElements() )
+return uno::Sequence< beans::NamedValue >();
+
+uno::Sequence< beans::NamedValue > aEncryptionData(1);
+std::unique_ptr ctx;
+GpgME::initializeLibrary();
+GpgME::Error err = GpgME::checkEngine(GpgME::OpenPGP);
+if (err)
+throw uno::RuntimeException("The GpgME library failed to initialize 
for the OpenPGP protocol.");
+
+ctx.reset( GpgME::Context::createForProtocol(GpgME::OpenPGP) );
+if (ctx == nullptr)
+throw uno::RuntimeException("The GpgME library failed to initialize 
for the OpenPGP protocol.");
+ctx->setArmor(false);
+
+const uno::Sequence < beans::NamedValue > *pSequence = 
rGpgProperties.getConstArray();
+const sal_Int32 nLength = rGpgProperties.getLength();
+for ( sal_Int32 i = 0; i < nLength ; i++, pSequence++ )
+{
+const beans::NamedValue *pValues = pSequence->getConstArray();
+if ( pSequence->getLength() == 3 )
+{
+// take CipherValue and try to decrypt that - stop after
+// the first successful decryption
+
+// ctx is setup now, let's decrypt the lot!
+uno::

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

2018-01-15 Thread Justin Luth
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |3 +--
 writerfilter/source/dmapper/DomainMapper.cxx |4 ++--
 writerfilter/source/dmapper/NumberingManager.cxx |1 +
 writerfilter/source/dmapper/StyleSheetTable.cxx  |3 ++-
 writerfilter/source/dmapper/StyleSheetTable.hxx  |1 +
 5 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 7201d157a2ff2f0a8b6bb8fa57e31871187cbc81
Author: Justin Luth 
Date:   Fri Jan 12 20:44:06 2018 +0300

tdf#76817 ooxmlimport: connect Heading to existing numbers

This fixes the inability to insert a numbered Heading into
an existing sequence in an opened document. Before it would
start a new sequence, but now it connects to / adjusts
the other numbered Headings.

LibreOffice has built-in handling for "Chapter Numbering".
All of the formatting for this is tied to the paragraph stylename.

Since MSO has a different structure, in docx format these
are defined as "regular" styles with an OutlineLvl component.
During import, that style information was copied to LO's special
Outline chapter numbering style. *From this point on, the
"regular" list style should no longer be referred to.* Numbering is only
defined by the paragraph stylename (which by definition is "Heading X").

The unit test I am hijacking has an unchangeable Paragraph Numbering
style of "Outline Numbering" and not WWNumX. So, in reality the
document ought to require the style name to be the internal Outline
style like it originally was.
A followup patch allows this to round-trip.

Change-Id: If5d544529fa32d4abaa2b46403bc61c028e53f21
Reviewed-on: https://gerrit.libreoffice.org/47827
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 536eea8c6d07..d040ab9f1105 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -688,8 +688,7 @@ DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumberTypes, 
"outline-number-types.odt"
 
 DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
 {
-// This was "Outline", i.e.  was not imported from the Heading 2 
paragraph style.
-CPPUNIT_ASSERT(getProperty(getParagraph(4), 
"NumberingStyleName").startsWith("WWNum"));
+//CPPUNIT_ASSERT_EQUAL(OUString("Outline"), 
getProperty(getParagraph(4), "NumberingStyleName"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index f79809c78fcd..2d56bd9a449b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2166,8 +2166,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 sal_Int32 nListId = pEntry ? lcl_getListId(pEntry, pStyleTable) : 
-1;
 if( pStyleSheetProperties && nListId >= 0 )
 {
-rContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny(
-ListDef::GetStyleName( nListId ) ), false);
+if ( !pEntry->bIsChapterNumbering )
+rContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny( 
ListDef::GetStyleName( nListId ) ), false);
 
 // We're inheriting properties from a numbering style. Make 
sure a possible right margin is inherited from the base style.
 sal_Int32 nParaRightMargin = 0;
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 273501e6ccc6..72308e05c117 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -629,6 +629,7 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
 xOutlines->getChapterNumberingRules( );
 
 StyleSheetEntryPtr pParaStyle = pAbsLevel->GetParaStyle( );
+pParaStyle->bIsChapterNumbering = true;
 
aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HEADING_STYLE_NAME),
 pParaStyle->sConvertedStyleName));
 
 xOutlineRules->replaceByIndex(nLevel, 
uno::makeAny(comphelper::containerToSequence(aLvlProps)));
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 54a85958f11e..3e17b25eae89 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -56,6 +56,7 @@ StyleSheetEntry::StyleSheetEntry() :
 sStyleIdentifierI()
 ,sStyleIdentifierD()
 ,bIsDefaultStyle(false)
+,bIsChapterNumbering(false)
 ,bInvalidHeight(false)
 ,bHasUPE(false)
 ,nStyleTypeCode(STYLE_TYPE_UNKNOWN)
@@ 

[Libreoffice-commits] core.git: basctl/source editeng/source filter/source framework/source oox/source sc/qa sc/source sd/source shell/source sw/qa sw/source

2018-01-15 Thread Andrea Gelmini
 basctl/source/basicide/baside2b.cxx |2 +-
 editeng/source/misc/svxacorr.cxx|4 ++--
 editeng/source/outliner/outliner.cxx|4 ++--
 filter/source/config/cache/filtercache.cxx  |2 +-
 filter/source/msfilter/msoleexp.cxx |2 +-
 framework/source/services/autorecovery.cxx  |   16 
 framework/source/services/frame.cxx |   10 +-
 oox/source/drawingml/diagram/layoutatomvisitors.cxx |2 +-
 sc/qa/unit/ucalc.cxx|2 +-
 sc/source/ui/unoobj/docuno.cxx  |2 +-
 sc/source/ui/view/tabview3.cxx  |2 +-
 sc/source/ui/view/viewfun3.cxx  |2 +-
 sd/source/ui/view/drviews1.cxx  |2 +-
 shell/source/cmdmail/cmdmailsuppl.cxx   |2 +-
 sw/qa/extras/odfexport/odfexport.cxx|2 +-
 sw/qa/extras/uiwriter/uiwriter.cxx  |2 +-
 sw/source/core/text/itrcrsr.cxx |2 +-
 sw/source/core/unocore/unostyle.cxx |2 +-
 18 files changed, 31 insertions(+), 31 deletions(-)

New commits:
commit a6b69a9384801f77f4cc30a366a45561c28eab3e
Author: Andrea Gelmini 
Date:   Mon Jan 15 09:11:52 2018 +0100

Fix typo

Change-Id: I51c97356c9c2939f2d94d6388c829a179ca00daa
Reviewed-on: https://gerrit.libreoffice.org/47853
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index b4036f27f159..2b44c67dead8 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1227,7 +1227,7 @@ void EditorWindow::DoSyntaxHighlight( sal_uLong nPara )
 // that this line does not exist anymore!
 if ( nPara < pEditEngine->GetParagraphCount() )
 {
-// unfortunately I'm not sure that excactly this line does Modified() 
...
+// unfortunately I'm not sure that exactly this line does Modified()...
 if ( pProgress )
 pProgress->StepProgress();
 ImpDoHighlight( nPara );
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index fc8fb97e140f..0b830e96c3b6 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1764,7 +1764,7 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType 
eLang,
 {
 LanguageTag aLanguageTag( eLang);
 
-/* TODO-BCP47: again horrible uglyness */
+/* TODO-BCP47: again horrible ugliness */
 
 // First search for eLang, then primary language of eLang
 // and last in LANGUAGE_UNDETERMINED
@@ -1841,7 +1841,7 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType 
eLang,
 {
 LanguageTag aLanguageTag( eLang);
 
-/* TODO-BCP47: did I mention terrible horrible uglyness? */
+/* TODO-BCP47: did I mention terrible horrible ugliness? */
 
 // First search for eLang, then primary language of eLang
 // and last in LANGUAGE_UNDETERMINED
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 5112c7cfd000..b6d5ac108ecc 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2026,7 +2026,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 sal_Int32 nCount = pEditEngine->GetOverflowingParaNum();
 sal_Int32 nOverflowLine = pEditEngine->GetOverflowingLineNum(); // XXX: 
Unused for now
 
-// Defensive check: oveflowing para index beyond actual # of paragraphs?
+// Defensive check: overflowing para index beyond actual # of paragraphs?
 if ( nCount > GetParagraphCount()-1) {
 SAL_INFO("editeng.chaining",
  "[Overflowing] Ops, trying to retrieve para "
@@ -2133,7 +2133,7 @@ OverflowingText *Outliner::GetOverflowingText() const
 return nullptr;
 
 
-// Defensive check: oveflowing para index beyond actual # of paragraphs?
+// Defensive check: overflowing para index beyond actual # of paragraphs?
 if ( pEditEngine->GetOverflowingParaNum() > GetParagraphCount()-1) {
 SAL_INFO("editeng.chaining",
  "[Overflowing] Ops, trying to retrieve para "
diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index c551e8f43bb0..f56186ac0cde 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -1029,7 +1029,7 @@ void FilterCache::impl_validateAndOptimize()
 // a "Preferred" one - set it to the front of this list.
 // Of course multiple "Preferred" registrations can occur
 // (they shouldn't - but they can!) ... Ignore it. The last
-// preferred type is useable in the same manner then every
+// preferred type is usable in the same manner then every
 // other type!
 bool bPreferred = false;
 aTyp

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

2018-01-15 Thread Samuel Mehrbrodt
 comphelper/source/misc/graphicmimetype.cxx |8 +++---
 xmloff/source/core/xmlmultiimagehelper.cxx |   37 +
 2 files changed, 32 insertions(+), 13 deletions(-)

New commits:
commit 3da86d8987db6223b0acc5d8a1b56f7e0c54bbef
Author: Samuel Mehrbrodt 
Date:   Fri Jan 12 17:32:41 2018 +0100

tdf#114488 Rank multiple images also for flat odf

Only the file extension was considered before
which is not available in flat odf.

Now both internal and external URLs are resolved to their respective 
mimetype.

Change-Id: Id7e290cd9a441a1a6c2ce5e8d764391c50495bea
Reviewed-on: https://gerrit.libreoffice.org/47824
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/comphelper/source/misc/graphicmimetype.cxx 
b/comphelper/source/misc/graphicmimetype.cxx
index bf88312304b1..559c3087a2da 100644
--- a/comphelper/source/misc/graphicmimetype.cxx
+++ b/comphelper/source/misc/graphicmimetype.cxx
@@ -19,12 +19,12 @@
 
 #include 
 
-#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -48,8 +48,8 @@ OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(const 
OString& rExt)
 static const XMLGraphicMimeTypeMapper aMapper[]
 = { { "gif", "image/gif" },   { "png", "image/png" }, { "jpg", 
"image/jpeg" },
 { "tif", "image/tiff" },  { "svg", "image/svg+xml" }, { "pdf", 
"application/pdf" },
-{ "wmf", "image/x-wmf" }, { "eps", "image/x-eps" },   { "bmp", 
"image/bmp" },
-{ "pct", "image/x-pict" } };
+{ "wmf", "image/x-wmf" }, { "emf", "image/x-emf" },   { "eps", 
"image/x-eps" },
+{ "bmp", "image/bmp" },   { "pct", "image/x-pict" },  { "svm", 
"image/x-svm" } };
 
 OUString aMimeType;
 
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx 
b/xmloff/source/core/xmlmultiimagehelper.cxx
index 3a5ad69d4c65..3d7725a3b24f 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -20,48 +20,67 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::com::sun::star;
 
 namespace
 {
 sal_uInt32 getQualityIndex(const OUString& rString)
 {
+OUString sMimeType;
+if (rString.startsWith("vnd.sun.star.GraphicObject"))
+{
+sMimeType = 
comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageUrl(rString);
+}
+else if (rString.startsWith("vnd.sun.star.Package"))
+{
+sMimeType
+= 
comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension(OUStringToOString(
+rString.copy(rString.lastIndexOf(".") + 1), 
RTL_TEXTENCODING_ASCII_US));
+}
+else
+{
+SAL_WARN("xmloff", "Unknown image source: " << rString);
+return 0;
+}
+
 // pixel formats first
-if(rString.endsWith(".bmp"))
+if(sMimeType == "image/bmp")
 {
 return 10;
 }
-if(rString.endsWith(".gif"))
+if(sMimeType == "image/gif")
 {
 return 20;
 }
-if(rString.endsWith(".jpg"))
+if(sMimeType == "image/jpeg")
 {
 return 30;
 }
-if(rString.endsWith(".png"))
+if(sMimeType == "image/png")
 {
 return 40;
 }
 
 // vector formats, prefer always
-if(rString.endsWith(".svm"))
+if(sMimeType == "image/x-svm")
 {
 return 1000;
 }
-if(rString.endsWith(".wmf"))
+if(sMimeType == "image/x-wmf")
 {
 return 1010;
 }
-if(rString.endsWith(".emf"))
+if(sMimeType == "image/x-emf")
 {
 return 1020;
 }
-if(rString.endsWith(".pdf"))
+if(sMimeType == "application/pdf")
 {
 return 1030;
 }
-if(rString.endsWith(".svg"))
+if(sMimeType == "image/svg+xml")
 {
 return 1040;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: University practical exercise about LibreOffice

2018-01-15 Thread Jacobo Aragunde Pérez
Hi Adrián,

the code base of LibreOffice predates most bibliography about software
patterns, so you aren't going to find documents like those here!

Still, I made a presentation some time ago that you may find useful,
specially the parts that describe the branch model, how releases work, etc.

https://blogs.igalia.com/jaragunde/2015/11/11/updated-libreoffice-workshop-at-a-coruna-university/

The Android code is, indeed, modern, but it follows the good old
development methodology of "hack something together until it works, then
polish" :) You can still find some patterns, a good developer will find
ways to reuse code or structures, but sometimes it's not even a
conscious decision, and you won't find documentation about that
excepting blog posts from the authors, if they feel like writing about
that. Maybe check the blogs linked from:
https://planet.documentfoundation.org/

If you dig a bit more in my blog you will find some posts about the
Android code that might (or might not!) be interesting. Like I said
before, they explain the parts I wrote. But please, don't ask about them
because I've totally forgot at this point! :D

Hope this helps. Good luck!

Best,
-- 
Jacobo Aragunde
Software Engineer at Igalia



On 15/01/18 10:40, Adrian Lopez wrote:
> 
> Hi,
> 
> No, I am not the guy who asked in the IRC channel, I have continued
> revising the code of the android module of the application core, but I
> am having some difficulties about recognizing design patterns clearly. I
> have seen something similar to the Observer pattern in classes related
> to control scrolling, or something similar to Composite pattern in the
> way the layers are being composed. However I did not find a whole
> pattern to write about it apart from Factory or Singleton. Could someone
> help me about that in a more specific way?
> 
> Than you very mutch in advance.
> 
> Bye,
> 
> Adrián López Martínez 
> 
> El 14/1/2018 4:06 p. m., "Tor Lillqvist"  > escribió:
> 
> Are you the guy who has asked about this in the developer IRC
> channel? I think you were given this pointer already, but I repeat
> it here for posterity: http://laputan.org/mud/ 
> 
> --tml
> 
> 
> 
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
> 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: common/Session.cpp

2018-01-15 Thread Tor Lillqvist
 common/Session.cpp |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e834526983521fc503fe259533fde8be531f59bd
Author: Tor Lillqvist 
Date:   Mon Jan 15 14:21:49 2018 +0200

Add FIXME

diff --git a/common/Session.cpp b/common/Session.cpp
index 6070955c..0a9f9c3a 100644
--- a/common/Session.cpp
+++ b/common/Session.cpp
@@ -86,7 +86,9 @@ void Session::parseDocOptions(const std::vector& 
tokens, int& part,
 
 for (size_t i = offset; i < tokens.size(); ++i)
 {
-// FIXME use any kind of startsWith() instead of find(...) == 0
+// FIXME use Util::startsWith() instead of all these find(...) == 0
+// FIXME or use the getToken* functions, isn't this exactly what they 
are for?
+
 if (tokens[i].find("url=") == 0)
 {
 _docURL = tokens[i].substr(strlen("url="));
___
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-5.3' - sc/inc sc/source

2018-01-15 Thread Marco Cecchetti
 sc/inc/clipparam.hxx  |6 --
 sc/source/core/data/clipparam.cxx |6 ++
 sc/source/ui/view/viewfun3.cxx|   25 -
 3 files changed, 2 insertions(+), 35 deletions(-)

New commits:
commit ace85fd824611349e637f37b9644b6fe62cb
Author: Marco Cecchetti 
Date:   Wed Jan 10 19:19:19 2018 +0100

Revert "lok: sc: copy / paste confusion -- workaround"

This reverts commit 7fc62b59ddad40f725709f14331c38c0a78ff6ee.

This workaround is no more needed because of commit dc916fd

Change-Id: Icd13b245d5965c2b2ece326f7f5705cf06cf1b64
Reviewed-on: https://gerrit.libreoffice.org/47765
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index 16555225d074..2e5dece711e8 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -26,8 +26,6 @@
 
 #include 
 
-class SfxViewShell;
-
 /**
  * This struct stores general clipboard parameters associated with a
  * ScDocument instance created in clipboard mode.
@@ -40,7 +38,6 @@ struct ScClipParam
 Direction   meDirection;
 boolmbCutMode;
 sal_uInt32  mnSourceDocID;
-SfxViewShell*   mpSourceView;
 ScRangeListVector   maProtectedChartRangesVector;
 
 ScClipParam();
@@ -70,9 +67,6 @@ struct ScClipParam
 
 sal_uInt32 getSourceDocID() const { return mnSourceDocID; }
 void setSourceDocID( sal_uInt32 nVal ) { mnSourceDocID = nVal; }
-
-SfxViewShell* getSourceView() const { return mpSourceView; }
-void setSourceView( SfxViewShell* pSourceView ) { mpSourceView = 
pSourceView; }
 };
 
 #endif
diff --git a/sc/source/core/data/clipparam.cxx 
b/sc/source/core/data/clipparam.cxx
index bc856672fbba..9c08d6093dfc 100644
--- a/sc/source/core/data/clipparam.cxx
+++ b/sc/source/core/data/clipparam.cxx
@@ -23,16 +23,14 @@
 ScClipParam::ScClipParam() :
 meDirection(Unspecified),
 mbCutMode(false),
-mnSourceDocID(0),
-mpSourceView(nullptr)
+mnSourceDocID(0)
 {
 }
 
 ScClipParam::ScClipParam(const ScRange& rRange, bool bCutMode) :
 meDirection(Unspecified),
 mbCutMode(bCutMode),
-mnSourceDocID(0),
-mpSourceView(nullptr)
+mnSourceDocID(0)
 {
 maRanges.Append(rRange);
 }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 712db2c511e7..719ebda2d4c1 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -37,9 +37,6 @@
 #include 
 #include 
 
-#include 
-#include 
-
 #include "attrib.hxx"
 #include "patattr.hxx"
 #include "dociter.hxx"
@@ -228,14 +225,6 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const 
ScRangeList& rRanges, b
 // and lose the 'if' above
 aClipParam.setSourceDocID( pDoc->GetDocumentID() );
 
-// This is only a workaround, which doesn't allow to paste content
-// in one view which has been copied in a different view.
-// TODO: implement a solution providing one clipboard per view
-if (comphelper::LibreOfficeKit::isActive())
-{
-aClipParam.setSourceView(GetViewData().GetViewShell());
-}
-
 if (SfxObjectShell* pObjectShell = pDoc->GetDocumentShell())
 {
 // Copy document properties from pObjectShell to pClipDoc (to 
its clip options, as it has no object shell).
@@ -879,20 +868,6 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
 if (GetViewData().SelectionForbidsCellFill())
 return false;
 
-// This is only a workaround, which doesn't allow to paste content
-// in one view which has been copied in a different view.
-// TODO: implement a solution providing one clipboard per view
-if (comphelper::LibreOfficeKit::isActive())
-{
-ScTabViewShell* pThisView = GetViewData().GetViewShell();
-ScTabViewShell* pSourceView = 
dynamic_cast(pClipDoc->GetClipParam().getSourceView());
-
-if (pThisView && pSourceView && pThisView != pSourceView)
-{
-return false;
-}
-}
-
 //  undo: save all or no content
 InsertDeleteFlags nContFlags = InsertDeleteFlags::NONE;
 if (nFlags & InsertDeleteFlags::CONTENTS)
___
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-5.3' - sc/source

2018-01-15 Thread Marco Cecchetti
 sc/source/ui/view/viewfun2.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 233101a135d2e6dd67f3eaf9f54ac56d43c372cf
Author: Marco Cecchetti 
Date:   Thu Jan 11 16:03:30 2018 +0100

lok: sc: invalidate cached positions and row header on font resizing

Change-Id: I9678d6bd730d09d1cc47a8633368c99abe1f9bd9
Reviewed-on: https://gerrit.libreoffice.org/47763
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 3373a97264ad..45bb9e106e84 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -115,6 +115,12 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
 aMarkedRows.push_back(sc::ColRowSpan(nCurRow, nCurRow));
 }
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+SCCOLROW nStart = aMarkedRows[0].mnStart;
+OnLOKSetWidthOrHeight(nStart, /*width: */ false);
+}
+
 double nPPTX = GetViewData().GetPPTX();
 double nPPTY = GetViewData().GetPPTY();
 Fraction aZoomX = GetViewData().GetZoomX();
@@ -158,11 +164,19 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
 if ( bPaint && bAnyChanged )
 pDocSh->UpdateOle(&GetViewData());
 
+if (comphelper::LibreOfficeKit::isActive())
+ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, 
GetViewData().GetTabNo());
+
 return bAnyChanged;
 }
 
 bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+OnLOKSetWidthOrHeight(nStartRow, /*width: */ false);
+}
+
 ScDocShell* pDocSh = GetViewData().GetDocShell();
 ScDocument& rDoc = pDocSh->GetDocument();
 SCTAB nTab = GetViewData().GetTabNo();
@@ -195,6 +209,9 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW 
nEndRow )
 pDocSh->PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab,
 PaintPartFlags::Grid | 
PaintPartFlags::Left );
 
+if (comphelper::LibreOfficeKit::isActive())
+ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, 
GetViewData().GetTabNo());
+
 return bChanged;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: common/Util.hpp

2018-01-15 Thread Tor Lillqvist
 common/Util.hpp |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7bf59d8f648680747c3a2c26b7836d1b92f9e63a
Author: Tor Lillqvist 
Date:   Mon Jan 15 13:37:40 2018 +0200

Add Util::startsWith() to check whether a std::string starts with another

Odd that we have managed without such a helper for so long, or did I
just not find it?

diff --git a/common/Util.hpp b/common/Util.hpp
index eef52464..b4eb3504 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -285,6 +285,11 @@ namespace Util
 return trimmed(std::string(s));
 }
 
+inline bool startsWith(const std::string& s, const std::string& t)
+{
+return s.length() >= t.length() && memcmp(s.c_str(), t.c_str(), 
t.length()) == 0;
+}
+
 /// Given one or more patterns to allow, and one or more to deny,
 /// the match member will return true if, and only if, the subject
 /// matches the allowed list, but not the deny.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

2018-01-15 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 4bf18a7bd2b96311d39abb92f1a9a3826db94515
Author: Pranav Kant 
Date:   Mon Jan 15 16:47:04 2018 +0530

loleaflet: Delay showing of dialog until we have the content

Change-Id: I5d29e64011931fc285191eb713f8cf746dbc6963
(cherry picked from commit 1f410064da480520050a00c5a6507c80e1d272b7)
Reviewed-on: https://gerrit.libreoffice.org/47896
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 82f69130..21d8a6e5 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -202,6 +202,8 @@ L.Control.LokDialog = L.Control.extend({
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
});
+   // don't show the dialog surround until we have the dialog 
content
+   $(dialogContainer).parent().hide();
 
this._dialogs[this._toRawDlgId(strDlgId)] = {
open: true,
@@ -270,6 +272,10 @@ L.Control.LokDialog = L.Control.extend({
}
 
ctx.drawImage(img, x, y);
+
+   // if dialog is hidden, show it
+   var dialogContainer = L.DomUtil.get(strDlgId);
+   $(dialogContainer).parent().show();
};
img.src = imgData;
},
___
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-5.3' - sc/source

2018-01-15 Thread Marco Cecchetti
 sc/source/ui/inc/viewdata.hxx  |   52 
 sc/source/ui/view/gridwin4.cxx |   92 ---
 sc/source/ui/view/tabview.cxx  |  243 -
 sc/source/ui/view/viewdata.cxx |  198 +
 4 files changed, 301 insertions(+), 284 deletions(-)

New commits:
commit 2033424f6e6d8869990c4b8c69225be99a82ea23
Author: Marco Cecchetti 
Date:   Sun Jan 7 16:54:47 2018 +0100

lok: sc: exploiting cached position helper for tile rendering

Change-Id: I02b21c5979d1dfb6bb60a05d891c632602fb44ee
Reviewed-on: https://gerrit.libreoffice.org/47548
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 6fc2d748a670..0deff35acf90 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -147,6 +147,58 @@ public:
 index_type getIndex(long nPos) const;
 };
 
+class ScBoundsProvider
+{
+typedef ScPositionHelper::value_type value_type;
+typedef SCCOLROW index_type;
+
+ScDocument* pDoc;
+const SCTAB nTab;
+const bool bColumnHeader;
+const index_type MAX_INDEX;
+
+index_type nFirstIndex;
+index_type nSecondIndex;
+long nFirstPositionPx;
+long nSecondPositionPx;
+
+public:
+ScBoundsProvider(ScDocument* pD, SCTAB nT, bool bColumnHeader);
+
+void GetStartIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
+void GetEndIndexAndPosition(SCCOL& nIndex, long& nPosition) const;
+void GetStartIndexAndPosition(SCROW& nIndex, long& nPosition) const;
+void GetEndIndexAndPosition(SCROW& nIndex, long& nPosition) const;
+
+void Compute(value_type aFirstNearest, value_type aSecondNearest,
+ long nFirstBound, long nSecondBound);
+
+void EnlargeStartBy(long nOffset);
+
+void EnlargeEndBy(long nOffset);
+
+void EnlargeBy(long nOffset)
+{
+EnlargeStartBy(nOffset);
+EnlargeEndBy(nOffset);
+}
+
+private:
+long GetSize(index_type nIndex) const;
+
+void GetIndexAndPos(index_type nNearestIndex, long nNearestPosition,
+long nBound, index_type& nFoundIndex, long& nPosition,
+bool bTowards, long nDiff);
+
+void GeIndexBackwards(index_type nNearestIndex, long nNearestPosition,
+  long nBound, index_type& nFoundIndex, long& 
nPosition,
+  bool bTowards);
+
+void GetIndexTowards(index_type nNearestIndex, long nNearestPosition,
+ long nBound, index_type& nFoundIndex, long& nPosition,
+ bool bTowards);
+};
+
 class ScViewDataTable   // per-sheet data
 {
 friend class ScViewData;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 228f087e8790..f89deb007e0a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1074,41 +1074,41 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 mpNoteMarker->Draw(); // Above the cursor, in drawing map mode
 }
 
-namespace {
-// Find the row/col just -before- the nPosition in pixels and its offset
-inline void mapConservativeToRowCol(ScDocument *pDoc,
-sal_Int32  *nIndex,
-sal_Int32  *nOffset,
-sal_Int32  *nOrigin,
-sal_Int32   nTabNo,
-sal_Int32   nPosition,
-boolbRowNotCol,
-double  nPPTX,
-double  nPPTY)
+namespace
+{
+template
+inline
+void lcl_getBoundingRowColumnforTile(ScViewData* pViewData,
+long nTileStartPosPx, long nTileEndPosPx,
+sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin,
+sal_Int32& nTopLeftTileIndex, sal_Int32& nBottomRightTileIndex)
 {
-long nTmp = 0; // row/col to render for nPosition
-long nLastScrPos = 0, nScrPos = 0;
-const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL;
-while (nScrPos <= nPosition && nTmp < nMaxIndex)
-{
-long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo )
-: pDoc->GetColWidth( nTmp, nTabNo );
-if (nSize)
-{
-nLastScrPos = nScrPos;
-nScrPos += ScViewData::ToPixel( nSize, bRowNotCol ? nPPTY : 
nPPTX );
-} // else - FIXME 'skip multiple hidden rows'
+const bool bColumnHeader = std::is_same::value;
 
-*nIndex = nTmp;
-nTmp++;
-}
+SCTAB nTab = pViewData->GetTabNo();
+ScDocument* pDoc = pViewData->GetDocument();
 
-// offset into that row/col for nPosition
-assert 

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

2018-01-15 Thread Tamás Zolnai
 sw/source/core/crsr/crsrsh.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a932f845a3054d3d5b6d9515eeceea0060fbc4ef
Author: Tamás Zolnai 
Date:   Sat Jan 6 20:56:04 2018 +0100

tdf#114872: Broken selection from other user

For desktop LO cursor update is restricted to the active
view, but for LO online the users's selection is shown also
from other views.

Change-Id: Ia9bc8854ee570a9a22c183bf27f941ecf0b8e4d9
Reviewed-on: https://gerrit.libreoffice.org/47520
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 0b8713ea0c0290ed2a4d711f44bf9a19b214bb62)
Reviewed-on: https://gerrit.libreoffice.org/47545
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 094d11a4e29d..e7f211c3d7ac 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1842,7 +1842,10 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, 
bool bIdleEnd )
 if( m_pBlockCursor )
 RefreshBlockCursor();
 
-if( !bIdleEnd && m_bHasFocus && !m_bBasicHideCursor )
+// We should not restrict cursor update to the active view when using LOK
+bool bCheckFocus = m_bHasFocus || comphelper::LibreOfficeKit::isActive();
+
+if( !bIdleEnd && bCheckFocus && !m_bBasicHideCursor )
 {
 if( m_pTableCursor )
 m_pTableCursor->SwSelPaintRects::Show();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2018-01-15 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1f410064da480520050a00c5a6507c80e1d272b7
Author: Pranav Kant 
Date:   Mon Jan 15 16:47:04 2018 +0530

loleaflet: Delay showing of dialog until we have the content

Change-Id: I5d29e64011931fc285191eb713f8cf746dbc6963

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index b6cb4c41..6dd22772 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -204,6 +204,8 @@ L.Control.LokDialog = L.Control.extend({
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
});
+   // don't show the dialog surround until we have the dialog 
content
+   $(dialogContainer).parent().hide();
 
this._dialogs[this._toRawDlgId(strDlgId)] = {
open: true,
@@ -272,6 +274,10 @@ L.Control.LokDialog = L.Control.extend({
}
 
ctx.drawImage(img, x, y);
+
+   // if dialog is hidden, show it
+   var dialogContainer = L.DomUtil.get(strDlgId);
+   $(dialogContainer).parent().show();
};
img.src = imgData;
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/Admin.hpp

2018-01-15 Thread Miklos Vajna
 wsd/Admin.hpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a427d6249fce110f9582f4c89c35ff373109ede
Author: Miklos Vajna 
Date:   Mon Jan 15 11:58:06 2018 +0100

wsd: static next to const int is not necessary

cost int is already compile-time.

diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index 724cbaec..649f0661 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -145,7 +145,7 @@ private:
 DocProcSettings _defDocProcSettings;
 
 // Don't update any more frequently than this since it's excessive.
-static const int MinStatsIntervalMs = 50;
+const int MinStatsIntervalMs = 50;
 };
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: .git-hooks/pre-commit

2018-01-15 Thread Miklos Vajna
 .git-hooks/pre-commit |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit 0623f3a8f5d6fbc5e9b933cb034184084e8ac666
Author: Miklos Vajna 
Date:   Mon Jan 15 09:17:02 2018 +0100

git pre-commit hook: catch copy&pasted author identity

git log --author="Your"

confirms that this happens in practice.

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

diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
index e859919fa566..8c4e86345aa1 100755
--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -109,6 +109,17 @@ sub check_whitespaces($)
 }
 }
 
+sub check_author()
+{
+my $author = `git var GIT_AUTHOR_IDENT`;
+chomp $author;
+if ($author =~ /^Your Name /)
+{
+print("ERROR: You have a suspicious author identity: '$author'\n");
+exit(1);
+}
+}
+
 sub check_style($)
 {
 if (! -e "solenv/clang-format/ClangFormat.pm")
@@ -266,6 +277,9 @@ check_whitespaces( $against);
 # fix style in code
 check_style($against);
 
+# catch missing author info
+check_author();
+
 # all OK
 exit( 0 );
 # vi:set shiftwidth=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: University practical exercise about LibreOffice

2018-01-15 Thread Adrian Lopez
Hi,

No, I am not the guy who asked in the IRC channel, I have continued
revising the code of the android module of the application core, but I am
having some difficulties about recognizing design patterns clearly. I have
seen something similar to the Observer pattern in classes related to
control scrolling, or something similar to Composite pattern in the way the
layers are being composed. However I did not find a whole pattern to write
about it apart from Factory or Singleton. Could someone help me about that
in a more specific way?

Than you very mutch in advance.

Bye,

Adrián López Martínez

El 14/1/2018 4:06 p. m., "Tor Lillqvist"  escribió:

> Are you the guy who has asked about this in the developer IRC channel? I
> think you were given this pointer already, but I repeat it here for
> posterity: http://laputan.org/mud/
>
> --tml
>
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: io/source lingucomponent/source sot/source

2018-01-15 Thread Noel Grandin
 io/source/stm/omark.cxx   |6 +++---
 io/source/stm/opipe.cxx   |4 ++--
 io/source/stm/streamhelper.cxx|2 +-
 io/source/stm/streamhelper.hxx|3 ---
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |   11 ---
 sot/source/sdstor/ucbstorage.cxx  |4 +---
 6 files changed, 11 insertions(+), 19 deletions(-)

New commits:
commit 34d8710fff4859d455b51a7e0d90fe3a35bf2e6b
Author: Noel Grandin 
Date:   Tue Jan 9 13:28:35 2018 +0200

remove local copies of std::min,std::max

Change-Id: I067c4dcabad55180e4734fb06338a8e843713936
Reviewed-on: https://gerrit.libreoffice.org/47692
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx
index fa0e0ae2cb80..a49ea4df7015 100644
--- a/io/source/stm/omark.cxx
+++ b/io/source/stm/omark.cxx
@@ -527,8 +527,8 @@ sal_Int32 OMarkableInputStream::readSomeBytes(Sequence< 
sal_Int8 >& aData, sal_I
 // read from buffer
 sal_Int32 nRead = 0;
 sal_Int32 nInBuffer = m_pBuffer->getSize() - m_nCurrentPos;
-sal_Int32 nAdditionalBytesToRead = 
Min(nMaxBytesToRead-nInBuffer,m_input->available());
-nAdditionalBytesToRead = Max(0 , nAdditionalBytesToRead );
+sal_Int32 nAdditionalBytesToRead = 
std::min(nMaxBytesToRead-nInBuffer,m_input->available());
+nAdditionalBytesToRead = std::max(0 , 
nAdditionalBytesToRead );
 
 // read enough bytes into buffer
 if( 0 == nInBuffer ) {
@@ -543,7 +543,7 @@ sal_Int32 OMarkableInputStream::readSomeBytes(Sequence< 
sal_Int8 >& aData, sal_I
 m_pBuffer->writeAt( m_pBuffer->getSize() , aData );
 }
 
-nBytesRead = Min( nMaxBytesToRead , nInBuffer + nRead );
+nBytesRead = std::min( nMaxBytesToRead , nInBuffer + nRead );
 
 // now take everything from buffer !
 m_pBuffer->readAt( m_nCurrentPos , aData , nBytesRead );
diff --git a/io/source/stm/opipe.cxx b/io/source/stm/opipe.cxx
index afdc92feef54..1065629f91f9 100644
--- a/io/source/stm/opipe.cxx
+++ b/io/source/stm/opipe.cxx
@@ -159,7 +159,7 @@ sal_Int32 OPipeImpl::readSomeBytes(Sequence< sal_Int8 >& 
aData, sal_Int32 nMaxBy
 }
 if( m_pFIFO->getSize() )
 {
-sal_Int32 nSize = Min( nMaxBytesToRead , m_pFIFO->getSize() );
+sal_Int32 nSize = std::min( nMaxBytesToRead , 
m_pFIFO->getSize() );
 aData.realloc( nSize );
 m_pFIFO->read( aData , nSize );
 return nSize;
@@ -197,7 +197,7 @@ void OPipeImpl::skipBytes(sal_Int32 nBytesToSkip)
 }
 m_nBytesToSkip += nBytesToSkip;
 
-nBytesToSkip = Min( m_pFIFO->getSize() , m_nBytesToSkip );
+nBytesToSkip = std::min( m_pFIFO->getSize() , m_nBytesToSkip );
 m_pFIFO->skip( nBytesToSkip );
 m_nBytesToSkip -= nBytesToSkip;
 }
diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx
index efe53dcc42ab..ffd1726c6754 100644
--- a/io/source/stm/streamhelper.cxx
+++ b/io/source/stm/streamhelper.cxx
@@ -148,7 +148,7 @@ void MemRingBuffer::writeAt( sal_Int32 nPos, const 
Sequence &seq )
 // one area copy
 memcpy( &( m_p[nStartWritingIndex]), seq.getConstArray() , nLen );
 }
-m_nOccupiedBuffer = Max( nPos + seq.getLength() , m_nOccupiedBuffer );
+m_nOccupiedBuffer = std::max( nPos + seq.getLength() , m_nOccupiedBuffer );
 checkInvariants();
 }
 
diff --git a/io/source/stm/streamhelper.hxx b/io/source/stm/streamhelper.hxx
index c03673d6f4df..94d7c60a75bc 100644
--- a/io/source/stm/streamhelper.hxx
+++ b/io/source/stm/streamhelper.hxx
@@ -24,9 +24,6 @@
 
 #include 
 
-#define Max( a, b ) (((a)>(b)) ? (a) : (b) )
-#define Min( a, b ) (((a)<(b)) ? (a) : (b) )
-
 namespace io_stm
 {
 
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx 
b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 4bdaa74d0a2a..4da78de3995b 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -60,9 +60,6 @@ using namespace com::sun::star::uno;
 using namespace com::sun::star::linguistic2;
 using namespace linguistic;
 
-// min, max
-#define Max(a,b) (a > b ? a : b)
-
 Hyphenator::Hyphenator() :
 aEvtListeners   ( GetLinguMutex() )
 {
@@ -364,8 +361,8 @@ Reference< XHyphenatedWord > SAL_CALL 
Hyphenator::hyphenate( const OUString& aWo
 {
 const bool bFailed = 0 != hnj_hyphen_hyphenate3( dict, 
lcword.get(), n, hyphens.get(), nullptr,
 &rep, &pos, &cut, minLead, minTrail,
-Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead  - 
Max(dict->lhmin, 2))),
-Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - 
Max(dict->rhmin, 2))) );
+std::max(dict->clhmin, 
std::max(dict->

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

2018-01-15 Thread Caolán McNamara
 lotuswordpro/source/filter/lwpfnlayout.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e9f521d409845a0824752a39d7574f4fad7989d4
Author: Caolán McNamara 
Date:   Mon Jan 15 09:22:30 2018 +

ofz#5313 Timeout

Change-Id: I80d0a013f5e88493ef539ee5a8435b9ad2217678

diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx 
b/lotuswordpro/source/filter/lwpfnlayout.cxx
index 7183d5fde286..c2ac01055119 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -252,14 +252,15 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer 
* /*pCont*/)
  * @short   Get child endnote layout
  * @return pointer to endnote layout
  */
- LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
+LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
 {
 LwpObjectID& rID = GetChildTail();
 
+LwpVirtualLayout *pPrevLayout = nullptr;
 while(!rID.IsNull())
 {
-LwpVirtualLayout * pLayout = 
dynamic_cast(rID.obj().get());
-if(!pLayout)
+LwpVirtualLayout* pLayout = 
dynamic_cast(rID.obj().get());
+if (!pLayout || pLayout == pPrevLayout)
 {
 break;
 }
@@ -268,6 +269,7 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * 
/*pCont*/)
 return pLayout;
 }
 rID = pLayout->GetPrevious();
+pPrevLayout = pLayout;
 }
 
 return nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Caolán McNamara
 lotuswordpro/source/filter/lwpfribsection.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit d1a8f99048ac4c7a84be38eb1d71aa90572e395a
Author: Caolán McNamara 
Date:   Mon Jan 15 09:08:33 2018 +

ofz#5305 Direct-leak

Change-Id: Id2c66d30a24ad719c579d3211cf41050d87e

diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx 
b/lotuswordpro/source/filter/lwpfribsection.cxx
index 7c64bb2e0068..5d0211adf7ff 100644
--- a/lotuswordpro/source/filter/lwpfribsection.cxx
+++ b/lotuswordpro/source/filter/lwpfribsection.cxx
@@ -259,9 +259,9 @@ void LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
 m_bNewSection = false;
 //sal_Bool bSectionColumns = sal_False;
 
-XFParaStyle* pOverStyle = new XFParaStyle;
-*pOverStyle = *(m_pPara->GetXFParaStyle());
-pOverStyle->SetStyleName("");
+std::unique_ptr xOverStyle(new XFParaStyle);
+*xOverStyle = *(m_pPara->GetXFParaStyle());
+xOverStyle->SetStyleName("");
 
 LwpLayout::UseWhenType eUserType = m_pLayout->GetUseWhenType();
 switch(eUserType)
@@ -289,7 +289,7 @@ void LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
 m_pLayout = pStory->GetCurrentLayout();
 m_bNewSection = IsNeedSection();
 //bSectionColumns = m_bNewSection;
-pOverStyle->SetMasterPage( m_pLayout->GetStyleName());
+xOverStyle->SetMasterPage(m_pLayout->GetStyleName());
 RegisterFillerPageStyle();
 }
 break;
@@ -304,10 +304,10 @@ void LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
 return;
 
 pStory->SetTabLayout(m_pLayout);
-m_pPara->RegisterTabStyle(pOverStyle);
+m_pPara->RegisterTabStyle(xOverStyle.get());
 
 XFStyleManager* pXFStyleManager = 
LwpGlobalMgr::GetInstance()->GetXFStyleManager();
-m_StyleName = 
pXFStyleManager->AddStyle(pOverStyle).m_pStyle->GetStyleName();
+m_StyleName = 
pXFStyleManager->AddStyle(xOverStyle.release()).m_pStyle->GetStyleName();
 //register section style here
 if(m_bNewSection)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - comphelper/source xmloff/source

2018-01-15 Thread Samuel Mehrbrodt
 comphelper/source/misc/graphicmimetype.cxx |8 ++---
 xmloff/source/core/xmlmultiimagehelper.cxx |   41 +
 2 files changed, 35 insertions(+), 14 deletions(-)

New commits:
commit cbd6cd2fd24d72557957ad04eec75dc242d15e04
Author: Samuel Mehrbrodt 
Date:   Fri Jan 12 17:32:41 2018 +0100

tdf#114488 Rank multiple images also for flat odf

Only the file extension was considered before
which is not available in flat odf.

Now both internal and external URLs are resolved to their respective 
mimetype.

(cherry picked from commit 8a16c2a9a03c9fdf997a71caf9d8c675da4a46f2)

Change-Id: Id7e290cd9a441a1a6c2ce5e8d764391c50495bea

diff --git a/comphelper/source/misc/graphicmimetype.cxx 
b/comphelper/source/misc/graphicmimetype.cxx
index bf88312304b1..559c3087a2da 100644
--- a/comphelper/source/misc/graphicmimetype.cxx
+++ b/comphelper/source/misc/graphicmimetype.cxx
@@ -19,12 +19,12 @@
 
 #include 
 
-#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -48,8 +48,8 @@ OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(const 
OString& rExt)
 static const XMLGraphicMimeTypeMapper aMapper[]
 = { { "gif", "image/gif" },   { "png", "image/png" }, { "jpg", 
"image/jpeg" },
 { "tif", "image/tiff" },  { "svg", "image/svg+xml" }, { "pdf", 
"application/pdf" },
-{ "wmf", "image/x-wmf" }, { "eps", "image/x-eps" },   { "bmp", 
"image/bmp" },
-{ "pct", "image/x-pict" } };
+{ "wmf", "image/x-wmf" }, { "emf", "image/x-emf" },   { "eps", 
"image/x-eps" },
+{ "bmp", "image/bmp" },   { "pct", "image/x-pict" },  { "svm", 
"image/x-svm" } };
 
 OUString aMimeType;
 
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx 
b/xmloff/source/core/xmlmultiimagehelper.cxx
index 9c70c0759ba8..a525831e88a9 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -20,51 +20,72 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::com::sun::star;
 
 namespace
 {
 sal_uInt32 getQualityIndex(const OUString& rString)
 {
-sal_uInt32 nRetval(0);
+OUString sMimeType;
+if (rString.startsWith("vnd.sun.star.GraphicObject"))
+{
+sMimeType = 
comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageUrl(rString);
+}
+else if (rString.startsWith("vnd.sun.star.Package"))
+{
+sMimeType
+= 
comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension(OUStringToOString(
+rString.copy(rString.lastIndexOf(".") + 1), 
RTL_TEXTENCODING_ASCII_US));
+}
+else
+{
+SAL_WARN("xmloff", "Unknown image source: " << rString);
+return 0;
+}
 
 // pixel formats first
-if(rString.endsWith(".bmp"))
+if(sMimeType == "image/bmp")
 {
 return 10;
 }
-if(rString.endsWith(".gif"))
+if(sMimeType == "image/gif")
 {
 return 20;
 }
-if(rString.endsWith(".jpg"))
+if(sMimeType == "image/jpeg")
 {
 return 30;
 }
-if(rString.endsWith(".png"))
+if(sMimeType == "image/png")
 {
 return 40;
 }
 
 // vector formats, prefer always
-if(rString.endsWith(".svm"))
+if(sMimeType == "image/x-svm")
 {
 return 1000;
 }
-if(rString.endsWith(".wmf"))
+if(sMimeType == "image/x-wmf")
 {
 return 1010;
 }
-if(rString.endsWith(".emf"))
+if(sMimeType == "image/x-emf")
 {
 return 1020;
 }
-if(rString.endsWith(".svg"))
+if(sMimeType == "application/pdf")
 {
 return 1030;
 }
+if(sMimeType == "image/svg+xml")
+{
+return 1040;
+}
 
-return nRetval;
+return 0;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-15 Thread Caolán McNamara
 sw/source/filter/ww8/ww8scan.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit a3073d346be17da7b35e2511871511af710add24
Author: Caolán McNamara 
Date:   Sun Jan 14 21:25:59 2018 +

ofz#5299 Timeout

Change-Id: I9c7968d44fc608431615b6fe0b1013e8a677bf60
Reviewed-on: https://gerrit.libreoffice.org/47871
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 0ab07dfcadce..526ea5c1eea5 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -3415,6 +3415,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 pPieceIter->SetIdx(nOldPos);
 return;
 }
@@ -3425,6 +3426,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 pPieceIter->SetIdx(nOldPos);
 return;
 }
@@ -3434,6 +3436,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 pPieceIter->SetIdx(nOldPos);
 return;
 }
@@ -3444,6 +3447,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 pPieceIter->SetIdx(nOldPos);
 return;
 }
@@ -3454,6 +3458,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 pPieceIter->SetIdx(nOldPos);
 return;
 }
@@ -3506,6 +3511,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 continue;
 }
 
@@ -3515,6 +3521,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, 
ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 continue;
 }
 }
@@ -3523,6 +3530,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 continue;
 }
 
@@ -3541,6 +3549,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, 
ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 continue;
 }
 if (bIsUnicode)
@@ -3551,6 +3560,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
 if (bFail)
 {
 SAL_WARN("sw.ww8", "broken offset, 
ignoring");
+p->nStartPos = p->nEndPos = WW8_FC_MAX;
 continue;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang

2018-01-15 Thread Stephan Bergmann
 compilerplugins/clang/cstylecast.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit a409d32e7f6fc09e041079d6dbc3c927497adfed
Author: Stephan Bergmann 
Date:   Mon Jan 15 09:10:25 2018 +0100

More loplugin:cstylecast

...also warn about the remaining cases of C-style casts (other than 
idiomatic
cast to void)

Change-Id: I274be61ad038fc41ac470fc07ea703a0f071f456

diff --git a/compilerplugins/clang/cstylecast.cxx 
b/compilerplugins/clang/cstylecast.cxx
index f09ce81a2987..ba89c1aa02b5 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -232,16 +232,15 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr 
* expr) {
 if( expr->getCastKind() == CK_ToVoid ) {
 return true;
 }
-// ignore integral-type conversions for now, there is insufficient 
agreement about
-// the merits of C++ style casting in this case
-if( expr->getCastKind() == CK_IntegralCast ) {
-return true;
-}
 if (isSharedCAndCppCode(expr->getLocStart())) {
 return true;
 }
 char const * perf = nullptr;
-if( expr->getCastKind() == CK_NoOp ) {
+if( expr->getCastKind() == CK_IntegralCast ) {
+if (rewriteArithmeticCast(expr, &perf)) {
+return true;
+}
+} else if( expr->getCastKind() == CK_NoOp ) {
 if (!((expr->getSubExpr()->getType()->isPointerType()
&& expr->getType()->isPointerType())
   || expr->getTypeAsWritten()->isReferenceType()))
@@ -530,6 +529,9 @@ bool CStyleCast::rewriteArithmeticCast(CStyleCastExpr const 
* expr, char const *
 while (compiler.getSourceManager().isMacroBodyExpansion(third)
&& 
compiler.getSourceManager().isAtStartOfImmediateMacroExpansion(third, &third))
 {}
+} else if (compiler.getSourceManager().isMacroBodyExpansion(fourth)) {
+while (compiler.getSourceManager().isMacroArgExpansion(third)
+   && 
compiler.getSourceManager().isAtStartOfImmediateMacroExpansion(third, &third)) 
{}
 }
 if (!third.isMacroID()) {
 while (compiler.getSourceManager().isMacroBodyExpansion(fourth)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits