[Libreoffice-commits] core.git: basegfx/source compilerplugins/clang filter/source include/basegfx include/svl include/ucbhelper include/unotools include/vcl sax/source svl/source ucbhelper/source uno

2017-12-23 Thread Noel Grandin
 basegfx/source/polygon/b2dpolygon.cxx   |6 +++---
 basegfx/source/polygon/b2dpolypolygon.cxx   |2 +-
 basegfx/source/tools/b2dclipstate.cxx   |2 +-
 compilerplugins/clang/passstuffbyref.cxx|   11 ++-
 compilerplugins/clang/test/passstuffbyref.cxx   |5 +
 filter/source/svg/svgreader.cxx |2 +-
 include/basegfx/polygon/b2dpolygon.hxx  |6 +++---
 include/basegfx/polygon/b2dpolypolygon.hxx  |2 +-
 include/basegfx/utils/b2dclipstate.hxx  |2 +-
 include/svl/itemprop.hxx|2 +-
 include/ucbhelper/simplenameclashresolverequest.hxx |2 +-
 include/unotools/localedatawrapper.hxx  |4 ++--
 include/vcl/ImageTree.hxx   |2 +-
 include/vcl/button.hxx  |2 +-
 include/vcl/jobset.hxx  |2 +-
 include/vcl/msgbox.hxx  |6 +++---
 include/vcl/pdfwriter.hxx   |2 +-
 include/vcl/settings.hxx|6 +++---
 include/vcl/syswin.hxx  |2 +-
 include/vcl/textview.hxx|2 +-
 sax/source/fastparser/fastparser.cxx|8 
 svl/source/items/itemprop.cxx   |2 +-
 ucbhelper/source/provider/simplenameclashresolverequest.cxx |2 +-
 unotools/source/i18n/localedatawrapper.cxx  |4 ++--
 vcl/source/app/settings.cxx |6 +++---
 vcl/source/control/button.cxx   |2 +-
 vcl/source/edit/textview.cxx|2 +-
 vcl/source/gdi/jobset.cxx   |2 +-
 vcl/source/gdi/pdfwriter.cxx|2 +-
 vcl/source/image/ImageTree.cxx  |2 +-
 vcl/source/window/menubarwindow.cxx |2 +-
 vcl/source/window/menubarwindow.hxx |2 +-
 vcl/source/window/msgbox.cxx|6 +++---
 vcl/source/window/syswin.cxx|2 +-
 34 files changed, 64 insertions(+), 50 deletions(-)

New commits:
commit 6028b64e27dc45f20aa4a4e0adbef1c03e91a79b
Author: Noel Grandin 
Date:   Sat Dec 23 18:35:30 2017 +0200

loplugin:passstuffbyref even more return improvements

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

diff --git a/basegfx/source/polygon/b2dpolygon.cxx 
b/basegfx/source/polygon/b2dpolygon.cxx
index 17df4c4b3738..601f493c27b4 100644
--- a/basegfx/source/polygon/b2dpolygon.cxx
+++ b/basegfx/source/polygon/b2dpolygon.cxx
@@ -1175,7 +1175,7 @@ namespace basegfx
 return mpPolygon->count();
 }
 
-B2DPoint B2DPolygon::getB2DPoint(sal_uInt32 nIndex) const
+B2DPoint const & B2DPolygon::getB2DPoint(sal_uInt32 nIndex) const
 {
 OSL_ENSURE(nIndex < mpPolygon->count(), "B2DPolygon access outside 
range (!)");
 
@@ -1399,12 +1399,12 @@ namespace basegfx
 }
 }
 
-B2DPolygon B2DPolygon::getDefaultAdaptiveSubdivision() const
+B2DPolygon const & B2DPolygon::getDefaultAdaptiveSubdivision() const
 {
 return mpPolygon->getDefaultAdaptiveSubdivision(*this);
 }
 
-B2DRange B2DPolygon::getB2DRange() const
+B2DRange const & B2DPolygon::getB2DRange() const
 {
 return mpPolygon->getB2DRange(*this);
 }
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx 
b/basegfx/source/polygon/b2dpolypolygon.cxx
index 977adde32d7f..b0a51d46a3a7 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -230,7 +230,7 @@ namespace basegfx
 return mpPolyPolygon->count();
 }
 
-B2DPolygon B2DPolyPolygon::getB2DPolygon(sal_uInt32 nIndex) const
+B2DPolygon const & B2DPolyPolygon::getB2DPolygon(sal_uInt32 nIndex) const
 {
 OSL_ENSURE(nIndex < mpPolyPolygon->count(), "B2DPolyPolygon access 
outside range (!)");
 
diff --git a/basegfx/source/tools/b2dclipstate.cxx 
b/basegfx/source/tools/b2dclipstate.cxx
index cf848f1af1c2..cff66f93faf9 100644
--- a/basegfx/source/tools/b2dclipstate.cxx
+++ b/basegfx/source/tools/b2dclipstate.cxx
@@ -482,7 +482,7 @@ namespace utils
 mpImpl->xorPolyPolygon(rPolyPoly);
 }
 
-B2DPolyPolygon B2DClipState::getClipPoly() const
+B2DPolyPolygon const & B2DClipState::getClipPoly() const
 {
 return mpImpl->getClipPoly();
 }
diff --git a/compilerplugins/clang/passstuffbyref.cxx 
b/compilerplugins/clang/passstuffbyre

[Libreoffice-commits] core.git: .gitignore

2017-12-23 Thread Ashod Nakashian
 .gitignore |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 92bab0f11e0a93005bfd13db3a0552ecaf082ecb
Author: Ashod Nakashian 
Date:   Sun Dec 17 13:22:18 2017 -0500

.gitignore vscode ide files

Change-Id: I0857885e459430e7b64f2a697943cb97d2e57cbf
Reviewed-on: https://gerrit.libreoffice.org/46674
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit c6f01eb87f5e4c1c13b78fed26c70a91aa5bcbe2)
Reviewed-on: https://gerrit.libreoffice.org/46676
(cherry picked from commit b3589dd6b4b4ed78b934187f21c96cbca51382f1)
Reviewed-on: https://gerrit.libreoffice.org/46989
Tested-by: Jenkins 

diff --git a/.gitignore b/.gitignore
index a42f3877a83a..ab3a638307b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,6 +93,8 @@ eclipsesettingfile.xml
 .cxx_tags
 .yavide_proj
 .yavide_session
+.vscode
+*.code-workspace
 
 # things below this point are targeted for elimination
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


CppCheck Report Update

2017-12-23 Thread cppcheck.libreoff...@gmail.com

A new cppcheck report is available at : 
http://dev-builds.libreoffice.org/cppcheck_reports/master/


Note:
The script generating this report was run at :
2017-24-12_02:21:19 with user buildslave at host vm140 as 
/home/buildslave/source/dev-tools/cppcheck/cppcheck-report.sh -s 
/home/buildslave/source/libo-core -c /home/buildslave/source/cppcheck -w 
/home/buildslave/tmp/www

It can be found and improved here:

https://gerrit.libreoffice.org/gitweb?p=dev-tools.git;a=blob;f=cppcheck/cppcheck-report.sh


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


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

2017-12-23 Thread Stephan Bergmann
 compilerplugins/clang/passstuffbyref.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c926a1e34672afaa5b7de0e3b08b1537e88fbb6f
Author: Stephan Bergmann 
Date:   Sat Dec 23 22:43:45 2017 +0100

Fix compilerplugins/clang/test/passstuffbyref.cxx

...after 2a1fb4401da16f6a18c0bd05fe4b460a3048f9b5 "loplugin:passstuffbyref
improved returns", where compiling as C++17 causes a false positive for
S2::set1, whose return statement consists of

> `-ReturnStmt 0x9ef8d78 
>   `-ExprWithCleanups 0x9ef8d60  'class rtl::OUString'
> `-CXXFunctionalCastExpr 0x9ef8d38  'class 
rtl::OUString' functional cast to class rtl::OUString 
>   `-CXXBindTemporaryExpr 0x9ef8d18  'class 
rtl::OUString' (CXXTemporary 0x9ef8d10)
> `-CXXConstructExpr 0x9ef8cd0  'class 
rtl::OUString' 'void (char const &[4], typename 
libreoffice_internal::ConstCharArrayDetector::Type)'
>   |-StringLiteral 0x9ef7160  'const char [4]' lvalue "xxx"
>   `-CXXDefaultArgExpr 0x9ef8cb0 <> 
'libreoffice_internal::Dummy':'struct rtl::libreoffice_internal::Dummy'

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

diff --git a/compilerplugins/clang/passstuffbyref.cxx 
b/compilerplugins/clang/passstuffbyref.cxx
index 5901a587594e..98b75abac960 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -332,6 +332,9 @@ bool PassStuffByRef::isReturnExprDisqualified(const Expr* 
expr)
 else
 return true;
 }
+if (isa(expr)) {
+return true;
+}
 if (isa(expr)) {
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread Maxim Monastirsky
 sw/source/uibase/docvw/edtwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit baccbd4508a375090f4d95a2dab02c8b5d404ee2
Author: Maxim Monastirsky 
Date:   Sat Dec 23 22:13:55 2017 +0200

tdf#114670 Make sure to dispose the menu

Change-Id: I30612a0b3cfef7d19ff6a5180db76a8002186bd5
Reviewed-on: https://gerrit.libreoffice.org/47025
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index f5b582994ec7..edb94d575e5d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5287,7 +5287,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
 aEvent.SourceWindow = VCLUnoHelper::GetInterface( this 
);
 aEvent.ExecutePosition.X = aPixPos.X();
 aEvent.ExecutePosition.Y = aPixPos.Y();
-VclPtr pMenu;
+ScopedVclPtr pMenu;
 if 
(GetView().TryContextMenuInterception(aROPopup.GetMenu(), 
"private:resource/ReadonlyContextMenu", pMenu, aEvent))
 {
 if ( pMenu )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Repository.mk

2017-12-23 Thread Stephan Bergmann
 Repository.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7c19c0e2b4862aef7373ec02570fa38b0026039a
Author: Stephan Bergmann 
Date:   Sat Dec 23 22:38:18 2017 +0100

Blind fix

...after a692cdf779dc998f58ebf9e9f84f22edf7dbe421 "LOK: tilebench 
improvements"

Change-Id: Ic19c97ab381dc339270b8d7072458b57755b5e0d

diff --git a/Repository.mk b/Repository.mk
index 78ef396fa860..dcb201a904b9 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -817,7 +817,7 @@ $(eval $(call gb_Helper_register_packages_for_install,calc,\
 ))
 
 $(eval $(call gb_Helper_register_packages_for_install,libreofficekit,\
-   $(if $(filter LINUX %BSD SOLARIS, $(OS)),$(if 
$(ENABLE_GTK3),libreofficekit_selectionhandles)) \
+   $(if $(filter LINUX %BSD SOLARIS, 
$(OS)),libreofficekit_selectionhandles) \
 ))
 
 $(eval $(call gb_Helper_register_packages_for_install,ure,\
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread andreas kainz
 sw/uiconfig/swriter/ui/notebookbar_compact.ui |10814 +++---
 1 file changed, 6374 insertions(+), 4440 deletions(-)

New commits:
commit 4fe769a448c654cb4430b1126aa9359aa878fa81
Author: andreas kainz 
Date:   Wed Dec 20 15:05:20 2017 +0100

NB Writer: tabbed toolbar get updated

Change-Id: I71469d410e27ebe719e861cb0964ed6e4ba21805
Reviewed-on: https://gerrit.libreoffice.org/46852
Tested-by: Jenkins 
Reviewed-by: andreas_kainz 

diff --git a/sw/uiconfig/swriter/ui/notebookbar_compact.ui 
b/sw/uiconfig/swriter/ui/notebookbar_compact.ui
index 37d02339981a..8662843687a9 100644
--- a/sw/uiconfig/swriter/ui/notebookbar_compact.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar_compact.ui
@@ -245,1852 +245,1849 @@
   
 
   
-  
+  
 True
 False
 
-  
+  
 True
 False
-.uno:Undo
+.uno:AutoPilotMenu
   
 
 
-  
+  
 True
 False
-.uno:Redo
   
 
 
-  
+  
 True
 False
-.uno:Repeat
+.uno:Reload
   
 
 
-  
+  
 True
 False
+.uno:VersionDialog
   
 
 
-  
+  
 True
 False
-.uno:Cut
   
 
 
-  
+  
 True
 False
-.uno:Copy
+.uno:CheckOut
   
 
 
-  
+  
 True
 False
-.uno:Paste
+.uno:CancelCheckOut
   
 
 
-  
+  
 True
 False
-.uno:PasteSpecial
+.uno:CheckIn
   
 
 
-  
+  
 True
 False
-.uno:PasteUnformatted
   
 
 
-  
+  
 True
 False
+.uno:ExportTo
   
 
 
-  
+  
 True
 False
-.uno:SelectAll
+.uno:ExportToPDF
   
 
 
-  
+  
 True
 False
-.uno:SelectionModeDefault
+.uno:ExportToEPUB
   
 
 
-  
+  
 True
 False
-.uno:SelectionModeBlock
   
 
 
-  
+  
 True
 False
-.uno:SelectTextMode
+.uno:SendMail
   
 
 
-  
+  
 True
 False
-.uno:ShadowCursor
+.uno:SendViaBluetooth
   
 
 
-  
+  
 True
 False
+.uno:NewGlobalDoc
   
 
 
-  
+  
 True
 False
-vnd.sun.star.findbar:FocusToFindbar
   
 
 
-  
+  
 True
 False
-.uno:SearchDialog
+.uno:WebHtml
   
 
 
-  
+  
 True
 False
-.uno:GotoPage
+.uno:PrinterSetup
   
 
 
-  
+  
 True
 False
   
 
 
-  
+  
 True
 False
-.uno:TrackChanges
+.uno:Signature
   
 
 
-  
+  
 True
 False
-.uno:ShowTrackedChanges
+.uno:SignPDF
   
 
+  
+  
+True
+False
 
-  
+  
 True
 False
-.uno:AcceptTrackedChanges
+.uno:Grow
   
 
 
-  
+  
 True
 False
+.uno:Shrink
   
 
 
-  
+  
 True
 False
-.uno:ProtectTraceChangeMode
   
 
 
-  
+  
 True
 False
-.uno:CompareDocuments
+.uno:Bold
   
 
 
-  
+  
 True
 False
-.uno:MergeDocuments
+.uno:Italic
   
 
 
-  
+  
 True
 False
+.uno:Underline
   
 
 
-  
+  
 True
 False
-.uno:EditHyperlink
   
 
 
-  
+  
 True
 False
-.uno:EditFootnote
+.uno:Shadowed
   
 
 
-  
+  
 True
 False
-.uno:IndexEntryDialog
+.uno:OutlineFont
   
 
 
-  
+  
 True
 False
-.uno:AuthoritiesEntryDialog
+.uno:Strikeout
   
 
 
-  
+  
 True
 False
-.uno:FieldDialog
+.uno:Overline
   
 
 
-  
+  
 True
 False
-.uno:LinkDialog
   
 
 
-  
+  
 True
 False
-.uno:ImageMapDialog
+.uno:SuperScript
   
 
 
-  
+  
 True
 False
-.uno:ObjectMenue
+.uno:SubScript
   
 
 
-  
+  
 True
 False
-.uno:ChangeDatabaseField
   
 
 
-  
+  
 True
 False
+.uno:ChangeCaseToUpper
   
 
 
-  
+  
 True
 False
-.uno:SwitchControlDesignMode
+.uno:ChangeCaseToLower
   
 
 
-

[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sd/uiconfig

2017-12-23 Thread Yousuf Philips
 sd/uiconfig/simpress/popupmenu/pagepane.xml |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4ca94f24995c8d7b854e2d98fd7ff8fa7b9e2157
Author: Yousuf Philips 
Date:   Thu Dec 21 15:44:24 2017 +0400

Correct impress slide pane popup Navigate label

Change-Id: Idd582e4559cd6bd1005de0d8158e57d40ddd3c98
Reviewed-on: https://gerrit.libreoffice.org/46903
Tested-by: Jenkins 
Reviewed-by: Yousuf Philips 
(cherry picked from commit 86fc5440dd2b4634635202c09d1e6240909d68f7)
Reviewed-on: https://gerrit.libreoffice.org/46917
Reviewed-by: Maxim Monastirsky 

diff --git a/sd/uiconfig/simpress/popupmenu/pagepane.xml 
b/sd/uiconfig/simpress/popupmenu/pagepane.xml
index 98ac0c7dfbea..f790b402 100644
--- a/sd/uiconfig/simpress/popupmenu/pagepane.xml
+++ b/sd/uiconfig/simpress/popupmenu/pagepane.xml
@@ -44,7 +44,7 @@
   
   
   
-  
+  
 
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/cairo

2017-12-23 Thread Ashod Nakashian
 external/cairo/pixman/pixman-0.24.4.patch |   72 +-
 1 file changed, 71 insertions(+), 1 deletion(-)

New commits:
commit c8176326324aef63ddc29eafd1193f2abba80c92
Author: Ashod Nakashian 
Date:   Sat Nov 25 13:44:21 2017 -0500

pixman: drop cached glyphs above size watermark

The glyphs cache only tracked the number of glyphs
in the cache, which isn't very useful when the
glyphs vary in size from a few bytes to dozens of
megabytes. In terms of memory footprint, we are
interested not just in the number of cached glyphs,
but also in the total memory usage.

We now track the pixel-size of each glyph and drop
as many as necessary to fall below the set threshold
which is currently 4 MBs.

There was no performance loss observed after this patch
on a diverse set of documents of all types (if anything,
a very modest performance win was hinted in some cases),
with significant memory reduction in some cases where
dozens of megabytes were previously left stale in the cache.

Change-Id: I377a4c1e59611fca6bf253dd9fa90f75b5295d4b
Reviewed-on: https://gerrit.libreoffice.org/45378
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 407660a08c8df27d7cd44435eefa31bd92364a3c)
(cherry picked from commit ded39dc17a34127a872b11abddc325aae047)
Reviewed-on: https://gerrit.libreoffice.org/46987
Tested-by: Jenkins 

diff --git a/external/cairo/pixman/pixman-0.24.4.patch 
b/external/cairo/pixman/pixman-0.24.4.patch
index 520f2ba572d4..6d871e37bfd1 100644
--- a/external/cairo/pixman/pixman-0.24.4.patch
+++ b/external/cairo/pixman/pixman-0.24.4.patch
@@ -18,4 +18,74 @@
 +#include 
  
  #include "pixman-private.h"
- 
+
+--- misc/pixman-0.24.4/pixman/pixman-glyph.c   2015-06-30 05:48:31.0 
-0400
 misc/build/pixman-0.24.4/pixman/pixman-glyph.c 2017-11-25 
13:26:33.075558418 -0500
+@@ -38,6 +38,7 @@
+
+ /* XXX: These numbers are arbitrary---we've never done any measurements.
+  */
++#define N_PIXELS_HIGH_WATER  (4 * 1024 * 1024)
+ #define N_GLYPHS_HIGH_WATER  (16384)
+ #define N_GLYPHS_LOW_WATER   (8192)
+ #define HASH_SIZE (2 * N_GLYPHS_HIGH_WATER)
+@@ -58,6 +59,7 @@
+ int   n_glyphs;
+ int   n_tombstones;
+ int   freeze_count;
++longn_pixels;
+ pixman_list_t mru;
+ glyph_t * glyphs[HASH_SIZE];
+ };
+@@ -133,6 +135,7 @@
+ if (*loc == TOMBSTONE)
+   cache->n_tombstones--;
+ cache->n_glyphs++;
++cache->n_pixels += glyph->image->bits.width * glyph->image->bits.height;
+
+ *loc = glyph;
+ }
+@@ -150,6 +153,7 @@
+ cache->glyphs[idx & HASH_MASK] = TOMBSTONE;
+ cache->n_tombstones++;
+ cache->n_glyphs--;
++cache->n_pixels -= glyph->image->bits.width * glyph->image->bits.height;
+
+ /* Eliminate tombstones if possible */
+ if (cache->glyphs[(idx + 1) & HASH_MASK] == NULL)
+@@ -180,6 +184,7 @@
+
+ cache->n_glyphs = 0;
+ cache->n_tombstones = 0;
++cache->n_pixels = 0;
+ }
+
+ PIXMAN_EXPORT pixman_glyph_cache_t *
+@@ -194,6 +199,7 @@
+ cache->n_glyphs = 0;
+ cache->n_tombstones = 0;
+ cache->freeze_count = 0;
++cache->n_pixels = 0;
+
+ pixman_list_init (&cache->mru);
+
+@@ -220,9 +226,9 @@
+ pixman_glyph_cache_thaw (pixman_glyph_cache_t  *cache)
+ {
+ if (--cache->freeze_count == 0&&
+-  cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER)
++  (cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER || 
cache->n_pixels > N_PIXELS_HIGH_WATER))
+ {
+-  if (cache->n_tombstones > N_GLYPHS_HIGH_WATER)
++  if (cache->n_tombstones > N_GLYPHS_LOW_WATER)
+   {
+   /* More than half the entries are
+* tombstones. Just dump the whole table.
+@@ -230,7 +236,7 @@
+   clear_table (cache);
+   }
+
+-  while (cache->n_glyphs > N_GLYPHS_LOW_WATER)
++  while (cache->n_glyphs > N_GLYPHS_LOW_WATER || cache->n_pixels > 
N_PIXELS_HIGH_WATER)
+   {
+   glyph_t *glyph = CONTAINER_OF (glyph_t, mru_link, cache->mru.tail);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread Ashod Nakashian
 desktop/source/lib/lokinteractionhandler.cxx |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 78a40705290ffb431cfeb4ef1ff3780d207fe6de
Author: Ashod Nakashian 
Date:   Thu Nov 30 00:56:43 2017 -0500

LOK: support password-protected PDF docs

Reviewed-on: https://gerrit.libreoffice.org/45547
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit dc773e81bd360316a96b1b61c552d263e1d87e89)
Reviewed-on: https://gerrit.libreoffice.org/45563
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 82fb0abc37320fb1157b21efbf31954190353d41)

Change-Id: I48d959dba2c38b72d1d6fc0fa9171b96dbed0e7c
Reviewed-on: https://gerrit.libreoffice.org/46986
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 96d35a235efc..8c77471eb4be 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -248,14 +248,22 @@ bool LOKInteractionHandler::handlePasswordRequest(const 
uno::Sequence>= passwordRequest)
 {
-bIsRequestPasswordToModify = passwordRequest.IsRequestPasswordToModify;
+bIsRequestPasswordToModify = false;
 sUrl = passwordRequest.Name.toUtf8();
 bPasswordRequestFound = true;
 }
 
+task::DocumentPasswordRequest2 passwordRequest2;
+if (rRequest >>= passwordRequest2)
+{
+bIsRequestPasswordToModify = 
passwordRequest2.IsRequestPasswordToModify;
+sUrl = passwordRequest2.Name.toUtf8();
+bPasswordRequestFound = true;
+}
+
 task::DocumentMSPasswordRequest2 passwordMSRequest;
 if (rRequest >>= passwordMSRequest)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: libreofficekit/qa

2017-12-23 Thread Ashod Nakashian
 libreofficekit/qa/tilebench/tilebench.cxx |   71 +-
 1 file changed, 60 insertions(+), 11 deletions(-)

New commits:
commit 62c36eb8c600fe328954c22d83b6f8dda57d5d15
Author: Ashod Nakashian 
Date:   Sun Dec 3 23:34:22 2017 -0500

LOK: support tile-dumping in tilebench

And other improvements.

(cherry picked from commit b7d893d8a1ecb24290c4470e12d71caba2b85216)
Reviewed-on: https://gerrit.libreoffice.org/46678
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 0e7ccbdd559df3a446e73c367b12824c6c143579)

Change-Id: I5a27d6d2df5f946a708dd3b0b4fef8159da86e5c
Reviewed-on: https://gerrit.libreoffice.org/46985
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/libreofficekit/qa/tilebench/tilebench.cxx 
b/libreofficekit/qa/tilebench/tilebench.cxx
index ed8d44c13789..61bc562ae9a7 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -13,6 +13,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -36,6 +37,48 @@ static double getTimeNow()
(double)aValue.Nanosec / (1000*1000*1000);
 }
 
+/// Dump an array of RGBA or BGRA to an RGB PPM file.
+static void dumpTile(const int nWidth, const int nHeight, const int mode, 
const char* pBuffer)
+{
+std::ofstream ofs("/tmp/dump_tile.ppm");
+ofs << "P6\n"
+<< nWidth << " "
+<< nHeight << "\n"
+<< 255 << "\n" ;
+
+for (int y = 0; y < nHeight; ++y)
+{
+const char* row = pBuffer + y * nWidth * 4;
+for (int x = 0; x < nWidth; ++x)
+{
+const char* pixel = row + x * 4;
+if (mode == LOK_TILEMODE_RGBA)
+{
+ofs.write(pixel, 3); // Skip alpha
+}
+else if (mode == LOK_TILEMODE_BGRA)
+{
+const int alpha = *(pixel + 3);
+char buf[3];
+if (alpha == 0)
+{
+buf[0] = 0;
+buf[1] = 0;
+buf[2] = 0;
+}
+else
+{
+buf[0] = (*(pixel + 2) * 255 + alpha / 2) / alpha;
+buf[1] = (*(pixel + 1) * 255 + alpha / 2) / alpha;
+buf[2] = (*(pixel + 0) * 255 + alpha / 2) / alpha;
+}
+
+ofs.write(buf, 3);
+}
+}
+}
+}
+
 int main( int argc, char* argv[] )
 {
 static const double origin = getTimeNow();
@@ -73,35 +116,42 @@ int main( int argc, char* argv[] )
 aTimes.emplace_back();
 
 const int max_parts = (argc > 3 ? atoi(argv[3]) : -1);
-const int max_tiles = (argc > 4 ? atoi(argv[4]) : -1);
+int max_tiles = (argc > 4 ? atoi(argv[4]) : -1);
+const bool dump = true;
 
 if (argv[2] != nullptr)
 {
 aTimes.emplace_back("load document");
 Document *pDocument(pOffice->documentLoad(argv[2]));
 aTimes.emplace_back();
+const int mode = pDocument->getTileMode();
 
 aTimes.emplace_back("getparts");
-const int nOriginalPart = pDocument->getPart();
+const int nOriginalPart = (pDocument->getDocumentType() == 
LOK_DOCTYPE_TEXT ? 1 : pDocument->getPart());
 // Writer really has 1 part (the full doc).
 const int nTotalParts = (pDocument->getDocumentType() == 
LOK_DOCTYPE_TEXT ? 1 : pDocument->getParts());
 const int nParts = (max_parts < 0 ? nTotalParts : std::min(max_parts, 
nTotalParts));
-fprintf(stderr, "Parts to render: %d, Total Parts: %d, Max parts: %d, 
Max tiles: %d\n", nParts, nTotalParts, max_parts, max_tiles);
 aTimes.emplace_back();
 
 aTimes.emplace_back("get size of parts");
+long nWidth = 0;
+long nHeight = 0;
 for (int n = 0; n < nParts; ++n)
 {
 const int nPart = (nOriginalPart + n) % nTotalParts;
 char* pName = pDocument->getPartName(nPart);
 pDocument->setPart(nPart);
-long nWidth = 0, nHeight = 0;
 pDocument->getDocumentSize(&nWidth, &nHeight);
 fprintf (stderr, "  '%s' -> %ld, %ld\n", pName, nWidth, nHeight);
 free (pName);
 }
 aTimes.emplace_back();
 
+// Estimate the maximum tiles based on the number of parts requested, 
if Writer.
+if (pDocument->getDocumentType() == LOK_DOCTYPE_TEXT)
+max_tiles = (int)ceil(max_parts * 16128. / nTilePixelHeight) * 
ceil((double)nWidth / nTilePixelWidth);
+fprintf(stderr, "Parts to render: %d, Total Parts: %d, Max parts: %d, 
Max tiles: %d\n", nParts, nTotalParts, max_parts, max_tiles);
+
 std::vector vBuffer(nTilePixelWidth * nTilePixelHeight 
* 4);
 unsigned char* pPixels = &vBuffer[0];
 
@@ -110,25 +160,25 @@ int main( int argc, char* argv[] )
 const int nPart = (nOriginalPart + n) % nTotalParts;
 char

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

2017-12-23 Thread Adolfo Jayme Barrientos
 sw/uiconfig/swriter/ui/optcompatpage.ui |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 39adeb1e34b268f32cc16041a9a6ea2543385d6d
Author: Adolfo Jayme Barrientos 
Date:   Sat Dec 23 12:30:19 2017 -0600

Use proper quotation marks in this translatable string

Change-Id: I1e082e7f19af2895cfb595f1734e69808594bd04

diff --git a/sw/uiconfig/swriter/ui/optcompatpage.ui 
b/sw/uiconfig/swriter/ui/optcompatpage.ui
index f297aeb6bc04..93478630ca3b 100644
--- a/sw/uiconfig/swriter/ui/optcompatpage.ui
+++ b/sw/uiconfig/swriter/ui/optcompatpage.ui
@@ -101,7 +101,7 @@
   
 True
 False
-Compatibility options for '%DOCNAME'
+Compatibility options for 
“%DOCNAME”
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Fwd: Re: offline help replacement

2017-12-23 Thread Olivier Hallot
Hi Tomaz !

Em 23/12/2017 12:47, Tomaž Vajngerl escreveu:
> Hi,
> 
> On Sat, Dec 23, 2017 at 7:13 PM, Olivier Hallot
>  wrote:
>> HI
>>
>> Newbie seeking advice!
>>
>> I am trying to implement Kendy's idea of a temp file with some HTML
>> inside, I seek a piece of code to open a temp file, write contents in
>> it, close it.
>>
>> I started with
>> ---
>> OUString aExtension(".html");
>> ::utl::TempFile aTempFile("newhelp", true, &aExtension, nullptr,
>> false );
>> aTempFile.EnableKillingFile();
>> --
>>
>> But then How do I write a simple OUString ("hello world") inside it?
> 
> continued from your example...
> 
> SvStream* pStream = aTempFile.GetStream(StreamMode::WRITE);
> pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
> pStream->WriteUnicodeOrByteText(OUString ("hello world"));
> pStream->Close();
> aTempFile.CloseStream();
> 
> As you can see this converts the OUString to UTF8 when you write it.
> BTW. I didn't try to compile this, so it may be wrong :)
> 
>> Thanks in advance.
>> Seasons Greetings!
>> Olivier
> 
> Best Regards,
> Tomaž
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
> 

Thank you Tomaz for the invaluable help. Patch submitted (and seeking
more advise there)

https://gerrit.libreoffice.org/#/c/47022/

Kind regards

-- 
Olivier Hallot
LibreOffice Documentation Coordinator
Comunidade LibreOffice
Rio de Janeiro - Brasil - Local Time: UTC-02:00
http://tdf.io/joinus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: icon-themes/galaxy

2017-12-23 Thread Adolfo Jayme Barrientos
 icon-themes/galaxy/sfx2/res/logo.png |binary
 1 file changed

New commits:
commit 253913f7fd6088617657e8fae6fa2274c08f0563
Author: Adolfo Jayme Barrientos 
Date:   Sat Dec 23 12:11:23 2017 -0600

Replace Start Center image

Change-Id: Id0eadcbbaec9d189e92710f6bd4ed21d7da2870c
Reviewed-on: https://gerrit.libreoffice.org/47023
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/icon-themes/galaxy/sfx2/res/logo.png 
b/icon-themes/galaxy/sfx2/res/logo.png
index 0678afb370b4..9ba6ac0d 100644
Binary files a/icon-themes/galaxy/sfx2/res/logo.png and 
b/icon-themes/galaxy/sfx2/res/logo.png differ
___
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' - extras/source

2017-12-23 Thread Laurent BP
 extras/source/templates/presnt/Blue_Curve.otp  |binary
 extras/source/templates/presnt/Classy_Red.otp  |binary
 extras/source/templates/presnt/Forestbird.otp  |binary
 extras/source/templates/presnt/Lights.otp  |binary
 extras/source/templates/presnt/LushGreen.otp   |binary
 extras/source/templates/presnt/Nature_Illustration.otp |binary
 extras/source/templates/presnt/Piano.otp   |binary
 7 files changed

New commits:
commit 0a03c7e7a2253f8a9452aacc0691ec69176a4418
Author: Laurent BP 
Date:   Fri Dec 1 21:14:42 2017 +0100

tdf#103317 tdf#89676 clean-up Impress templates

Blue_Curve
   - Remove unused fonts
   - Restore preview in Notes Master
   - Remove Autofit to outline of slide 2
   - add Title in meta.xml

Classy_Red
   - Remove unused fonts
   - Restore width in Notes Master 1
   - add Title in meta.xml

Forestbird
   - Remove unused fonts
   - Restore preview in Notes Master
   - add Title in meta.xml

Lights
   - Remove unused fonts
   - Restore preview in Notes Master
   - add Title in meta.xml

Lushgreen
   - Remove unused fonts
   - Restore preview in Notes
   - Restore preview in Notes Master
   - add Title in meta.xml

Nature_Illustration
   - Remove unused fonts
   - add Title in meta.xml

Piano
   - Remove unused fonts
   - Restore preview in Notes Master
   - add Title in meta.xml

Change-Id: I7338332b6424161a7a11854b47dec6193b205b7c
Reviewed-on: https://gerrit.libreoffice.org/45697
Tested-by: Jenkins 
Reviewed-by: Gabor Kelemen 
Tested-by: Gabor Kelemen 
(cherry picked from commit 39d1022967297524b852b5c82e78d815cf908b3d)
Reviewed-on: https://gerrit.libreoffice.org/47006
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/extras/source/templates/presnt/Blue_Curve.otp 
b/extras/source/templates/presnt/Blue_Curve.otp
index 3bf61ad23991..f87ab762a708 100644
Binary files a/extras/source/templates/presnt/Blue_Curve.otp and 
b/extras/source/templates/presnt/Blue_Curve.otp differ
diff --git a/extras/source/templates/presnt/Classy_Red.otp 
b/extras/source/templates/presnt/Classy_Red.otp
index 9753105b1dfd..62d090a953ca 100644
Binary files a/extras/source/templates/presnt/Classy_Red.otp and 
b/extras/source/templates/presnt/Classy_Red.otp differ
diff --git a/extras/source/templates/presnt/Forestbird.otp 
b/extras/source/templates/presnt/Forestbird.otp
index 8a609d5e2d4d..21b66215d26b 100644
Binary files a/extras/source/templates/presnt/Forestbird.otp and 
b/extras/source/templates/presnt/Forestbird.otp differ
diff --git a/extras/source/templates/presnt/Lights.otp 
b/extras/source/templates/presnt/Lights.otp
index 268236aad4f4..27a4d3fa7d76 100644
Binary files a/extras/source/templates/presnt/Lights.otp and 
b/extras/source/templates/presnt/Lights.otp differ
diff --git a/extras/source/templates/presnt/LushGreen.otp 
b/extras/source/templates/presnt/LushGreen.otp
index 7a69d13aa544..19b7e465cbe3 100644
Binary files a/extras/source/templates/presnt/LushGreen.otp and 
b/extras/source/templates/presnt/LushGreen.otp differ
diff --git a/extras/source/templates/presnt/Nature_Illustration.otp 
b/extras/source/templates/presnt/Nature_Illustration.otp
index 4a1b26f8286c..62682719c86f 100644
Binary files a/extras/source/templates/presnt/Nature_Illustration.otp and 
b/extras/source/templates/presnt/Nature_Illustration.otp differ
diff --git a/extras/source/templates/presnt/Piano.otp 
b/extras/source/templates/presnt/Piano.otp
index 92a66a712f0e..5ddba350bd46 100644
Binary files a/extras/source/templates/presnt/Piano.otp and 
b/extras/source/templates/presnt/Piano.otp differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


New Defects reported by Coverity Scan for LibreOffice

2017-12-23 Thread scan-admin

Hi,

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

4 new defect(s) introduced to LibreOffice found with Coverity Scan.
2 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

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


** CID 1426924:  Memory - illegal accesses  (RETURN_LOCAL)
/svx/source/items/svxerr.cxx: 30 in SvxErrorHandler::SvxErrorHandler()()



*** CID 1426924:  Memory - illegal accesses  (RETURN_LOCAL)
/svx/source/items/svxerr.cxx: 30 in SvxErrorHandler::SvxErrorHandler()()
24 #include 
25 
26 SvxErrorHandler::SvxErrorHandler() :
27   SfxErrorHandler(
28   getRID_SVXERRCODE(), ErrCodeArea::Svx, ErrCodeArea::Svx, 
SvxResLocale())
29 {
>>> CID 1426924:  Memory - illegal accesses  (RETURN_LOCAL)
>>> Returning here.
30 }
31 
32 namespace
33 {
34 class theSvxErrorHandler
35 : public rtl::Static {};

** CID 1426923:  Memory - illegal accesses  (RETURN_LOCAL)
/oox/source/ppt/pptimport.cxx: 165 in 
oox::ppt::PowerPointImport::importDocument()()



*** CID 1426923:  Memory - illegal accesses  (RETURN_LOCAL)
/oox/source/ppt/pptimport.cxx: 165 in 
oox::ppt::PowerPointImport::importDocument()()
159 bool bRet = importFragment(xPresentationFragmentHandler);
160 
161 if (mbMissingExtDrawing)
162 {
163 // Construct a warning message.
164 INetURLObject aURL(getFileUrl());
>>> CID 1426923:  Memory - illegal accesses  (RETURN_LOCAL)
>>> Temporary variable of type "std::locale" goes out of scope.
165 SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, 
aURL.getName(INetURLObject::LAST_SEGMENT, true, 
INetURLObject::DecodeMechanism::WithCharset), nullptr, getRID_ERRCTX());
166 OUString aWarning;
167 aContext.GetString(ERRCODE_NONE.MakeWarning(), aWarning);
168 aWarning += ":\n";
169 aWarning += SvxResId(RID_SVXSTR_WARN_MISSING_SMARTART);
170 

** CID 1426922:  Uninitialized members  (UNINIT_CTOR)
/sc/source/ui/dbgui/asciiopt.cxx: 40 in ScAsciiOptions::ScAsciiOptions()()



*** CID 1426922:  Uninitialized members  (UNINIT_CTOR)
/sc/source/ui/dbgui/asciiopt.cxx: 40 in ScAsciiOptions::ScAsciiOptions()()
34 cTextSep( cDefaultTextSep ),
35 eCharSet( osl_getThreadTextEncoding() ),
36 eLang   ( LANGUAGE_SYSTEM ),
37 bCharSetSystem  ( false ),
38 nStartRow   ( 1 )
39 {
>>> CID 1426922:  Uninitialized members  (UNINIT_CTOR)
>>> Non-static class member "bSkipEmptyCells" is not initialized in this 
>>> constructor nor in any functions that it calls.
40 }
41 
42 ScAsciiOptions::~ScAsciiOptions()
43 {
44 }
45 

** CID 1426921:  Uninitialized members  (UNINIT_CTOR)
/vcl/source/gdi/jobset.cxx: 87 in ImplJobSetup::ImplJobSetup(const 
ImplJobSetup&)()



*** CID 1426921:  Uninitialized members  (UNINIT_CTOR)
/vcl/source/gdi/jobset.cxx: 87 in ImplJobSetup::ImplJobSetup(const 
ImplJobSetup&)()
81 {
82 mpDriverData = static_cast(rtl_allocateMemory( 
mnDriverDataLen ));
83 memcpy( mpDriverData, rJobSetup.GetDriverData(), mnDriverDataLen 
);
84 }
85 else
86 mpDriverData = nullptr;
>>> CID 1426921:  Uninitialized members  (UNINIT_CTOR)
>>> Non-static class member "meSetupMode" is not initialized in this 
>>> constructor nor in any functions that it calls.
87 }
88 
89 ImplJobSetup::~ImplJobSetup()
90 {
91 rtl_freeMemory( mpDriverData );
92 }



To view the defects in Coverity Scan visit, 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB72ibeUH-2F-2F1Lhi9AZq3dRu-2F4-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyVi6LaJRNxumUOWFZyK3iTlSSlqB-2B1h6hcejEQniHdEEhWxujP210umaRtY9TEOCuogSEBMQfMRpxeZRfZM-2BzIJA1tSxOsd8py3dVy1fDrYlnUrpYnKCKNG7eGSRwI3YcB6HRkEKP5SARUO080HXSiPyE-2BJGKaiJgxyH3J-2Bo08SE-3D

To manage Coverity Scan email notifications for 
"libreoffice@lists.freedesktop.org", click 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4k1FZJSDV-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5lwWgMDuK-2FivqaohkU3M9kT-2Fww10Qt2GoaC

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

2017-12-23 Thread Caolán McNamara
 sw/source/filter/html/swhtml.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 4b3648ffaffe5b341c29e4665ca99b4da5e37ce4
Author: Caolán McNamara 
Date:   Fri Dec 22 21:28:02 2017 +

TestImportHTML: survive std::out_of_range

Change-Id: I084fd72e472bd2e647da3a80c7573280cd22bd93
Reviewed-on: https://gerrit.libreoffice.org/46998
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 2e22f5345037..d8b2398b7f20 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5552,6 +5552,9 @@ bool TestImportHTML(SvStream &rStream)
 catch (const std::runtime_error&)
 {
 }
+catch (const std::out_of_range&)
+{
+}
 pD->SetInReading(false);
 
 return bRet;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread Caolán McNamara
 sw/source/filter/html/htmltab.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f2e0c18cd44fff1e1b79924f582ced400fb00dad
Author: Caolán McNamara 
Date:   Fri Dec 22 21:33:52 2017 +

ofz#4728 Null-deref

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

diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 723d9544d21d..80ddf65f2303 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3585,6 +3585,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, 
bool bReadOptions,
 const SwTable* pSwTable = m_xDoc->InsertTable(
 SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ),
 *m_pPam->GetPoint(), 1, 1, text::HoriOrientation::LEFT 
);
+SwFrameFormat *pFrameFormat = pSwTable ? 
pSwTable->GetFrameFormat() : nullptr;
 
 if( bForceFrame )
 {
@@ -3594,10 +3595,10 @@ void SwHTMLParser::BuildTableCell( HTMLTable 
*pCurTable, bool bReadOptions,
 }
 else
 {
-if( bStyleParsed )
+if (bStyleParsed && pFrameFormat)
 {
 m_pCSS1Parser->SetFormatBreak( aItemSet, aPropInfo );
-pSwTable->GetFrameFormat()->SetFormatAttr( aItemSet );
+pFrameFormat->SetFormatAttr( aItemSet );
 }
 m_pPam->Move( fnMoveBackward );
 }
@@ -3606,8 +3607,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, 
bool bReadOptions,
 SwTextNode *const pOldTextNd = (!bAppended && !bForceFrame) ?
 pSavePos->nNode.GetNode().GetTextNode() : nullptr;
 
-SwFrameFormat *pFrameFormat = (pOldTextNd && pSwTable) ? 
pSwTable->GetFrameFormat() : nullptr;
-if (pFrameFormat)
+if (pFrameFormat && pOldTextNd)
 {
 const SfxPoolItem* pItem2;
 if( SfxItemState::SET == pOldTextNd->GetSwAttrSet()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread Caolán McNamara
 sw/source/filter/html/htmltab.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7a61e3347bc74d6f9cb1f82ce4c15db54d0f008
Author: Caolán McNamara 
Date:   Fri Dec 22 21:29:20 2017 +

ofz#4723 use vector::at

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

diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 7d40e971d559..723d9544d21d 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -778,7 +778,7 @@ inline HTMLTableCell *HTMLTableRow::GetCell( sal_uInt16 
nCell ) const
 {
 OSL_ENSURE( nCell < m_xCells->size(),
 "invalid cell index in HTML table row" );
-return (*m_xCells)[nCell].get();
+return m_xCells->at(nCell).get();
 }
 
 void HTMLTableRow::Expand( sal_uInt16 nCells, bool bOneCell )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-23 Thread Caolán McNamara
 unotools/source/misc/datetime.cxx |   65 ++
 1 file changed, 39 insertions(+), 26 deletions(-)

New commits:
commit 87114b364cdee276b81c21af2538c5612a1ce5d2
Author: Caolán McNamara 
Date:   Fri Dec 22 21:20:58 2017 +

ofz#4722 Integer-overflow

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

diff --git a/unotools/source/misc/datetime.cxx 
b/unotools/source/misc/datetime.cxx
index b0c1afce82eb..789e1ad8143a 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -27,15 +27,8 @@
 
 namespace
 {
-/** convert string to number with optional min and max values */
-template 
-bool convertNumber( T& rValue,
-const OUString& rString,
-T /*nMin*/ = -1, T /*nMax*/ = -1)
+bool checkAllNumber(const OUString& rString)
 {
-bool bNeg = false;
-rValue = 0;
-
 sal_Int32 nPos = 0;
 sal_Int32 nLen = rString.getLength();
 
@@ -44,28 +37,48 @@ namespace
 nPos++;
 
 if( nPos < nLen && '-' == rString[nPos] )
-{
-bNeg = true;
 nPos++;
-}
 
 // get number
 while( nPos < nLen &&
'0' <= rString[nPos] &&
'9' >= rString[nPos] )
 {
-// TODO: check overflow!
-rValue *= 10;
-rValue += (rString[nPos] - u'0');
 nPos++;
 }
 
-if( bNeg )
-rValue *= -1;
-
 return nPos == nLen;
 }
 
+/** convert string to number with optional min and max values */
+bool convertNumber32(sal_Int32& rValue,
+ const OUString& rString,
+ sal_Int32 /*nMin*/ = -1, sal_Int32 /*nMax*/ = -1)
+{
+if (!checkAllNumber(rString))
+{
+rValue = 0;
+return false;
+}
+
+rValue = rString.toInt32();
+return true;
+}
+
+bool convertNumber64(sal_Int64& rValue,
+ const OUString& rString,
+ sal_Int64 /*nMin*/ = -1, sal_Int64 /*nMax*/ = -1)
+{
+if (!checkAllNumber(rString))
+{
+rValue = 0;
+return false;
+}
+
+rValue = rString.toInt64();
+return true;
+}
+
 // although the standard calls for fixed-length (zero-padded) tokens
 // (in their integer part), we are here liberal and allow shorter tokens
 // (when there are separators, else it is ambiguous).
@@ -319,13 +332,13 @@ bool ISO8601parseDate(const OUString &aDateStr, 
css::util::Date& rDate)
 else
 {
 sal_Int32 n = 0;
-if ( !convertNumber( nYear, aDateStr.getToken( 0, '-', n ), 
0,  ) )
+if ( !convertNumber32( nYear, aDateStr.getToken( 0, '-', n ), 0,  
) )
 bSuccess = false;
 if ( nDateTokens >= 2 )
-if ( !convertNumber( nMonth, aDateStr.getToken( 0, '-', 
n ), 0, 12 ) )
+if ( !convertNumber32( nMonth, aDateStr.getToken( 0, '-', n ), 0, 
12 ) )
 bSuccess = false;
 if ( nDateTokens >= 3 )
-if ( !convertNumber( nDay, aDateStr.getToken( 0, '-', n 
), 0, 31 ) )
+if ( !convertNumber32( nDay, aDateStr.getToken( 0, '-', n ), 0, 31 
) )
 bSuccess = false;
 }
 
@@ -359,12 +372,12 @@ bool ISO8601parseTime(const OUString &aTimeStr, 
css::util::Time& rTime)
 if ( bFrac && n < aTimeStr.getLength())
 // is it junk or the timezone?
 bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
-if (bSuccess && (bSuccess = convertNumber( nHour, tokInt, 
0, 23 )) )
+if (bSuccess && (bSuccess = convertNumber32( nHour, tokInt, 0, 23 )) )
 {
 if (bFrac)
 {
 sal_Int64 fracNumerator;
-if ( (bSuccess = convertNumber(fracNumerator, tokFrac)) )
+if ( (bSuccess = convertNumber64(fracNumerator, tokFrac)) )
 {
 double frac = static_cast(fracNumerator) / 
pow(static_cast(10), static_cast(tokFrac.getLength()));
 // minutes
@@ -395,12 +408,12 @@ bool ISO8601parseTime(const OUString &aTimeStr, 
css::util::Time& rTime)
 if ( bFrac && n < aTimeStr.getLength())
 // is it junk or the timezone?
 bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
-if (bSuccess && (bSuccess = convertNumber( nMin, tokInt, 0, 
59 )) )
+if (bSuccess && (bSuccess = convertNumber32( nMin, tokInt, 0, 59 )) )
 {
 if (bFrac)
 {
 sal_Int64 fracNumerator;
-if ( (bSuccess = convertNumber(fracNumerator, tokFrac)) )
+if ( (bSuccess = convertNumber64(frac

Re: Fwd: Re: offline help replacement

2017-12-23 Thread Tomaž Vajngerl
Hi,

On Sat, Dec 23, 2017 at 7:13 PM, Olivier Hallot
 wrote:
> HI
>
> Newbie seeking advice!
>
> I am trying to implement Kendy's idea of a temp file with some HTML
> inside, I seek a piece of code to open a temp file, write contents in
> it, close it.
>
> I started with
> ---
> OUString aExtension(".html");
> ::utl::TempFile aTempFile("newhelp", true, &aExtension, nullptr,
> false );
> aTempFile.EnableKillingFile();
> --
>
> But then How do I write a simple OUString ("hello world") inside it?

continued from your example...

SvStream* pStream = aTempFile.GetStream(StreamMode::WRITE);
pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
pStream->WriteUnicodeOrByteText(OUString ("hello world"));
pStream->Close();
aTempFile.CloseStream();

As you can see this converts the OUString to UTF8 when you write it.
BTW. I didn't try to compile this, so it may be wrong :)

> Thanks in advance.
> Seasons Greetings!
> Olivier

Best Regards,
Tomaž
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2017-12-23 Thread Takeshi Abe
 svtools/source/contnr/svimpbox.cxx |   11 +++
 svtools/source/inc/svimpbox.hxx|3 ++-
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 40cfea9a5b4854ada381642d502bf8f74c87c00b
Author: Takeshi Abe 
Date:   Sat Dec 23 17:47:29 2017 +0900

svtools: Use std::unique_ptr for SvImpLBox

Change-Id: I4c5917eaa478e76411e9d8bbc5bd59c655693383
Reviewed-on: https://gerrit.libreoffice.org/47012
Reviewed-by: Julien Nabet 
Tested-by: Noel Grandin 

diff --git a/svtools/source/contnr/svimpbox.cxx 
b/svtools/source/contnr/svimpbox.cxx
index acf2e84e216f..8c3f8ed0e093 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -53,7 +53,6 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* 
pLBTree, WinBits nWinS
 , aFctSet(this, pLBView)
 , bAreChildrenTransient(true)
 , mbForceMakeVisible (false)
-, m_pStringSorter(nullptr)
 , aVerSBar(VclPtr::Create(pLBView, WB_DRAG | WB_VSCROLL))
 , aOutputSize(0, 0)
 , mbNoAutoCurEntry(false)
@@ -119,7 +118,6 @@ SvImpLBox::~SvImpLBox()
 aEditIdle.Stop();
 StopUserEvent();
 
-delete m_pStringSorter;
 if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
 {
 DELETEZ(s_pDefCollapsed);
@@ -141,17 +139,14 @@ void SvImpLBox::UpdateStringSorter()
 if( aLocale.Language != rNewLocale.Language ||
 aLocale.Country != rNewLocale.Country ||
 aLocale.Variant != rNewLocale.Variant )
-{
-delete m_pStringSorter;
-m_pStringSorter = nullptr;
-}
+m_pStringSorter.reset();
 }
 
 if( !m_pStringSorter )
 {
-m_pStringSorter = new comphelper::string::NaturalStringSorter(
+m_pStringSorter.reset(new comphelper::string::NaturalStringSorter(
   ::comphelper::getProcessComponentContext(),
-  rNewLocale);
+  rNewLocale));
 }
 }
 
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 1c56643c11ee..373c715e3577 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "svtaccessiblefactory.hxx"
 
@@ -142,7 +143,7 @@ private:
 Point   aEditClickPos;
 IdleaEditIdle;
 
-comphelper::string::NaturalStringSorter *m_pStringSorter;
+std::unique_ptr m_pStringSorter;
 
 std::vector< short > aContextBmpWidthVector;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: basic/qa

2017-12-23 Thread Zdeněk Crhonek
 basic/qa/cppunit/test_vba.cxx |1 
 basic/qa/vba_tests/space.vb   |4 --
 basic/qa/vba_tests/sqr.vb |4 --
 basic/qa/vba_tests/str.vb |4 --
 basic/qa/vba_tests/strcomp.vb |3 -
 basic/qa/vba_tests/string.vb  |3 -
 basic/qa/vba_tests/strreverse.vb  |4 --
 basic/qa/vba_tests/switch.vb  |4 --
 basic/qa/vba_tests/syd.vb |   62 --
 basic/qa/vba_tests/timeserial.vb  |   17 --
 basic/qa/vba_tests/timevalue.vb   |5 +--
 basic/qa/vba_tests/trim.vb|4 --
 basic/qa/vba_tests/typename.vb|4 --
 basic/qa/vba_tests/ubound.vb  |4 --
 basic/qa/vba_tests/ucase.vb   |4 --
 basic/qa/vba_tests/val.vb |4 --
 basic/qa/vba_tests/vartype.vb |2 -
 basic/qa/vba_tests/weekday.vb |4 --
 basic/qa/vba_tests/weekdayname.vb |4 --
 basic/qa/vba_tests/year.vb|6 +--
 20 files changed, 27 insertions(+), 120 deletions(-)

New commits:
commit c5417a21f50042686c43e8702ec50408f948a366
Author: Zdeněk Crhonek 
Date:   Mon Dec 4 08:04:52 2017 +0100

VBA tests (4) - don't pass when all tests fail

Change-Id: Ib4f9b5df1cffe104ba27be95183d075f24f28bb3
Reviewed-on: https://gerrit.libreoffice.org/45774
Tested-by: Jenkins 
Reviewed-by: Zdenek Crhonek 

diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index a238337b8953..24a65d02688f 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -126,7 +126,6 @@ void VBATest::testMiscVBAFunctions()
 "string.vb",
 "strreverse.vb",
 "switch.vb",
-"syd.vb",
 "timeserial.vb",
 "timevalue.vb",
 "trim.vb",
diff --git a/basic/qa/vba_tests/space.vb b/basic/qa/vba_tests/space.vb
index a49af12c997f..efcc9c992b65 100644
--- a/basic/qa/vba_tests/space.vb
+++ b/basic/qa/vba_tests/space.vb
@@ -6,7 +6,7 @@ Dim result As String
 
 Function doUnitTest() As String
 result = verify_testSpace()
-If failCount <> 0 And passCount > 0 Then
+If failCount <> 0 or passCount = 0 Then
 doUnitTest = result
 Else
 doUnitTest = "OK"
@@ -23,8 +23,6 @@ Function verify_testSpace() As String
 result = "Test Results" & Chr$(10) & "" & Chr$(10)
 
 Dim testName As String
-Dim TestDateTime As Date
-Dim TestStr As String
 Dim date1, date2
 testName = "Test Space function"
 On Error GoTo errorHandler
diff --git a/basic/qa/vba_tests/sqr.vb b/basic/qa/vba_tests/sqr.vb
index 20005400b4f9..75a4ae7c1a4c 100644
--- a/basic/qa/vba_tests/sqr.vb
+++ b/basic/qa/vba_tests/sqr.vb
@@ -6,7 +6,7 @@ Dim result As String
 
 Function doUnitTest() As String
 result = verify_testSQR()
-If failCount <> 0 And passCount > 0 Then
+If failCount <> 0 or passCount = 0 Then
 doUnitTest = result
 Else
 doUnitTest = "OK"
@@ -23,8 +23,6 @@ Function verify_testSQR() As String
 result = "Test Results" & Chr$(10) & "" & Chr$(10)
 
 Dim testName As String
-Dim TestDateTime As Date
-Dim TestStr As String
 Dim date1, date2
 testName = "Test SQR function"
 On Error GoTo errorHandler
diff --git a/basic/qa/vba_tests/str.vb b/basic/qa/vba_tests/str.vb
index f06775bfecda..e46371ed5812 100644
--- a/basic/qa/vba_tests/str.vb
+++ b/basic/qa/vba_tests/str.vb
@@ -6,7 +6,7 @@ Dim result As String
 
 Function doUnitTest() As String
 result = verify_testSTR()
-If failCount <> 0 And passCount > 0 Then
+If failCount <> 0 or passCount = 0 Then
 doUnitTest = result
 Else
 doUnitTest = "OK"
@@ -23,8 +23,6 @@ Function verify_testSTR() As String
 result = "Test Results" & Chr$(10) & "" & Chr$(10)
 
 Dim testName As String
-Dim TestDateTime As Date
-Dim TestStr As String
 Dim date1, date2
 testName = "Test STR function"
 On Error GoTo errorHandler
diff --git a/basic/qa/vba_tests/strcomp.vb b/basic/qa/vba_tests/strcomp.vb
index ecf661f64d9a..48735835808c 100644
--- a/basic/qa/vba_tests/strcomp.vb
+++ b/basic/qa/vba_tests/strcomp.vb
@@ -6,7 +6,7 @@ Dim result As String
 
 Function doUnitTest() As String
 result = verify_testSTRcomp()
-If failCount <> 0 And passCount > 0 Then
+If failCount <> 0 or passCount = 0 Then
 doUnitTest = result
 Else
 doUnitTest = "OK"
@@ -23,7 +23,6 @@ Function verify_testSTRcomp() As String
 result = "Test Results" & Chr$(10) & "" & Chr$(10)
 
 Dim testName As String
-Dim TestDateTime As Date
 Dim TestStr, TestStr1, TestStr2 As String
 Dim date1, date2
 testName = "Test STRcomp function"
diff --git a/basic/qa/vba_tests/string.vb b/basic/qa/vba_tests/string.vb
index 8091ddf45a6c..79496738c56c 100644
--- a/basic/qa/vba_tests/string.vb
+++ b/basic/qa/vba_tests/string.vb
@@ -6,7 +6,7 @@ Dim result As String
 
 Function doUnitTest() As String
 result = verify_testString()
-If failCount <> 0 And passCount > 0 Then
+If failCount <> 0 or passCount = 0 Then
 doUnitTest = result
 E

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

2017-12-23 Thread Noel Grandin
 include/svl/ownlist.hxx|2 +-
 include/svl/urihelper.hxx  |2 +-
 include/vcl/alpha.hxx  |2 +-
 include/vcl/bitmapex.hxx   |4 ++--
 include/vcl/button.hxx |2 +-
 include/vcl/errinf.hxx |2 +-
 include/vcl/listctrl.hxx   |2 +-
 include/vcl/svapp.hxx  |2 +-
 include/vcl/toolbox.hxx|2 +-
 sot/source/sdstor/stgcache.hxx |2 +-
 svl/source/items/stylepool.cxx |6 +++---
 svl/source/misc/urihelper.cxx  |2 +-
 vcl/inc/implimagetree.hxx  |2 +-
 vcl/inc/opengl/watchdog.hxx|2 +-
 vcl/inc/unx/cpdmgr.hxx |2 +-
 vcl/source/control/listctrl.cxx|2 +-
 vcl/source/gdi/alpha.cxx   |2 +-
 vcl/source/image/ImplImageTree.cxx |2 +-
 vcl/source/window/toolbox2.cxx |2 +-
 vcl/unx/generic/printer/cpdmgr.cxx |2 +-
 20 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit a8c1c0ae1617c68d49deb33e9236a2c1b7cac14d
Author: Noel Grandin 
Date:   Sat Dec 23 09:17:30 2017 +0200

loplugin:passstuffbyref improved returns in vcl

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

diff --git a/include/svl/ownlist.hxx b/include/svl/ownlist.hxx
index 620b48078ac7..ef4d616032e1 100644
--- a/include/svl/ownlist.hxx
+++ b/include/svl/ownlist.hxx
@@ -68,7 +68,7 @@ public:
 
 size_t  size() const { return aCommandList.size(); }
 
-SvCommand   operator[]( size_t i) {
+SvCommand const & operator[]( size_t i) {
 return aCommandList[ i ];
 }
 
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index 6b5a2fc2ff36..92668263837c 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -61,7 +61,7 @@ SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & 
rTheBaseURIRef,
 
 SVL_DLLPUBLIC void SetMaybeFileHdl(Link const & 
rTheMaybeFileHdl);
 
-SVL_DLLPUBLIC Link GetMaybeFileHdl();
+SVL_DLLPUBLIC Link const & GetMaybeFileHdl();
 
 /**
Converts a URI reference to a relative one, ignoring certain differences 
(for
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index e21bcc3b0732..e3fd8ee43ec5 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -55,7 +55,7 @@ public:
 
 BitmapChecksum   GetChecksum() const { return Bitmap::GetChecksum(); }
 
-Bitmap  GetBitmap() const;
+Bitmap const & GetBitmap() const;
 
 boolErase( sal_uInt8 cTransparency );
 boolReplace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index c7a7bc7e2e59..a850572357e9 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -427,8 +427,8 @@ public:
 const Size &rSize );
 public:
 
-SAL_DLLPRIVATE  std::shared_ptr  ImplGetBitmapImpBitmap() const 
{ return aBitmap.ImplGetImpBitmap(); }
-SAL_DLLPRIVATE  std::shared_ptr  ImplGetMaskImpBitmap() const { 
return aMask.ImplGetImpBitmap(); }
+SAL_DLLPRIVATE std::shared_ptr const & ImplGetBitmapImpBitmap() 
const { return aBitmap.ImplGetImpBitmap(); }
+SAL_DLLPRIVATE std::shared_ptr const & ImplGetMaskImpBitmap() 
const { return aMask.ImplGetImpBitmap(); }
 
 
 private:
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 3a4159d35392..29bcfdc10b65 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -77,7 +77,7 @@ public:
 
 /// Setup handler for UNO commands so that commands like .uno:Something 
are handled automagically by this button.
 voidSetCommandHandler(const OUString& aCommand);
-const OUString  GetCommand() const { return maCommand; }
+OUString const &GetCommand() const { return maCommand; }
 
 static OUString GetStandardText( StandardButtonType eButton );
 
diff --git a/include/vcl/errinf.hxx b/include/vcl/errinf.hxx
index 4a3990b237ef..bc8c01a13e05 100644
--- a/include/vcl/errinf.hxx
+++ b/include/vcl/errinf.hxx
@@ -145,7 +145,7 @@ public:
 nUserId(nArgUserId) {}
 virtual ~ErrorInfo();
 
-ErrCode GetErrorCode() const { return nUserId; }
+ErrCode const & GetErrorCode() const { return nUserId; }
 
 static ErrorInfo*   GetErrorInfo(ErrCode);
 
diff --git a/include/vcl/listctrl.hxx b/include/vcl/listctrl.hxx
index 6659ccafb3ff..d640ad2c7ee6 100644
--- a/include/vcl/listctrl.hxx
+++ b/include/vcl/listctrl.hxx
@@ -44,7 +44,7 @@ public:
 virtual void dispose() override;
 
 void addEntry(VclPtr xEntry, sal_uInt32 nPos = 
std::numeric_limits::max());
-std::vector> getEntries() const;
+std::vector> const & getEntries() const;
 void deleteEntry(sal_uInt32 nPos);
 
 virtual Size GetOptimalSize() const o

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

2017-12-23 Thread Jochen Nitschke
 chart2/source/view/axes/Tickmarks.cxx  |   21 ++---
 chart2/source/view/axes/VCartesianAxis.cxx |   26 +-
 2 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 38bf5f69663f64434a3a0a74e02c1a23f876b677
Author: Jochen Nitschke 
Date:   Tue Jun 6 11:19:50 2017 +0200

tdf#108031 Area chart labels not rotated

This fixes recognition of x-axis or y-axis when the coordinate system
is rotated (3D-view). So the labels are rotated correctly.

Change-Id: Iaacfec943f3885c58e99a55585714a79f1d0d9d5
Reviewed-on: https://gerrit.libreoffice.org/38355
Reviewed-by: Jochen Nitschke 
Tested-by: Jochen Nitschke 

diff --git a/chart2/source/view/axes/Tickmarks.cxx 
b/chart2/source/view/axes/Tickmarks.cxx
index 95f967b3b215..3d6d25a044bf 100644
--- a/chart2/source/view/axes/Tickmarks.cxx
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -172,13 +172,28 @@ TickFactory2D::~TickFactory2D()
 
 bool TickFactory2D::isHorizontalAxis() const
 {
-return ( m_aAxisStartScreenPosition2D.getY() == 
m_aAxisEndScreenPosition2D.getY() );
+// check trivial cases:
+if ( m_aAxisStartScreenPosition2D.getY() == 
m_aAxisEndScreenPosition2D.getY() )
+return true;
+if ( m_aAxisStartScreenPosition2D.getX() == 
m_aAxisEndScreenPosition2D.getX() )
+return false;
+
+// for skew axes compare angle with horizontal vector
+double fInclination = 
std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(1.0,
 0.0)));
+return fInclination < F_PI4 || fInclination > (F_PI-F_PI4);
 }
 bool TickFactory2D::isVerticalAxis() const
 {
-return ( m_aAxisStartScreenPosition2D.getX() == 
m_aAxisEndScreenPosition2D.getX() );
+// check trivial cases:
+if ( m_aAxisStartScreenPosition2D.getX() == 
m_aAxisEndScreenPosition2D.getX() )
+return true;
+if ( m_aAxisStartScreenPosition2D.getY() == 
m_aAxisEndScreenPosition2D.getY() )
+return false;
+
+// for skew axes compare angle with vertical vector
+double fInclination = 
std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(0.0,
 -1.0)));
+return fInclination < F_PI4 || fInclination > (F_PI-F_PI4);
 }
-
 //static
 sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter )
 {
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index c53f890a07a6..9493102a93c4 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -104,25 +104,13 @@ Reference< drawing::XShape > createSingleLabel(
 
 bool lcl_doesShapeOverlapWithTickmark( const Reference< drawing::XShape >& 
xShape
, double fRotationAngleDegree
-   , const basegfx::B2DVector& rTickScreenPosition
-   , bool bIsHorizontalAxis, bool bIsVerticalAxis )
+   , const basegfx::B2DVector& rTickScreenPosition )
 {
 if(!xShape.is())
 return false;
 
 ::basegfx::B2IRectangle aShapeRect = 
BaseGFXHelper::makeRectangle(xShape->getPosition(),AbstractShapeFactory::getSizeAfterRotation(
 xShape, fRotationAngleDegree ));
 
-if( bIsVerticalAxis )
-{
-return ( (rTickScreenPosition.getY() >= aShapeRect.getMinY())
-&& (rTickScreenPosition.getY() <= aShapeRect.getMaxY()) );
-}
-if( bIsHorizontalAxis )
-{
-return ( (rTickScreenPosition.getX() >= aShapeRect.getMinX())
-&& (rTickScreenPosition.getX() <= aShapeRect.getMaxX()) );
-}
-
 basegfx::B2IVector aPosition(
 static_cast( rTickScreenPosition.getX() )
 , static_cast( rTickScreenPosition.getY() ) );
@@ -744,8 +732,7 @@ bool VCartesianAxis::createTextShapes(
 
 if( lcl_doesShapeOverlapWithTickmark( 
pLastVisibleNeighbourTickInfo->xTextShape
, rAxisLabelProperties.fRotationAngleDegree
-   , pTickInfo->aTickScreenPosition
-   , bIsHorizontalAxis, bIsVerticalAxis ) )
+   , pTickInfo->aTickScreenPosition ) )
 {
 // This tick overlaps with its neighbor.  Try to stagger (if
 // auto staggering is allowed) to avoid overlapping.
@@ -759,8 +746,7 @@ bool VCartesianAxis::createTextShapes(
 if( !pLastVisibleNeighbourTickInfo ||
 !lcl_doesShapeOverlapWithTickmark( 
pLastVisibleNeighbourTickInfo->xTextShape
 , rAxisLabelProperties.fRotationAngleDegree
-, pTickInfo->aTickScreenPosition
-, bIsHorizontalAxis, bIsVerticalAxis ) )
+, pTickInfo->aTickScreenPosition ) )
 bOverlapsAfterAutoStagger = false;
 }
 
@@ -841,8 +827,7 @@ bool VCartesianAxis::createTextShapes(
 if

[Libreoffice-commits] core.git: officecfg/registry

2017-12-23 Thread Yousuf Philips
 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |   42 
++
 1 file changed, 42 insertions(+)

New commits:
commit eb5c30450e1966caf476dbbc63669b1593d5c5a7
Author: Yousuf Philips 
Date:   Fri Dec 22 13:27:38 2017 +0400

tdf#114605 Allow line split buttons to work in the menus

Change-Id: Ie6cb2b19c56cb5b38f1dca89dba775970f405748
Reviewed-on: https://gerrit.libreoffice.org/46905
Reviewed-by: Maxim Monastirsky 
Tested-by: Jenkins 

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 103d14d1f672..12d7ccd3de91 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -439,6 +439,48 @@
   preview
 
   
+  
+
+  .uno:ArrowsToolbox
+
+
+  
+
+
+  com.sun.star.comp.framework.ToolbarAsMenuController
+
+
+  arrowsbar
+
+  
+  
+
+  .uno:LineToolbox
+
+
+  
+
+
+  com.sun.star.comp.framework.ToolbarAsMenuController
+
+
+  linesbar
+
+  
+  
+
+  .uno:ConnectorToolbox
+
+
+  
+
+
+  com.sun.star.comp.framework.ToolbarAsMenuController
+
+
+  connectorsbar
+
+  
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: officecfg/registry sd/uiconfig

2017-12-23 Thread Yousuf Philips
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |   
25 
 sd/uiconfig/sdraw/menubar/menubar.xml|  
454 +++---
 2 files changed, 348 insertions(+), 131 deletions(-)

New commits:
commit 7e53bd35e8f8669fdeb095f8ec1a4848ffc5f507
Author: Yousuf Philips 
Date:   Thu Dec 21 03:16:02 2017 +0400

tdf#95827 Reorganize draw's menu bar

Change-Id: Ied9be2da293e6d318548019e29ae4f95e568144a
Reviewed-on: https://gerrit.libreoffice.org/46867
Tested-by: Jenkins 
Reviewed-by: Yousuf Philips 

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 41ccadb46db6..cc507509940e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -24,6 +24,16 @@
   S~lide
 
   
+  
+
+  ~Page
+
+  
+  
+
+  ~Shape
+
+  
   
 
   Move
@@ -633,7 +643,7 @@
   Format Page
 
 
-  ~Page Properties...
+  Properties...
 
 
   1
@@ -728,7 +738,7 @@
   
   
 
-  ~File...
+  Insert Page from File...
 
 
   1
@@ -949,6 +959,17 @@
   1
 
   
+  
+
+  Master Page...
+
+
+  .uno:PresentationLayout
+
+
+  1
+
+  
   
 
   Slide Layout
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml 
b/sd/uiconfig/sdraw/menubar/menubar.xml
index fc1d25b9c7b8..a087af9923a1 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -23,19 +23,21 @@
   
   
   
+  
   
+  
+  
+  
+  
+  
+  
+  
+  
   
   
-
-
-
-
-
-
-
-
+  
+  
   
-  
   
   
   
@@ -45,9 +47,6 @@
   
   
   
-  
-  
-  
   
   
   
@@ -56,19 +55,18 @@
   
 
   
+  
+  
+  
+  
   
-  
   
 
   
   
 
   
-  
-  
-  
-  
-  
+  
   
   
 
@@ -87,19 +85,14 @@
   
   
   
-  
-  
   
   
   
-  
+  
   
-  
-  
   
   
   
-  
   
   
 
@@ -111,7 +104,6 @@
   
   
   
-  
   
   
   
@@ -130,6 +122,7 @@
   
 
   
+  
   
 
   
@@ -138,8 +131,10 @@
 
   
   
+  
   
   
+  
   
   
   
@@ -161,10 +156,51 @@
   
   
 
-  
-  
-  
+  
+  
+
+  
+  
+
+  
+  
+
+  
+ 
+
+  
+  
+  
+
+  
+  
+
+  
+  
+  
   
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
   
 
   
@@ -179,139 +215,239 @@
   
 
   
-  
-  
-  
+  
+  
 
-  
-  
-  
-  
-  
-  
-  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
 
   
-  
-  
-  
-  
+
+  
+  
+
+  
 
-  
-  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
 
-  
-  
+  
+  
+  
+  
+  
+  
+  
+  
 
   
- 
- 
 
   
-  
-  
+  
 
-  
-  
+  
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+ 

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

2017-12-23 Thread tagezi
 sc/source/ui/view/cellsh1.cxx |   73 +++---
 1 file changed, 27 insertions(+), 46 deletions(-)

New commits:
commit e76bdaeb300e8420a8bc96e5e38b858821d22564
Author: tagezi 
Date:   Sat Dec 23 00:17:22 2017 +0200

tdf#39593 deduplicate code in ScCellShell

Change-Id: Ia2a4219a9e21cdbaeaab99df52c79dfa1ce9e184
Reviewed-on: https://gerrit.libreoffice.org/47003
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 0ee77d29ba6c..7a7ecf3da833 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -130,6 +130,30 @@ InsertDeleteFlags FlagsFromString(const OUString& 
rFlagsStr,
 }
 return nFlags;
 }
+
+OUString FlagsToString( InsertDeleteFlags nFlags,
+InsertDeleteFlags nFlagsMask = InsertDeleteFlags::CONTENTS | 
InsertDeleteFlags::ATTRIB )
+{
+OUString  aFlagsStr;
+
+if( nFlags == InsertDeleteFlags::ALL )
+{
+aFlagsStr = "A";
+}
+else
+{
+nFlags &= nFlagsMask;
+
+if( nFlags & InsertDeleteFlags::STRING )aFlagsStr += "S";
+if( nFlags & InsertDeleteFlags::VALUE ) aFlagsStr += "V";
+if( nFlags & InsertDeleteFlags::DATETIME )  aFlagsStr += "D";
+if( nFlags & InsertDeleteFlags::FORMULA )   aFlagsStr += "F";
+if( nFlags & InsertDeleteFlags::NOTE )  aFlagsStr += "N";
+if( nFlags & InsertDeleteFlags::ATTRIB )aFlagsStr += "T";
+if( nFlags & InsertDeleteFlags::OBJECTS )   aFlagsStr += "O";
+}
+return aFlagsStr;
+}
 }
 
 void ScCellShell::ExecuteEdit( SfxRequest& rReq )
@@ -404,22 +428,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
 if( ! rReq.IsAPI() )
 {
-OUString  aFlags;
-
-if( nFlags == InsertDeleteFlags::ALL )
-{
-aFlags += "A";
-}
-else
-{
-if( nFlags & InsertDeleteFlags::STRING ) aFlags += 
"S";
-if( nFlags & InsertDeleteFlags::VALUE ) aFlags += 
"V";
-if( nFlags & InsertDeleteFlags::DATETIME ) aFlags 
+= "D";
-if( nFlags & InsertDeleteFlags::FORMULA ) aFlags 
+= "F";
-if( nFlags & InsertDeleteFlags::NOTE ) aFlags += 
"N";
-if( nFlags & InsertDeleteFlags::ATTRIB ) aFlags += 
"T";
-if( nFlags & InsertDeleteFlags::OBJECTS ) aFlags 
+= "O";
-}
+OUString aFlags = FlagsToString( nFlags, 
InsertDeleteFlags::ALL );
 
 rReq.AppendItem( SfxStringItem( SID_DELETE, aFlags ) );
 rReq.Done();
@@ -493,21 +502,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
 if( ! rReq.IsAPI() )
 {
-OUString  aFlags;
-
-if( nFlags == InsertDeleteFlags::ALL )
-{
-aFlags += "A";
-}
-else
-{
-if( nFlags & InsertDeleteFlags::STRING ) aFlags += 
"S";
-if( nFlags & InsertDeleteFlags::VALUE ) aFlags += 
"V";
-if( nFlags & InsertDeleteFlags::DATETIME ) aFlags 
+= "D";
-if( nFlags & InsertDeleteFlags::FORMULA ) aFlags 
+= "F";
-if( nFlags & InsertDeleteFlags::NOTE ) aFlags += 
"N";
-if( nFlags & InsertDeleteFlags::ATTRIB ) aFlags += 
"T";
-}
+OUString aFlags = FlagsToString( nFlags );
 
 rReq.AppendItem( SfxStringItem( FID_FILL_TAB, aFlags ) 
);
 rReq.Done();
@@ -1463,21 +1458,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
 if( !pReqArgs )
 {
-OUString  aFlags;
-
-if( nFlags == InsertDeleteFlags::ALL )
-{
-aFlags += "A";
-}
-else
-{
-if( nFlags & InsertDeleteFlags::STRING ) 
aFlags += "S";
-if( nFlags & InsertDeleteFlags::VALUE ) aFlags 
+= "V";
-if( nFlags & InsertDeleteFlags::DATETIME ) 
aFlags += "D";
-if( nFlags & InsertDeleteFlags::FORMULA ) 
aFlags += "F";
-if( nFlags & InsertDeleteFlags::NOTE ) aFlags 
+= "N";
-if( nFlags & InsertDeleteFlags

Re: Fwd: Re: offline help replacement

2017-12-23 Thread Olivier Hallot
HI

Newbie seeking advice!

I am trying to implement Kendy's idea of a temp file with some HTML
inside, I seek a piece of code to open a temp file, write contents in
it, close it.

I started with
---
OUString aExtension(".html");
::utl::TempFile aTempFile("newhelp", true, &aExtension, nullptr,
false );
aTempFile.EnableKillingFile();
--

But then How do I write a simple OUString ("hello world") inside it?

Thanks in advance.
Seasons Greetings!
Olivier


Em 22/12/2017 07:00, Olivier Hallot escreveu:
> Hi
> For the records, the patch
> 
> https://gerrit.libreoffice.org/gitweb?p=help.git;a=commitdiff;h=0e5a56e81f63d2705f1083acda4b2d899783fdcd
> 
> now allows the pages to be equally navigated in browser with both
> http:// and file:// protocols.
> 
> Regards
> Olivier
> 
> Em 18/12/2017 14:44, Olivier Hallot escreveu:
>> Hi All
>>
>> To integrate the new offline help in LibreOffice we need to call the
>> browser from LibreOffice passing the help page parameters.
>>
>> The job is ready for the online help (*) and is in line 523 of the file
>> below.
>>
>> sfx2/source/appl/sfxhelp.cxx.
>>
>> For the offline help we still need a way to call the browser passing the
>> right url to
>>
>> ${Install}/help/
>>
>> in the same sfxhelp.cxx file
>>
>> David Tardon has prepared a set of makefiles for the new html help with
>> some new params as
>>
>> Usage: --with-helpbuild the old local help
>>--without-help no local help (default)
>>--with-help=html   build the new HTML local help
>>--with-help=online build the new HTML online help
>>--with-help=common bundle common files for the local
>>help but do not build the whole help
>>
>> Below are some findings we have from previous discussion on how to
>> address the issue.
>>
>> Any help is appreciated
>>
>> Kind regards
>> Olivier
>>
>>
>>  Mensagem encaminhada 
>> Assunto: Re: offline help replacement
>> Data: Tue, 26 Sep 2017 10:29:02 +0200
>> De: Jan Holesovsky 
>> Para: Olivier Hallot 
>>
>> Hi Olivier,
>>
>> Olivier Hallot píše v Po 25. 09. 2017 v 14:46 -0300:
>>
>>> Simply replacing the URL + protocol does not work so easy because the
>>> protocols are handled by different applications: http:// is handled
>>> by
>>> the browser and file:// is handled by a file manager, or undefined.
>>>
>>> in my linux system the command invokes
>>>
>>> xdg-open: file
>>> '/home/tdf/git/core/instdir/help3/help.html?swriter/sfx/ui/startcente
>>> r/open_all?Language=fr&System=UNIX&Version=6.0'
>>> does not exist
>>
>> Oh yes, the problem is that xdg-open is confused about the parameters
>> there - it thinks it is still part of the filename :-(
>>
>> But if you do 'xdg-open file:///some/file/ending_with.html' , it opens
>> that in the browser; so I think whenever the help file is supposed to
>> be open, the easiest will be to write a temporary redirectXYZABC.html
>> file like:
>>
>> 
>> 
>> 
>> 
>> 
>> 
>> window.location.href =
>> "file:///<...>?Language=fr&System=UNIX&Version=6.0"
>> 
>> Help Page Redirection
>> 
>> 
>> ... a short explanation about the help maybe? ...
>> 
>> If you are not redirected automatically, follow this > href='file:///<...>?Language=fr&System=UNIX&Version=6.0'>link to
>> example.
>> 
>> 
>>
>> and let xdg-open open that one.
>>
>> I've tested here, and xdg-open opens this in the webbrowser & the
>> redirect works fine :-)  So that + some proper cleanup of the temp
>> directory will do that I hope.
>>
>> All the best,
>> Kendy
>> ___
>> LibreOffice mailing list
>> LibreOffice@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/libreoffice
>>
> 

-- 
Olivier Hallot
LibreOffice Documentation Coordinator
Comunidade LibreOffice
Rio de Janeiro - Brasil - Local Time: UTC-02:00
http://tdf.io/joinus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice