[Libreoffice-commits] core.git: codemaker/source cui/source dbaccess/source lotuswordpro/source oox/source reportdesign/source sc/source sdext/source sfx2/source starmath/source sw/qa sw/source vcl/qa

2019-04-14 Thread Mike Kaganski (via logerrit)
 codemaker/source/codemaker/typemanager.cxx |3 -
 cui/source/tabpages/tppattern.cxx  |4 +
 dbaccess/source/ext/macromigration/macromigrationpages.cxx |4 +
 lotuswordpro/source/filter/lwpcelllayout.cxx   |1 
 lotuswordpro/source/filter/lwpfribsection.cxx  |4 -
 lotuswordpro/source/filter/lwprowlayout.cxx|1 
 lotuswordpro/source/filter/lwptablelayout.cxx  |   16 -
 oox/source/ole/vbacontrol.cxx  |2 
 oox/source/ppt/presentationfragmenthandler.cxx |1 
 reportdesign/source/ui/report/ReportController.cxx |2 
 sc/source/ui/app/scmod.cxx |3 -
 sc/source/ui/vba/vbarange.cxx  |1 
 sc/source/ui/view/tabvwsh4.cxx |1 
 sdext/source/pdfimport/tree/writertreevisiting.cxx |   17 +++---
 sfx2/source/dialog/templdlg.cxx|2 
 sfx2/source/doc/Metadatable.cxx|1 
 starmath/source/view.cxx   |7 +-
 sw/qa/extras/uiwriter/uiwriter.cxx |5 +
 sw/source/core/attr/swatrset.cxx   |5 +
 sw/source/core/docnode/section.cxx |4 +
 sw/source/core/txtnode/ndtxt.cxx   |1 
 sw/source/filter/xml/xmlimp.cxx|8 ++
 sw/source/uibase/uiview/srcview.cxx|   35 -
 sw/source/uibase/uno/unotxdoc.cxx  |3 +
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |1 
 vcl/source/gdi/print2.cxx  |2 
 vcl/source/graphic/UnoGraphicProvider.cxx  |2 
 vcl/workben/vcldemo.cxx|8 ++
 xmloff/source/draw/ximpshap.cxx|8 +-
 29 files changed, 103 insertions(+), 49 deletions(-)

New commits:
commit 0869895063bd528893707cb74c6cf4c461fef066
Author: Mike Kaganski 
AuthorDate: Sun Apr 14 13:58:14 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 14:14:36 2019 +0200

tdf#120703 PVS: Silence V522 warnings

V522 There might be dereferencing of a potential null pointer.

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

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index cf638f0ca4eb..12a00495ee56 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -220,8 +220,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 return s;
 case codemaker::UnoType::Sort::PolymorphicStructTemplate:
 if (args.size()
-!= (dynamic_cast<
-unoidl::PolymorphicStructTypeTemplateEntity * 
>(ent.get())->
+!= 
(dynamic_cast(*ent).
 getTypeParameters().size()))
 {
 throw CannotDumpException(
diff --git a/cui/source/tabpages/tppattern.cxx 
b/cui/source/tabpages/tppattern.cxx
index 0bb433f00c65..0a73dfdf3e52 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -392,7 +392,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, 
weld::Button&, void)
 
 if(SfxItemState::SET == m_rOutAttrs.GetItemState(XATTR_FILLBITMAP, 
true, &pPoolItem))
 {
-pEntry.reset(new XBitmapEntry(dynamic_cast(pPoolItem)->GetGraphicObject(), aName));
+auto pFillBmpItem = dynamic_cast(pPoolItem);
+assert(pFillBmpItem);
+pEntry.reset(new 
XBitmapEntry(pFillBmpItem->GetGraphicObject(), aName));
 }
 else
 assert(!"SvxPatternTabPage::ClickAddHdl_Impl(), XBitmapEntry* 
pEntry == nullptr ?");
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx 
b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
index d4b84e5982e6..d2b19ed7608f 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
@@ -41,7 +41,9 @@ namespace dbmm
 
 MacroMigrationDialog& MacroMigrationPage::getDialog()
 {
-return *dynamic_cast< MacroMigrationDialog* >( GetParentDialog() );
+auto pDialog = dynamic_cast(GetParentDialog());
+assert(pDialog);
+return *pDialog;
 }
 
 // PreparationPage
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx 
b/lotuswordpro/source/filter/lwpcelllayout.cxx
index 373656132adb..17f516a7897a 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -348,6 +348,7 @@ LwpPara* 

[Libreoffice-commits] core.git: 2 commits - solenv/clang-format vcl/inc vcl/Library_vcl.mk vcl/source

2019-04-14 Thread Tomaž Vajngerl (via logerrit)
 solenv/clang-format/blacklist |3 
 vcl/Library_vcl.mk|2 
 vcl/inc/bitmap/Octree.hxx |  115 +
 vcl/inc/bitmap/impoctree.hxx  |  146 ++
 vcl/inc/impoctree.hxx |  147 --
 vcl/inc/octree.hxx|  119 -
 vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx |2 
 vcl/source/bitmap/Octree.cxx  |  302 ++
 vcl/source/gdi/bitmap3.cxx|4 
 vcl/source/gdi/octree.cxx |  298 -
 10 files changed, 567 insertions(+), 571 deletions(-)

New commits:
commit f441b7c74d9074b0b29eabfbf35f47a1df7cea9c
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 14 15:34:03 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 14 14:19:03 2019 +0200

put Octree classes out of formatting blacklist

Need to do this so it is at least somewhat formatted sanely before
refactoring to the data structures.

Change-Id: I136a539a190c2f53aa05cc9a26872a5606f81888
Reviewed-on: https://gerrit.libreoffice.org/70727
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 732fc7c40550..ccd57fa3c047 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -17336,8 +17336,6 @@ vcl/inc/ios/svsys.h
 vcl/inc/jobset.h
 vcl/inc/langboost.hxx
 vcl/inc/listbox.hxx
-vcl/inc/bitmap/Octree.hxx
-vcl/inc/bitmap/impoctree.hxx
 vcl/inc/opengl/BufferObject.hxx
 vcl/inc/opengl/DeviceInfo.hxx
 vcl/inc/opengl/FixedTextureAtlas.hxx
@@ -1,7 +17775,6 @@ vcl/source/bitmap/BitmapTools.cxx
 vcl/source/bitmap/bitmap.cxx
 vcl/source/bitmap/bitmapfilter.cxx
 vcl/source/bitmap/checksum.cxx
-vcl/source/bitmap/Octree.cxx
 vcl/source/components/dtranscomp.cxx
 vcl/source/components/factory.cxx
 vcl/source/components/fontident.cxx
diff --git a/vcl/inc/bitmap/Octree.hxx b/vcl/inc/bitmap/Octree.hxx
index cec8e4171494..3e54826a9313 100644
--- a/vcl/inc/bitmap/Octree.hxx
+++ b/vcl/inc/bitmap/Octree.hxx
@@ -23,20 +23,20 @@
 #include 
 #include 
 
-#define OCTREE_BITS 5
-#define OCTREE_BITS_1   10
+#define OCTREE_BITS 5
+#define OCTREE_BITS_1 10
 
 struct OctreeNode
 {
-sal_uLong   nCount;
-sal_uLong   nRed;
-sal_uLong   nGreen;
-sal_uLong   nBlue;
-OctreeNode* pChild[ 8 ];
-OctreeNode* pNext;
-OctreeNode* pNextInCache;
-sal_uInt16  nPalIndex;
-boolbLeaf;
+sal_uLong nCount;
+sal_uLong nRed;
+sal_uLong nGreen;
+sal_uLong nBlue;
+OctreeNode* pChild[8];
+OctreeNode* pNext;
+OctreeNode* pNextInCache;
+sal_uInt16 nPalIndex;
+bool bLeaf;
 };
 
 class ImpNodeCache;
@@ -45,73 +45,69 @@ class BitmapReadAccess;
 class VCL_PLUGIN_PUBLIC Octree
 {
 private:
-voidCreatePalette( OctreeNode* pNode );
-voidGetPalIndex( OctreeNode* pNode );
-
-SAL_DLLPRIVATE void ImplDeleteOctree( OctreeNode** ppNode );
-SAL_DLLPRIVATE void ImplAdd( OctreeNode** ppNode );
-SAL_DLLPRIVATE void ImplReduce();
-
-
-BitmapPalette   aPal;
-sal_uLong   nLeafCount;
-sal_uLong   nLevel;
-OctreeNode* pTree;
-OctreeNode* pReduce[ OCTREE_BITS + 1 ];
-BitmapColor const * pColor;
+void CreatePalette(OctreeNode* pNode);
+void GetPalIndex(OctreeNode* pNode);
+
+SAL_DLLPRIVATE void ImplDeleteOctree(OctreeNode** ppNode);
+SAL_DLLPRIVATE void ImplAdd(OctreeNode** ppNode);
+SAL_DLLPRIVATE void ImplReduce();
+
+BitmapPalette aPal;
+sal_uLong nLeafCount;
+sal_uLong nLevel;
+OctreeNode* pTree;
+OctreeNode* pReduce[OCTREE_BITS + 1];
+BitmapColor const* pColor;
 std::unique_ptr pNodeCache;
-const BitmapReadAccess* pAcc;
-sal_uInt16  nPalIndex;
+const BitmapReadAccess* pAcc;
+sal_uInt16 nPalIndex;
 
 public:
-
-Octree( const BitmapReadAccess& rReadAcc, 
sal_uLong nColors );
-~Octree();
+Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors);
+~Octree();
 
 inline const BitmapPalette& GetPalette();
-inline sal_uInt16   GetBestPaletteIndex( const BitmapColor& rColor 
);
+inline sal_uInt16 GetBestPaletteIndex(const BitmapColor& rColor);
 };
 
 inline const BitmapPalette& Octree::GetPalette()
 {
-aPal.SetEntryCount( static_cast(nLeafCount) );
+aPal.SetEntryCount(static_cast(nLeafCount));
 nPalIndex = 0;
-CreatePalette( pTree );
+CreatePalette(pTree);
 return aPal;
 }
 
-inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
+inline sal_uInt

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

2019-04-14 Thread Tomaž Vajngerl (via logerrit)
 vcl/inc/bitmap/Octree.hxx |   60 +++---
 vcl/inc/bitmap/impoctree.hxx  |   48 +--
 vcl/qa/cppunit/BitmapTest.cxx |   51 +++
 vcl/source/bitmap/Octree.cxx  |  179 --
 4 files changed, 194 insertions(+), 144 deletions(-)

New commits:
commit eb772683513f4f2b6c8e6404c29b8e477ffc7fad
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 14 16:26:29 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 14 14:19:34 2019 +0200

Octree: more clean-up, avoid memset, prefix member vars

Change-Id: I79ec1d0176f523d16c53220de9b0a0d9819729ea
Reviewed-on: https://gerrit.libreoffice.org/70729
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/inc/bitmap/Octree.hxx b/vcl/inc/bitmap/Octree.hxx
index 3e54826a9313..3336c115106f 100644
--- a/vcl/inc/bitmap/Octree.hxx
+++ b/vcl/inc/bitmap/Octree.hxx
@@ -23,9 +23,6 @@
 #include 
 #include 
 
-#define OCTREE_BITS 5
-#define OCTREE_BITS_1 10
-
 struct OctreeNode
 {
 sal_uLong nCount;
@@ -48,51 +45,33 @@ private:
 void CreatePalette(OctreeNode* pNode);
 void GetPalIndex(OctreeNode* pNode);
 
-SAL_DLLPRIVATE void ImplDeleteOctree(OctreeNode** ppNode);
-SAL_DLLPRIVATE void ImplAdd(OctreeNode** ppNode);
-SAL_DLLPRIVATE void ImplReduce();
+SAL_DLLPRIVATE void deleteOctree(OctreeNode** ppNode);
+SAL_DLLPRIVATE void add(OctreeNode** ppNode);
+SAL_DLLPRIVATE void reduce();
 
-BitmapPalette aPal;
-sal_uLong nLeafCount;
-sal_uLong nLevel;
+BitmapPalette maPalette;
+sal_uLong mnLeafCount;
+sal_uLong mnLevel;
 OctreeNode* pTree;
-OctreeNode* pReduce[OCTREE_BITS + 1];
-BitmapColor const* pColor;
-std::unique_ptr pNodeCache;
-const BitmapReadAccess* pAcc;
-sal_uInt16 nPalIndex;
+std::vector mpReduce;
+BitmapColor const* mpColor;
+std::unique_ptr mpNodeCache;
+const BitmapReadAccess* mpAccess;
+sal_uInt16 mnPalIndex;
 
 public:
 Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors);
 ~Octree();
 
-inline const BitmapPalette& GetPalette();
-inline sal_uInt16 GetBestPaletteIndex(const BitmapColor& rColor);
+const BitmapPalette& GetPalette();
+sal_uInt16 GetBestPaletteIndex(const BitmapColor& rColor);
 };
 
-inline const BitmapPalette& Octree::GetPalette()
-{
-aPal.SetEntryCount(static_cast(nLeafCount));
-nPalIndex = 0;
-CreatePalette(pTree);
-return aPal;
-}
-
-inline sal_uInt16 Octree::GetBestPaletteIndex(const BitmapColor& rColor)
-{
-pColor = &rColor;
-nPalIndex = 65535;
-nLevel = 0;
-GetPalIndex(pTree);
-return nPalIndex;
-}
-
 class VCL_PLUGIN_PUBLIC InverseColorMap
 {
 private:
-std::unique_ptr pBuffer;
-std::unique_ptr pMap;
-static constexpr sal_uLong gnBits = 8 - OCTREE_BITS;
+std::vector mpBuffer;
+std::vector mpMap;
 
 SAL_DLLPRIVATE void ImplCreateBuffers(const sal_uLong nMax);
 
@@ -100,16 +79,9 @@ public:
 explicit InverseColorMap(const BitmapPalette& rPal);
 ~InverseColorMap();
 
-inline sal_uInt16 GetBestPaletteIndex(const BitmapColor& rColor);
+sal_uInt16 GetBestPaletteIndex(const BitmapColor& rColor);
 };
 
-inline sal_uInt16 InverseColorMap::GetBestPaletteIndex(const BitmapColor& 
rColor)
-{
-return pMap[((static_cast(rColor.GetRed()) >> gnBits) << 
OCTREE_BITS_1)
-| ((static_cast(rColor.GetGreen()) >> gnBits) << 
OCTREE_BITS)
-| (static_cast(rColor.GetBlue()) >> gnBits)];
-}
-
 #endif // INCLUDED_VCL_INC_OCTREE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/bitmap/impoctree.hxx b/vcl/inc/bitmap/impoctree.hxx
index 0ade7b7bcc3b..727551123c5c 100644
--- a/vcl/inc/bitmap/impoctree.hxx
+++ b/vcl/inc/bitmap/impoctree.hxx
@@ -37,9 +37,9 @@ public:
 }
 
 ImpErrorQuad(const BitmapColor& rColor)
-: nRed(static_cast(rColor.GetRed()) << 5)
-, nGreen(static_cast(rColor.GetGreen()) << 5)
-, nBlue(static_cast(rColor.GetBlue()) << 5)
+: nRed(long(rColor.GetRed()) << 5)
+, nGreen(long(rColor.GetGreen()) << 5)
+, nBlue(long(rColor.GetBlue()) << 5)
 {
 }
 
@@ -56,54 +56,52 @@ public:
 
 inline void ImpErrorQuad::operator=(const BitmapColor& rColor)
 {
-nRed = static_cast(rColor.GetRed()) << 5;
-nGreen = static_cast(rColor.GetGreen()) << 5;
-nBlue = static_cast(rColor.GetBlue()) << 5;
+nRed = long(rColor.GetRed()) << 5;
+nGreen = long(rColor.GetGreen()) << 5;
+nBlue = long(rColor.GetBlue()) << 5;
 }
 
 inline ImpErrorQuad& ImpErrorQuad::operator-=(const BitmapColor& rColor)
 {
-nRed -= (static_cast(rColor.GetRed()) << 5);
-nGreen -= (static_cast(rColor.GetGreen()) << 5);
-nBlue -= (static_cast(rColor.GetBlue()) << 5);
+nRed -= long(rColor.GetRed()) << 5;
+nGreen -= long(rColor.GetGreen()) << 5;
+nBlue -= long(rColor.GetBlue()) << 5;
 
 return *this;
 }
 
 inline void ImpErrorQuad::ImplAddColorError1(con

[Libreoffice-commits] core.git: chart2/source sax/source sc/source sd/source svtools/source svx/source sw/source writerperfect/source

2019-04-14 Thread Mike Kaganski (via logerrit)
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |5 ++--
 sax/source/tools/converter.cxx|   16 --
 sc/source/ui/unoobj/chart2uno.cxx |   14 ++--
 sc/source/ui/view/gridwin.cxx |5 +---
 sd/source/core/drawdoc3.cxx   |6 +
 svtools/source/contnr/imivctl1.cxx|3 --
 svx/source/form/fmshimp.cxx   |8 +--
 svx/source/svdraw/charthelper.cxx |   16 ++
 sw/source/core/access/accframebase.cxx|   15 ++---
 sw/source/core/access/accpara.cxx |   15 ++---
 sw/source/uibase/app/appopt.cxx   |5 +---
 sw/source/uibase/shells/drwtxtsh.cxx  |3 --
 writerperfect/source/writer/EPUBExportDialog.cxx  |8 ---
 13 files changed, 38 insertions(+), 81 deletions(-)

New commits:
commit 6154489314d2f2bf9cb99b72f15c79dd48a1da14
Author: Mike Kaganski 
AuthorDate: Sun Apr 14 15:54:14 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 15:47:48 2019 +0200

tdf#120703 PVS: V581 ifs with identical conditions

V581 The conditional expressions of the 'if' statements situated
 alongside each other are identical.

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

diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 
b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 66a12ef6b3db..015224abecaf 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -390,10 +390,11 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
 case OBJECTTYPE_AXIS:
 {
 if( m_pParameter->HasScaleProperties() )
+{
 AddTabPage("scale", SchResId(STR_PAGE_SCALE), 
ScaleTabPage::Create);
-
-if( m_pParameter->HasScaleProperties() )//no positioning page for 
z axes so far as the tickmarks are not shown so far
+//no positioning page for z axes so far as the tickmarks are 
not shown so far
 AddTabPage("axispos", SchResId(STR_PAGE_POSITIONING), 
AxisPositionsTabPage::Create);
+}
 AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE);
 AddTabPage("axislabel", SchResId(STR_OBJECT_LABEL), 
SchAxisLabelTabPage::Create);
 if( m_pParameter->HasNumberProperties() )
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index dce277b3e464..cfd3b3083d40 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1565,10 +1565,7 @@ static bool lcl_parseDate(
 if (bSuccess)
 {
 ++nPos;
-}
 
-if (bSuccess)
-{
 bSuccess = readDateTimeComponent(string, nPos, nMonth, 2, true);
 if (!bIgnoreInvalidOrMissingDate)
 {
@@ -1584,10 +1581,7 @@ static bool lcl_parseDate(
 if (bSuccess)
 {
 ++nPos;
-}
 
-if (bSuccess)
-{
 bSuccess = readDateTimeComponent(string, nPos, nDay, 2, true);
 if (!bIgnoreInvalidOrMissingDate)
 {
@@ -1662,10 +1656,7 @@ static bool lcl_parseDateTime(
 if (bSuccess)
 {
 ++nPos;
-}
 
-if (bSuccess)
-{
 bSuccess = readDateTimeComponent(string, nPos, nMinutes, 2, true);
 bSuccess &= (0 <= nMinutes) && (nMinutes < 60);
 bSuccess &= (nPos < string.getLength()); // not last token
@@ -1677,10 +1668,7 @@ static bool lcl_parseDateTime(
 if (bSuccess)
 {
 ++nPos;
-}
 
-if (bSuccess)
-{
 bSuccess = readDateTimeComponent(string, nPos, nSeconds, 2, true);
 bSuccess &= (0 <= nSeconds) && (nSeconds < 60);
 }
@@ -1758,9 +1746,7 @@ static bool lcl_parseDateTime(
 if (bSuccess)
 {
 ++nPos;
-}
-if (bSuccess)
-{
+
 bSuccess = readDateTimeComponent(
 string, nPos, nTimezoneMinutes, 2, true);
 bSuccess &= (0 <= nTimezoneMinutes) && (nTimezoneMinutes < 60);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index e859750f4fa1..a7b20ce1e03c 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1869,23 +1869,15 @@ uno::Sequence< beans::PropertyValue > SAL_CALL 
ScChart2DataProvider::detectArgum
   beans::PropertyState_DIRECT_VALUE );
 }
 
-// DataRowSource (calculated before)
 if( bRowSourceDetected )
 {
+// DataRowSource (calculated before)
 aResult.emplace_back( "

[Libreoffice-commits] core.git: sc/qa sc/source sc/uiconfig solenv/sanitizers

2019-04-14 Thread Caolán McNamara (via logerrit)
 sc/qa/uitest/calc_tests2/consolidate.py   |9 
 sc/source/ui/dbgui/consdlg.cxx|  415 ++
 sc/source/ui/inc/consdlg.hxx  |   84 +++---
 sc/source/ui/inc/reffact.hxx  |2 
 sc/source/ui/view/reffact.cxx |4 
 sc/source/ui/view/tabvwshc.cxx|   75 ++---
 sc/uiconfig/scalc/ui/consolidatedialog.ui |  107 +++
 solenv/sanitizers/ui/modules/scalc.suppr  |6 
 8 files changed, 343 insertions(+), 359 deletions(-)

New commits:
commit c3bca577807d7cbd93ce8c66aab8798de45bef16
Author: Caolán McNamara 
AuthorDate: Sat Apr 13 19:23:23 2019 +0100
Commit: Caolán McNamara 
CommitDate: Sun Apr 14 15:54:08 2019 +0200

weld ScConsolidateDlg

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

diff --git a/sc/qa/uitest/calc_tests2/consolidate.py 
b/sc/qa/uitest/calc_tests2/consolidate.py
index 4d47d03be898..508ac7aaee83 100644
--- a/sc/qa/uitest/calc_tests2/consolidate.py
+++ b/sc/qa/uitest/calc_tests2/consolidate.py
@@ -87,14 +87,15 @@ class consolidate(UITestCase):
 xeddestarea = xDialog.getChild("eddestarea")
 xconsareas = xDialog.getChild("consareas")
 self.assertEqual(get_state_as_dict(xfunc)["SelectEntryText"], "Sum")
-self.assertEqual(get_state_as_dict(xconsareas)["EntryCount"], "3")
+self.assertEqual(get_state_as_dict(xconsareas)["Children"], "3")
 self.assertEqual(get_state_as_dict(xeddestarea)["Text"], "$Total.$A$2")
 self.assertEqual(get_state_as_dict(xbyrow)["Selected"], "true")
 self.assertEqual(get_state_as_dict(xbycol)["Selected"], "true")
 #delete first range
-select_pos(xconsareas, "0")
+xFirstEntry = xconsareas.getChild("0")
+xFirstEntry.executeAction("SELECT", tuple())
 xdelete.executeAction("CLICK", tuple())
-self.assertEqual(get_state_as_dict(xconsareas)["EntryCount"], "2")
+self.assertEqual(get_state_as_dict(xconsareas)["Children"], "2")
 xOKBtn = xDialog.getChild("ok")
 self.ui_test.close_dialog_through_button(xOKBtn)
 
@@ -120,4 +121,4 @@ class consolidate(UITestCase):
 
 self.ui_test.close_doc()
 
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index c2138dd89ffe..127d18dfde66 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -64,77 +64,48 @@ public:
 OUString  aStrArea;
 };
 
-ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, 
vcl::Window* pParent,
-const SfxItemSet&   rArgSet )
-
-:   ScAnyRefDlg ( pB, pCW, pParent, "ConsolidateDialog" , 
"modules/scalc/ui/consolidatedialog.ui" ),
-aStrUndefined   ( ScResId( SCSTR_UNDEFINED ) ),
-theConsData ( static_cast(
-   rArgSet.Get( rArgSet.GetPool()->
-GetWhich( SID_CONSOLIDATE ) )
-  ).GetData() ),
-rViewData   ( 
static_cast(SfxViewShell::Current())->
-GetViewData() ),
-pDoc( 
static_cast(SfxViewShell::Current())->
-GetViewData().GetDocument() ),
-pRangeUtil  ( new ScRangeUtil ),
-nAreaDataCount  ( 0 ),
-nWhichCons  ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) ),
-bDlgLostFocus   ( false )
+ScConsolidateDlg::ScConsolidateDlg(SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParent,
+   const SfxItemSet& rArgSet)
+
+: ScAnyRefDlgController(pB, pCW, pParent, 
"modules/scalc/ui/consolidatedialog.ui", "ConsolidateDialog")
+, aStrUndefined   ( ScResId( SCSTR_UNDEFINED ) )
+, theConsData ( static_cast(
+ rArgSet.Get( rArgSet.GetPool()->
+  GetWhich( SID_CONSOLIDATE ) )
+).GetData() )
+, rViewData   ( static_cast(SfxViewShell::Current())->
+  GetViewData() )
+, pDoc( static_cast(SfxViewShell::Current())->
+  GetViewData().GetDocument() )
+, pRangeUtil  ( new ScRangeUtil )
+, nAreaDataCount  ( 0 )
+, nWhichCons  ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) )
+, bDlgLostFocus   ( false )
+, m_xLbFunc(m_xBuilder->weld_combo_box("func"))
+, m_xLbConsAreas(m_xBuilder->weld_tree_view("consareas"))
+, m_xLbDataArea(m_xBuilder->weld_combo_box("lbdataarea"))
+, m_xEdDataArea(new 
formula::WeldRefEdit(m_xBuilder->weld_entry("eddataarea")))
+, m_xRbDataArea(new 
formula::WeldRefButton

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 cli_ure/source/climaker/climaker_emit.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 62f021814875dab64ecfc4b068f2c3b369c0987d
Author: Andrea Gelmini 
AuthorDate: Sun Apr 14 17:22:00 2019 +
Commit: Julien Nabet 
CommitDate: Sun Apr 14 19:42:21 2019 +0200

Fix typo

Change-Id: I3f4a60a977c20b2e5d380fe9dd26d80a20099c05
Reviewed-on: https://gerrit.libreoffice.org/70741
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/cli_ure/source/climaker/climaker_emit.cxx 
b/cli_ure/source/climaker/climaker_emit.cxx
index 7ce1d9f71c82..a2c77c026a72 100644
--- a/cli_ure/source/climaker/climaker_emit.cxx
+++ b/cli_ure/source/climaker/climaker_emit.cxx
@@ -1450,7 +1450,7 @@ Assembly ^ TypeEmitter::type_resolve(
 //  arAny[2] = new Any(c.Type, c.Value);
 //  return (XWeak) 
factory.createInstanceWithArgumentsAndContext("service_specifier", arAny, ctx);
 //  }
-// Notice that a any parameter is NOT wrapped by another any. Instead the new 
any is created with the type and value
+// Notice that an any parameter is NOT wrapped by another any. Instead the new 
any is created with the type and value
 // of the parameter.
 
 //  public static XWeak constructor3(XComponentContext ctx, params Any[] c)
@@ -1853,7 +1853,7 @@ Assembly ^ TypeEmitter::type_resolve(
 }
 
 
-//Check if the service instance was create and throw a exception if 
not.
+//Check if the service instance was created and threw an exception if 
not
 Emit::Label label_service_created = ilGen->DefineLabel();
 ilGen->Emit(Emit::OpCodes::Ldloc, local_return_val);
 ilGen->Emit(Emit::OpCodes::Brtrue_S, label_service_created);
@@ -2010,7 +2010,7 @@ Emit::CustomAttributeBuilder^ 
TypeEmitter::get_exception_attribute(
   ::uno::Any::typeid->GetMethod("hasValue");
 ilGen->Emit(Emit::OpCodes::Call, methodHasValue);
 
-//If not, then throw an DeploymentException
+//If not, then throw a DeploymentException
 Emit::Label label_singleton_exists = ilGen->DefineLabel();
 ilGen->Emit(Emit::OpCodes::Brtrue_S, label_singleton_exists);
 sBuilder = gcnew ::System::Text::StringBuilder(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 cli_ure/source/basetypes/uno/PolymorphicType.cs |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0811add46bfec3a2046fcde48e7e92a5921a54a1
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:05:55 2019 +
Commit: Julien Nabet 
CommitDate: Sun Apr 14 19:43:05 2019 +0200

Fix typo

Change-Id: I23e3617274c1c17b9c3792f95eaf28d9554dc2b3
Reviewed-on: https://gerrit.libreoffice.org/70740
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/cli_ure/source/basetypes/uno/PolymorphicType.cs 
b/cli_ure/source/basetypes/uno/PolymorphicType.cs
index f8a6935d6349..e996131fc6ab 100644
--- a/cli_ure/source/basetypes/uno/PolymorphicType.cs
+++ b/cli_ure/source/basetypes/uno/PolymorphicType.cs
@@ -108,7 +108,7 @@ public class PolymorphicType: Type
 if (name == null || type == null)
 throw new ArgumentNullException(
 "cli-uno: uno.PolymorphicType.GetType was called with a null 
argument");
-//check if the type is either a array of structs or a polymorphic 
struct.
+//check if the type is either an array of structs or a polymorphic 
struct.
 if (type.IsArray)
 {
 Type elementType = type;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 connectivity/source/drivers/dbase/DDatabaseMetaData.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c817db3580d3cb194c5bf75782290d1fc3c2592d
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:05:19 2019 +
Commit: Julien Nabet 
CommitDate: Sun Apr 14 19:43:44 2019 +0200

Fix typo

Change-Id: Idaf6df71470d2a838ac793bb992f979a51b1c581
Reviewed-on: https://gerrit.libreoffice.org/70739
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx 
b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index d03440e6ce33..0f40fe79ca6e 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -181,7 +181,7 @@ Reference< XResultSet > SAL_CALL 
ODbaseDatabaseMetaData::getColumns(
 {
 Reference< XColumnsSupplier> xTable(
 xNames->getByName(*pTabBegin), css::uno::UNO_QUERY);
-OSL_ENSURE(xTable.is(),"Table not found! Normally a exception 
had to be thrown here!");
+OSL_ENSURE(xTable.is(),"Table not found! Normally an exception 
had to be thrown here!");
 aRow[3] = new ORowSetValueDecorator(*pTabBegin);
 
 Reference< XNameAccess> xColumns = xTable->getColumns();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 dbaccess/source/ui/app/AppDetailPageHelper.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8aaeaa27b021b7322d0b55ab81095349bbb721e7
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:04:15 2019 +
Commit: Julien Nabet 
CommitDate: Sun Apr 14 19:44:45 2019 +0200

Fix typo

Change-Id: I1dacc900707758d83a8cc31b107511bf926f72a6
Reviewed-on: https://gerrit.libreoffice.org/70738
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx 
b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index 544548d108e2..43cb85d0ba3b 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -273,7 +273,7 @@ namespace dbaui
 
 /** adds a new object to the detail page.
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rName
 The name of the object to be inserted
 @param  _rObject
@@ -285,9 +285,9 @@ namespace dbaui
 ,const OUString& _rName
 ,const css::uno::Any& _rObject );
 
-/** replaces a objects name with a new one
+/** replaces an objects name with a new one
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rOldName
 The old name of the object to be replaced
 @param  _rNewName
@@ -301,7 +301,7 @@ namespace dbaui
 
 /** removes an element from the detail page.
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rName
 The name of the element to be removed.
 @param  _rxConn
___
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-4' - configure.ac kit/Kit.cpp loolwsd.xml.in wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp ws

2019-04-14 Thread Libreoffice Gerrit user
 configure.ac   |   35 +-
 kit/Kit.cpp|   18 ++-
 loolwsd.xml.in |3 --
 wsd/ClientSession.cpp  |2 -
 wsd/DocumentBroker.cpp |2 -
 wsd/LOOLWSD.cpp|   57 +
 wsd/LOOLWSD.hpp|7 ++
 wsd/Storage.cpp|   17 ++
 8 files changed, 65 insertions(+), 76 deletions(-)

New commits:
commit 5d2fd35bc38420c1da83cf53221a7709267b8eb4
Author: Ashod Nakashian 
AuthorDate: Sun Apr 14 12:24:45 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:32:41 2019 +0200

wsd: unify anonymization flags under one

This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.

Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/configure.ac b/configure.ac
index 5f60b3d23..cc8b85a57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,13 +55,9 @@ AC_ARG_ENABLE([debug],
   AS_HELP_STRING([--enable-debug],
  [Enable debugging, link with debugging version of 
Poco libraries]))
 
-AC_ARG_ENABLE([anonymize-usernames],
-  AS_HELP_STRING([--enable-anonymize-usernames],
- [Enable anonymization/obfuscation of usernames in 
logs]))
-
-AC_ARG_ENABLE([anonymize-filenames],
-  AS_HELP_STRING([--enable-anonymize-filenames],
- [Enable anonymization/obfuscation of filenames in 
logs]))
+AC_ARG_ENABLE([anonymization],
+  AS_HELP_STRING([--enable-anonymization],
+ [Enable anonymization/obfuscation of user-data in 
logs]))
 
 AC_ARG_ENABLE([iosapp],
   AS_HELP_STRING([--enable-iosapp],
@@ -178,8 +174,7 @@ ENABLE_DEBUG=
 LOOLWSD_LOGLEVEL="warning"
 LOOLWSD_LOG_TO_FILE="false"
 LOOLWSD_LOGFILE="/var/log/loolwsd.log"
-LOOLWSD_ANONYMIZE_FILENAMES=false
-LOOLWSD_ANONYMIZE_USERNAMES=false
+LOOLWSD_ANONYMIZE_USER_DATA=false
 LOLEAFLET_LOGGING="false"
 debug_msg="secure mode: product build"
 anonym_msg=""
@@ -189,8 +184,7 @@ if test "$enable_debug" = "yes"; then
LOOLWSD_LOGLEVEL="trace"
LOOLWSD_LOG_TO_FILE="true"
LOOLWSD_LOGFILE="/tmp/loolwsd.log"
-   LOOLWSD_ANONYMIZE_FILENAMES=false
-   LOOLWSD_ANONYMIZE_USERNAMES=false
+   LOOLWSD_ANONYMIZE_USER_DATA=false
LOLEAFLET_LOGGING="true"
debug_msg="low security debugging mode"
 else
@@ -206,22 +200,15 @@ if test -n "$with_logfile" ; then
 fi
 AC_SUBST(LOOLWSD_LOGFILE)
 
-if test "$enable_anonymize_filenames" = "yes" ; then
-   LOOLWSD_ANONYMIZE_FILENAMES=true
-   anonym_msg="filenames anonymized; "
-fi
-AC_DEFINE_UNQUOTED([LOOLWSD_ANONYMIZE_FILENAMES],[$LOOLWSD_ANONYMIZE_FILENAMES],[Enable
 permanent filenames anonymization in logs])
-AC_SUBST(LOOLWSD_ANONYMIZE_FILENAMES)
-
-if test "$enable_anonymize_usernames" = "yes" ; then
-   LOOLWSD_ANONYMIZE_USERNAMES=true
-   anonym_msg="${anonym_msg}usernames anonymized; "
+if test "$enable_anonymization" = "yes" ; then
+   LOOLWSD_ANONYMIZE_USER_DATA=true
+   anonym_msg="anonymization of user-data is enabled"
 fi
-AC_DEFINE_UNQUOTED([LOOLWSD_ANONYMIZE_USERNAMES],[$LOOLWSD_ANONYMIZE_USERNAMES],[Enable
 permanent usernames anonymization in logs])
-AC_SUBST(LOOLWSD_ANONYMIZE_USERNAMES)
+AC_DEFINE_UNQUOTED([LOOLWSD_ANONYMIZE_USER_DATA],[$LOOLWSD_ANONYMIZE_USER_DATA],[Enable
 permanent anonymization in logs])
+AC_SUBST(LOOLWSD_ANONYMIZE_USER_DATA)
 
 if test -z "$anonym_msg";  then
-  anonym_msg="no anonymization of usernames or filenames"
+  anonym_msg="anonymization of user-data is disabled"
 fi
 
 APP_NAME="LOOL"
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 228af098e..0a91009e3 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -113,8 +113,7 @@ using std::size_t;
 class Document;
 static std::shared_ptr document;
 #ifndef BUILDING_TESTS
-static bool AnonymizeFilenames = false;
-static bool AnonymizeUsernames = false;
+static bool AnonymizeUserData = false;
 static std::string ObfuscatedFileId;
 #endif
 
@@ -2139,7 +2138,7 @@ protected:
 logger << _socketName << ": recv [";
 for (const std::string& token : tokens)
 {
-// Don't log PII, there are anonymized versions that get 
logged instead.
+// Don't log user-data, there are anonymized versions that get 
logged instead.
 if (Util::startsWith(token, "jail") ||
 Util::startsWith(token, "author") ||
 Util::startsWith(token, "name") ||
@@ -2279,10 +2278,8 @@ void lokit_main(
 LOG_INF("Setting log-level to [trace] and delaying setting to 
configured [" << LogLevel << "] until after Kit initialization.");
 }
 
-AnonymizeFilenames = std::getenv("LOOL_ANONYMIZE_FILENAMES") != nullptr;
-LOG_INF("Filename anonymiza

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - common/Util.cpp common/Util.hpp kit/Kit.cpp loolwsd.xml.in test/WhiteBoxTests.cpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp

2019-04-14 Thread Libreoffice Gerrit user
 common/Util.cpp|   37 -
 common/Util.hpp|8 ++---
 kit/Kit.cpp|   13 ++--
 loolwsd.xml.in |3 +-
 test/WhiteBoxTests.cpp |   72 +++--
 wsd/LOOLWSD.cpp|8 -
 wsd/LOOLWSD.hpp|6 ++--
 7 files changed, 103 insertions(+), 44 deletions(-)

New commits:
commit 75b9ae0b41f26916833b67f5cd7e574be034de92
Author: Ashod Nakashian 
AuthorDate: Sun Apr 14 12:21:19 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:48:07 2019 +0200

wsd: improved anonymization algorithm

Better hashing algorithm based on FNV-1a.
Adds support for salting the hash, and
for providing salt via configuration.

More unit-tests added, and better formatting.

Change-Id: I2be42675d0cdbaa73c3d7faed99e07631a9c20fc
Reviewed-on: https://gerrit.libreoffice.org/70034
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/common/Util.cpp b/common/Util.cpp
index 048526a49..a27ed5a22 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -274,16 +274,16 @@ namespace Util
 return true;
 }
 
-std::string encodeId(const unsigned number, const int padding)
+std::string encodeId(const std::uint64_t number, const int padding)
 {
 std::ostringstream oss;
 oss << std::hex << std::setw(padding) << std::setfill('0') << number;
 return oss.str();
 }
 
-unsigned decodeId(const std::string& str)
+std::uint64_t decodeId(const std::string& str)
 {
-unsigned id = 0;
+std::uint64_t id = 0;
 std::stringstream ss;
 ss << std::hex << str;
 ss >> id;
@@ -651,7 +651,7 @@ namespace Util
 }
 
 static std::map AnonymizedStrings;
-static std::atomic AnonymizationSalt(0);
+static std::atomic AnonymizationCounter(0);
 static std::mutex AnonymizedMutex;
 
 void mapAnonymized(const std::string& plain, const std::string& anonymized)
@@ -666,7 +666,7 @@ namespace Util
 AnonymizedStrings[plain] = anonymized;
 }
 
-std::string anonymize(const std::string& text)
+std::string anonymize(const std::string& text, const std::uint64_t 
nAnonymizationSalt)
 {
 {
 std::unique_lock lock(AnonymizedMutex);
@@ -679,15 +679,26 @@ namespace Util
 }
 }
 
-// We just need something irreversible, short, and
-// quite simple.
-std::size_t hash = 0;
+// Modified 64-bit FNV-1a to add salting.
+// For the algorithm and the magic numbers, see 
http://isthe.com/chongo/tech/comp/fnv/
+std::uint64_t hash = 0xCBF29CE484222325LL;
+hash ^= nAnonymizationSalt;
+hash *= 0x10001b3ULL;
 for (const char c : text)
-hash += c;
+{
+hash ^= static_cast(c);
+hash *= 0x10001b3ULL;
+}
+
+hash ^= nAnonymizationSalt;
+hash *= 0x10001b3ULL;
 
 // Generate the anonymized string. The '#' is to hint that it's 
anonymized.
-// Prepend with salt to make it unique, in case we get collisions 
(which we will, eventually).
-const std::string res = '#' + Util::encodeId(AnonymizationSalt++, 0) + 
'#' + Util::encodeId(hash, 0) + '#';
+// Prepend with count to make it unique within a single process 
instance,
+// in case we get collisions (which we will, eventually). N.B.: 
Identical
+// strings likely to have different prefixes when logged in WSD 
process vs. Kit.
+const std::string res
+= '#' + Util::encodeId(AnonymizationCounter++, 0) + '#' + 
Util::encodeId(hash, 0) + '#';
 mapAnonymized(text, res);
 return res;
 }
@@ -702,7 +713,7 @@ namespace Util
 return filename;
 }
 
-std::string anonymizeUrl(const std::string& url)
+std::string anonymizeUrl(const std::string& url, const std::uint64_t 
nAnonymizationSalt)
 {
 std::string base;
 std::string filename;
@@ -710,7 +721,7 @@ namespace Util
 std::string params;
 std::tie(base, filename, ext, params) = Util::splitUrl(url);
 
-return base + Util::anonymize(filename) + ext + params;
+return base + Util::anonymize(filename, nAnonymizationSalt) + ext + 
params;
 }
 }
 
diff --git a/common/Util.hpp b/common/Util.hpp
index 07af2a6a4..5bf6d9d03 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -67,9 +67,9 @@ namespace Util
 /// Hex to unsigned char
 bool dataFromHexString(const std::string& hexString, std::vector& data);
 /// Encode an integral ID into a string, with padding support.
-std::string encodeId(const unsigned number, const int padding = 5);
+std::string encodeId(const std::uint64_t number, const int padding = 5);
 /// Decode an integral ID from a string.
-unsigned decodeId(const std::string& str);
+std::uint64_t decodeId(const std::stri

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - net/WebSocketHandler.hpp

2019-04-14 Thread Libreoffice Gerrit user
 net/WebSocketHandler.hpp |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit cddfed161207e86c4e0259b933db7d063dc2e36d
Author: Ashod Nakashian 
AuthorDate: Sun Mar 31 23:30:05 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:48:35 2019 +0200

wsd: formatting

Change-Id: I07b91c494fe89395ebe1e91506baef46dc03aca8
Reviewed-on: https://gerrit.libreoffice.org/70035
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index a037cb6b5..4152f8999 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -187,11 +187,13 @@ public:
 
 if (payloadLen + headerLen > len)
 { // partial read wait for more data.
-LOG_TRC("#" << socket->getFD() << ": Still incomplete WebSocket 
message, have " << len << " bytes, message is " << payloadLen + headerLen << " 
bytes");
+LOG_TRC("#" << socket->getFD() << ": Still incomplete WebSocket 
message, have " << len
+<< " bytes, message is " << payloadLen + headerLen << 
" bytes");
 return false;
 }
 
-LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket data of " << 
len << " bytes: " << Util::stringifyHexLine(socket->getInBuffer(), 0, 
std::min((size_t)32, len)));
+LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket data of " << 
len << " bytes: "
+<< Util::stringifyHexLine(socket->getInBuffer(), 0, 
std::min((size_t)32, len)));
 
 data = p + headerLen;
 
@@ -213,14 +215,16 @@ public:
 
 assert(_wsPayload.size() >= payloadLen);
 
-socket->getInBuffer().erase(socket->getInBuffer().begin(), 
socket->getInBuffer().begin() + headerLen + payloadLen);
+socket->getInBuffer().erase(socket->getInBuffer().begin(),
+socket->getInBuffer().begin() + headerLen 
+ payloadLen);
 
 #ifndef MOBILEAPP
 
 // FIXME: fin, aggregating payloads into _wsPayload etc.
-LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket message code " 
<< static_cast(code) <<
-", fin? " << fin << ", mask? " << hasMask << ", payload 
length: " << _wsPayload.size() <<
-", residual socket data: " << socket->getInBuffer().size() << 
" bytes.");
+LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket message code "
+<< static_cast(code) << ", fin? " << fin << ", 
mask? " << hasMask
+<< ", payload length: " << _wsPayload.size()
+<< ", residual socket data: " << 
socket->getInBuffer().size() << " bytes.");
 
 bool doClose = false;
 
@@ -607,8 +611,9 @@ protected:
 responseSize = itBody - socket->getInBuffer().begin() + 
marker.size();
 }
 
-if (response.getStatus() == 
Poco::Net::HTTPResponse::HTTP_SWITCHING_PROTOCOLS &&
-response.has("Upgrade") && 
Poco::icompare(response.get("Upgrade"), "websocket") == 0)
+if (response.getStatus() == 
Poco::Net::HTTPResponse::HTTP_SWITCHING_PROTOCOLS
+&& response.has("Upgrade")
+&& Poco::icompare(response.get("Upgrade"), "websocket") == 0)
 {
 #if 0 // SAL_DEBUG ...
 const std::string wsKey = response.get("Sec-WebSocket-Accept", 
"");
___
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-4' - common/Util.cpp wsd/ClientSession.cpp

2019-04-14 Thread Libreoffice Gerrit user
 common/Util.cpp   |8 ++--
 wsd/ClientSession.cpp |2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 7b5d10a69ad29c771c5dd5e02e4230cc2f2d31af
Author: Michael Meeks 
AuthorDate: Fri Mar 15 10:51:19 2019 +0100
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:52:40 2019 +0200

Anonymization: don't log when it is disabled.

Also fix unexpected concatenation error in Poco::URI::encode generating
eg. authorid=localhost0 xauthorid=localhost0localhost0 in the output.

Change-Id: I560e47e31884eeb1c662f468436ed7541cfb082d
Reviewed-on: https://gerrit.libreoffice.org/69299
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/common/Util.cpp b/common/Util.cpp
index a27ed5a22..caea764a4 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -659,7 +659,9 @@ namespace Util
 if (plain.empty() || anonymized.empty())
 return;
 
-LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << "].");
+auto &log = Log::logger();
+if (log.trace() && plain != anonymized)
+LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << 
"].");
 
 std::unique_lock lock(AnonymizedMutex);
 
@@ -674,7 +676,9 @@ namespace Util
 const auto it = AnonymizedStrings.find(text);
 if (it != AnonymizedStrings.end())
 {
-LOG_TRC("Found anonymized [" << text << "] -> [" << it->second 
<< "].");
+auto &log = Log::logger();
+if (log.trace() && text != it->second)
+LOG_TRC("Found anonymized [" << text << "] -> [" << 
it->second << "].");
 return it->second;
 }
 }
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 7cd98ae69..efbac7dab 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -420,12 +420,14 @@ bool ClientSession::loadDocument(const char* /*buffer*/, 
int /*length*/,
 std::string encodedUserId;
 Poco::URI::encode(getUserId(), "", encodedUserId);
 oss << " authorid=" << encodedUserId;
+encodedUserId = "";
 Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserId()), "", 
encodedUserId);
 oss << " xauthorid=" << encodedUserId;
 
 std::string encodedUserName;
 Poco::URI::encode(getUserName(), "", encodedUserName);
 oss << " author=" << encodedUserName;
+encodedUserName = "";
 Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserName()), "", 
encodedUserName);
 oss << " xauthor=" << encodedUserName;
 }
___
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-4' - common/Util.cpp

2019-04-14 Thread Libreoffice Gerrit user
 common/Util.cpp |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit aac0708fe85d98cc320ad735e9379537e13798e5
Author: Ashod Nakashian 
AuthorDate: Sun Apr 14 14:14:12 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:56:07 2019 +0200

wsd: Use unordered map for anonymization

And simplify the trace-logging enablement check.

Change-Id: I4f5c9e08912b8dbc708b191b80032660ce4e1ba0
Reviewed-on: https://gerrit.libreoffice.org/70742
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/common/Util.cpp b/common/Util.cpp
index caea764a4..b0b870605 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -650,7 +651,7 @@ namespace Util
 return std::make_tuple(base, filename, ext, params);
 }
 
-static std::map AnonymizedStrings;
+static std::unordered_map AnonymizedStrings;
 static std::atomic AnonymizationCounter(0);
 static std::mutex AnonymizedMutex;
 
@@ -659,8 +660,7 @@ namespace Util
 if (plain.empty() || anonymized.empty())
 return;
 
-auto &log = Log::logger();
-if (log.trace() && plain != anonymized)
+if (Log::traceEnabled() && plain != anonymized)
 LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << 
"].");
 
 std::unique_lock lock(AnonymizedMutex);
@@ -676,8 +676,7 @@ namespace Util
 const auto it = AnonymizedStrings.find(text);
 if (it != AnonymizedStrings.end())
 {
-auto &log = Log::logger();
-if (log.trace() && text != it->second)
+if (Log::traceEnabled() && text != it->second)
 LOG_TRC("Found anonymized [" << text << "] -> [" << 
it->second << "].");
 return it->second;
 }
___
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-4' - tools/Config.cpp

2019-04-14 Thread Libreoffice Gerrit user
 tools/Config.cpp |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit fdb6578770cf35a5612e450b0b0dec9513c20bbd
Author: Ashod Nakashian 
AuthorDate: Mon Apr 1 00:13:03 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sun Apr 14 20:58:15 2019 +0200

looltool: support anonymizing strings

The user is able to override the salt,
or use the one from the config file.

Change-Id: Ida634374549fb490ec2437f557d46c44d4760c56
Reviewed-on: https://gerrit.libreoffice.org/70036
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/tools/Config.cpp b/tools/Config.cpp
index 0e2505283..0f79ea3a6 100644
--- a/tools/Config.cpp
+++ b/tools/Config.cpp
@@ -65,6 +65,8 @@ public:
 static std::string ConfigFile;
 static std::string SupportKeyString;
 static bool SupportKeyStringProvided;
+static std::uint64_t AnonymizationSalt;
+static bool AnonymizationSaltProvided;
 
 protected:
 void defineOptions(OptionSet&) override;
@@ -82,6 +84,8 @@ std::string Config::ConfigFile =
 
 std::string Config::SupportKeyString;
 bool Config::SupportKeyStringProvided = false;
+std::uint64_t Config::AnonymizationSalt = 0;
+bool Config::AnonymizationSaltProvided = false;
 
 void Config::displayHelp()
 {
@@ -98,6 +102,7 @@ void Config::displayHelp()
 // Command list
 std::cout << std::endl
   << "Commands: " << std::endl
+  << "anonymize [string-1]...[string-n]" << std::endl
   << "set-admin-password" << std::endl
 #if ENABLE_SUPPORT_KEY
   << "set-support-key" << std::endl
@@ -137,6 +142,11 @@ void Config::defineOptions(OptionSet& optionSet)
 .repeatable(false)
 .argument("key"));
 #endif
+
+optionSet.addOption(Option("anonymization-salt", "", "Anonymize strings 
with the given 64-bit salt instead of the one in the config file.")
+.required(false)
+.repeatable(false)
+.argument("salt"));
 }
 
 void Config::handleOption(const std::string& optionName, const std::string& 
optionValue)
@@ -186,6 +196,12 @@ void Config::handleOption(const std::string& optionName, 
const std::string& opti
 SupportKeyString = optionValue;
 SupportKeyStringProvided = true;
 }
+else if (optionName == "anonymization-salt")
+{
+AnonymizationSalt = std::stoull(optionValue);
+AnonymizationSaltProvided = true;
+std::cout << "Anonymization Salt: [" << AnonymizationSalt << "]." << 
std::endl;
+}
 }
 
 int Config::main(const std::vector& args)
@@ -344,6 +360,20 @@ int Config::main(const std::vector& args)
 if (retval != 0)
 std::cerr << "Error when executing command." << std::endl;
 }
+else if (args[0] == "anonymize")
+{
+if (!AnonymizationSaltProvided)
+{
+const std::string val = 
_loolConfig.getString("logging.anonymize.anonymization_salt");
+AnonymizationSalt = std::stoull(val);
+std::cout << "Anonymization Salt: [" << AnonymizationSalt << "]." 
<< std::endl;
+}
+
+for (std::size_t i = 1; i < args.size(); ++i)
+{
+std::cout << "[" << args[i] << "]: " << 
Util::anonymizeUrl(args[i], AnonymizationSalt) << std::endl;
+}
+}
 else
 {
 std::cerr << "No such command, \"" << args[0]  << "\"" << std::endl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Infra call on Tue, Apr 16 at 16:30 UTC

2019-04-14 Thread Guilhem Moulin
Hi there,

The next infra call will take place at `date -d "Tue Apr 16 16:30:00 UTC 2019"`
(18:30:00 Berlin time).

We'll meet at https://jitsi.documentfoundation.org/infra and write the minutes
to https://pad.documentfoundation.org/p/infra .  Agenda TBA.

See you there!
Cheers,
-- 
Guilhem.


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

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

2019-04-14 Thread Tomaž Vajngerl (via logerrit)
 vcl/inc/bitmap/impoctree.hxx |   35 -
 vcl/source/bitmap/Octree.cxx |   60 +++
 2 files changed, 44 insertions(+), 51 deletions(-)

New commits:
commit 36679103fb538f514416768027636c9d484866b1
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 14 23:33:43 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 15 01:57:07 2019 +0200

move ImpNodeCache into Octree.cxx and clean-up

ImpNodeCache is specific to Octree so it's best that it lives
near the source.

Change-Id: I35e937343312b0ab18ed1a4dcaa067ea01a0191f
Reviewed-on: https://gerrit.libreoffice.org/70736
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/vcl/inc/bitmap/impoctree.hxx b/vcl/inc/bitmap/impoctree.hxx
index 727551123c5c..06fbd69249d0 100644
--- a/vcl/inc/bitmap/impoctree.hxx
+++ b/vcl/inc/bitmap/impoctree.hxx
@@ -104,41 +104,6 @@ inline BitmapColor ImpErrorQuad::ImplGetColor()
std::clamp(nBlue, 0L, 8160L) >> 5);
 }
 
-class ImpNodeCache
-{
-OctreeNode* pActNode;
-
-public:
-ImpNodeCache(const sal_uLong nInitSize);
-~ImpNodeCache();
-
-inline OctreeNode* ImplGetFreeNode();
-inline void ImplReleaseNode(OctreeNode* pNode);
-};
-
-inline OctreeNode* ImpNodeCache::ImplGetFreeNode()
-{
-OctreeNode* pNode;
-
-if (!pActNode)
-{
-pActNode = new OctreeNode;
-pActNode->pNextInCache = nullptr;
-}
-
-pNode = pActNode;
-pActNode = pNode->pNextInCache;
-memset(pNode, 0, sizeof(OctreeNode));
-
-return pNode;
-}
-
-inline void ImpNodeCache::ImplReleaseNode(OctreeNode* pNode)
-{
-pNode->pNextInCache = pActNode;
-pActNode = pNode;
-}
-
 #endif // INCLUDED_VCL_INC_IMPOCTREE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/bitmap/Octree.cxx b/vcl/source/bitmap/Octree.cxx
index 5f291e6ab8fb..592d17c1d469 100644
--- a/vcl/source/bitmap/Octree.cxx
+++ b/vcl/source/bitmap/Octree.cxx
@@ -23,7 +23,6 @@
 #include 
 
 #include 
-#include 
 
 namespace
 {
@@ -34,30 +33,59 @@ constexpr sal_uLong gnBits = 8 - OCTREE_BITS;
 
 } // end anonymous namespace
 
-ImpNodeCache::ImpNodeCache(const sal_uLong nInitSize)
-: pActNode(nullptr)
+class ImpNodeCache
 {
-const sal_uLong nSize = nInitSize + 4;
+private:
+OctreeNode* mpActNode;
 
-for (sal_uLong i = 0; i < nSize; i++)
+public:
+ImpNodeCache(const sal_uLong nInitSize)
+: mpActNode(nullptr)
 {
-OctreeNode* pNewNode = new OctreeNode;
+const sal_uLong nSize = nInitSize + 4;
 
-pNewNode->pNextInCache = pActNode;
-pActNode = pNewNode;
+for (sal_uLong i = 0; i < nSize; i++)
+{
+OctreeNode* pNewNode = new OctreeNode;
+
+pNewNode->pNextInCache = mpActNode;
+mpActNode = pNewNode;
+}
 }
-}
 
-ImpNodeCache::~ImpNodeCache()
-{
-while (pActNode)
+~ImpNodeCache()
 {
-OctreeNode* pNode = pActNode;
+while (mpActNode)
+{
+OctreeNode* pNode = mpActNode;
 
-pActNode = pNode->pNextInCache;
-delete pNode;
+mpActNode = pNode->pNextInCache;
+delete pNode;
+}
 }
-}
+
+OctreeNode* ImplGetFreeNode()
+{
+OctreeNode* pNode;
+
+if (!mpActNode)
+{
+mpActNode = new OctreeNode;
+mpActNode->pNextInCache = nullptr;
+}
+
+pNode = mpActNode;
+mpActNode = pNode->pNextInCache;
+memset(pNode, 0, sizeof(OctreeNode));
+
+return pNode;
+}
+void ImplReleaseNode(OctreeNode* pNode)
+{
+pNode->pNextInCache = mpActNode;
+mpActNode = pNode;
+}
+};
 
 Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors)
 : mnLeafCount(0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/vcl solenv/clang-format

2019-04-14 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/BitmapBuffer.hxx  |   48 +++
 include/vcl/BitmapColor.hxx   |  226 +
 include/vcl/BitmapPalette.hxx |  136 ++
 include/vcl/ColorMask.hxx |  207 +++
 include/vcl/Scanline.hxx  |   68 +
 include/vcl/salbtype.hxx  |  546 --
 solenv/clang-format/blacklist |5 
 7 files changed, 695 insertions(+), 541 deletions(-)

New commits:
commit e9651c2509004e2113864e15d74b8637966083ab
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 15 00:08:12 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 15 01:57:27 2019 +0200

break up classes in salbtype into own files

But still keep salbtype where all of them are included for now.

Change-Id: I54cdf7a8872ad5bb592402a4bce0f3b8f869c6b2
Reviewed-on: https://gerrit.libreoffice.org/70737
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx
new file mode 100644
index ..2a064951c447
--- /dev/null
+++ b/include/vcl/BitmapBuffer.hxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_BITMAPBUFFER_HXX
+#define INCLUDED_VCL_BITMAPBUFFER_HXX
+
+#include 
+#include 
+#include 
+#include 
+
+struct SalTwoRect;
+
+struct VCL_DLLPUBLIC BitmapBuffer
+{
+ScanlineFormat   mnFormat;
+longmnWidth;
+longmnHeight;
+longmnScanlineSize;
+sal_uInt16  mnBitCount;
+ColorMask   maColorMask;
+BitmapPalette   maPalette;
+sal_uInt8*  mpBits;
+};
+
+VCL_DLLPUBLIC std::unique_ptr StretchAndConvert(
+const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
+ScanlineFormat nDstBitmapFormat, const BitmapPalette* pDstPal = nullptr, 
const ColorMask* pDstMask = nullptr );
+
+#endif // INCLUDED_VCL_BITMAPBUFFER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/BitmapColor.hxx b/include/vcl/BitmapColor.hxx
new file mode 100644
index ..7df493e7b38d
--- /dev/null
+++ b/include/vcl/BitmapColor.hxx
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_BITMAPCOLOR_HXX
+#define INCLUDED_VCL_BITMAPCOLOR_HXX
+
+#include 
+#include 
+#include 
+
+class VCL_DLLPUBLIC BitmapColor final
+{
+private:
+sal_uInt8 mcBlueOrIndex;
+sal_uInt8 mcGreen;
+sal_uInt8 mcRed;
+sal_uInt8 mcAlpha;
+
+public:
+
+inline  BitmapColor();
+constexpr   BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, 
sal_uInt8 cBlue, sal_uInt8 cAlpha = 0 );
+
+inline  BitmapColor( const Color& rColor );
+explicit inline BitmapColor( sal_uInt8 cIndex );
+
+inline bool operator==( const BitmapColor& rBitmapColor ) const;
+inline bool operator!=( const BitmapColor& rBitmapColor ) const;
+
+inline sal_uInt8GetRed() const;
+inline void SetRed( sal_uInt8 cRed );
+
+inline sal_uInt8GetGreen() const;
+inline void SetGreen( sal_uInt8 cGreen );
+
+inline sal_uInt8GetBlue() const;
+inline void SetBlue( sal_uInt8 cBlue );
+
+inline sal_uInt8GetIndex() const;
+inline void SetInd

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/qa desktop/source include/LibreOfficeKit include/vcl sd/source

2019-04-14 Thread Ashod Nakashian (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |3 +
 desktop/source/lib/init.cxx  |   20 +++
 include/LibreOfficeKit/LibreOfficeKit.h  |3 +
 include/LibreOfficeKit/LibreOfficeKit.hxx|7 
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 -
 include/vcl/ITiledRenderable.hxx |8 
 sd/source/ui/inc/DrawViewShell.hxx   |2 +
 sd/source/ui/inc/unomodel.hxx|3 +
 sd/source/ui/unoidl/unomodel.cxx |9 +
 sd/source/ui/view/drviews1.cxx   |   46 +++
 10 files changed, 101 insertions(+), 2 deletions(-)

New commits:
commit 6597c9be98b5058c028e980cfc6681a7fd09147d
Author: Ashod Nakashian 
AuthorDate: Tue Sep 11 08:11:47 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:30:30 2019 +0200

slide-sorter: multiple selection

Change-Id: I8624de25b0bb66020002890f33758e52059a24ab
Reviewed-on: https://gerrit.libreoffice.org/69610
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 691a82bcc4cb..7fe2cc41f2a0 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2668,9 +2668,10 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(46), offsetof(struct 
_LibreOfficeKitDocumentClass, renderShapeSelection));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(47), offsetof(struct 
_LibreOfficeKitDocumentClass, createViewWithOptions));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(48), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowGestureEvent));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), offsetof(struct 
_LibreOfficeKitDocumentClass, selectPart));
 // Extending is fine, update this, and add new assert for the offsetof the
 // new method
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1d21b994289d..c70b6d97dd29 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -683,6 +683,7 @@ static int doc_getParts(LibreOfficeKitDocument* pThis);
 static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis);
 static int doc_getPart(LibreOfficeKitDocument* pThis);
 static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart);
+static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int 
nSelect);
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart);
 static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode);
 static void doc_paintTile(LibreOfficeKitDocument* pThis,
@@ -833,6 +834,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
getPartPageRectangles = doc_getPartPageRectangles;
 m_pDocumentClass->getPart = doc_getPart;
 m_pDocumentClass->setPart = doc_setPart;
+m_pDocumentClass->selectPart = doc_selectPart;
 m_pDocumentClass->getPartName = doc_getPartName;
 m_pDocumentClass->setPartMode = doc_setPartMode;
 m_pDocumentClass->paintTile = doc_paintTile;
@@ -2247,6 +2249,22 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* 
pThis, int nPart)
 return pMemory;
 }
 
+static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int 
nSelect)
+{
+SolarMutexGuard aGuard;
+if (gImpl)
+gImpl->maLastExceptionMsg.clear();
+
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return;
+}
+
+pDoc->selectPart( nPart, nSelect );
+}
+
 static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
@@ -2604,6 +2622,8 @@ static void 
doc_initializeForRendering(LibreOfficeKitDocument* pThis,
 if (pDoc)
 {
 doc_iniUnoCommands();
+// Create the SlideSorter which is used for multiselection and 
reordering.
+doc_postUnoCommand(pThis, ".uno:LeftPaneImpress", nullptr, false);
 pDoc->initializeForTiledRendering(
 
comphelper::containerToSequence(jsonToPropertyValuesVector(pArguments)));
 }
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 8a044b337e6d..3cb204614f7c 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -360,6 +360,9 @@ struct _LibreOfficeKitDocumentClass
   int nY,
   int nOffset);
 
+/// @see lok::Document::selectPart().
+void (*selectPart) (LibreOfficeKitDocument* pThis, int nPart, int nSelect);
+
 #en

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - include/vcl sc/source sd/source

2019-04-14 Thread Ashod Nakashian (via logerrit)
 include/vcl/ITiledRenderable.hxx|3 -
 sc/source/ui/unoobj/docuno.cxx  |6 +-
 sd/source/ui/inc/DrawViewShell.hxx  |6 ++
 sd/source/ui/inc/unomodel.hxx   |3 -
 sd/source/ui/slidesorter/controller/SlsPageSelector.cxx |   11 +++-
 sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx |   13 +++-
 sd/source/ui/unoidl/unomodel.cxx|   18 ++
 sd/source/ui/view/drviews1.cxx  |   32 +---
 8 files changed, 77 insertions(+), 15 deletions(-)

New commits:
commit a3c8895563833a1d46850cb5cca38765d4f4bedb
Author: Ashod Nakashian 
AuthorDate: Sun Sep 16 17:25:01 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:31:46 2019 +0200

LOK: getPartInfo now returns list of selected parts

For spreadsheets, selected parts are still unimplemented,
so returns false for all.
For presentations, visible parts seem to be always
return false at load time.

Change-Id: I90c79617f88deec98849bb374ca0ba177cd9c9af
Reviewed-on: https://gerrit.libreoffice.org/69611
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index ff89f6dd26b9..42d823e734f2 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -312,7 +312,8 @@ public:
 }
 
 /*
- * Used for sheets in spreadsheet documents.
+ * Used for sheets in spreadsheet documents,
+ * and slides in presentation documents.
  */
 virtual OUString getPartInfo(int /*nPart*/)
 {
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index d23c3f081636..3a651dd9b6c0 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -538,10 +538,14 @@ OUString ScModelObj::getPartInfo( int nPart )
 {
 OUString aPartInfo;
 ScViewData* pViewData = ScDocShell::GetViewData();
-bool bIsVisible = pViewData->GetDocument()->IsVisible(nPart);
+const bool bIsVisible = pViewData->GetDocument()->IsVisible(nPart);
+//FIXME: Implement IsSelected().
+const bool bIsSelected = false; 
//pViewData->GetDocument()->IsSelected(nPart);
 
 aPartInfo += "{ \"visible\": \"";
 aPartInfo += OUString::number(static_cast(bIsVisible));
+aPartInfo += "\", \"selected\": \"";
+aPartInfo += OUString::number(static_cast(bIsSelected));
 aPartInfo += "\" }";
 return aPartInfo;
 }
diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index bda391f71858..7a21340e128f 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -245,7 +245,13 @@ public:
 boolSwitchPage(sal_uInt16 nPage);
 boolIsSwitchPageAllowed() const;
 
+/**
+ * Mark the desired page as selected (1), deselected (0), toggle (2).
+ * nPage refers to the page in question.
+ */
 boolSelectPage(sal_uInt16 nPage, sal_uInt16 nSelect);
+boolIsSelected(sal_uInt16 nPage);
+boolIsVisible(sal_uInt16 nPage);
 
 voidGotoBookmark(const OUString& rBookmark);
 //Realize multi-selection of objects, If object is marked, the
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 054f7ffa8b9a..993749bbcb3d 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -267,7 +267,8 @@ public:
 virtual OUString getPostIts() override;
 /// @see vcl::ITiledRenderable::selectPart().
 virtual void selectPart(int nPart, int nSelect) override;
-
+/// @see vcl::ITiledRenderable::getPartInfo().
+virtual OUString getPartInfo(int nPart) override;
 
 // XComponent
 
diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx 
b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
index 1115d05227a9..544068f151b6 100644
--- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
@@ -216,7 +216,7 @@ void PageSelector::CheckConsistency() const
 }
 }
 
-bool PageSelector::IsPageSelected (int nPageIndex)
+bool PageSelector::IsPageSelected(int nPageIndex)
 {
 SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
 if (pDescriptor.get() != nullptr)
@@ -225,6 +225,15 @@ bool PageSelector::IsPageSelected (int nPageIndex)
 return false;
 }
 
+bool PageSelector::IsPageVisible(int nPageIndex)
+{
+SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
+if (pDescriptor.get() != nullptr)
+return pDescriptor->HasState(PageDescriptor::ST_Visible);
+else
+return false;
+}
+
 int PageSelector::GetPageCount() const
 {
 return mrModel.GetPageCount();
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx 
b/sd/

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/qa desktop/source include/LibreOfficeKit include/vcl sd/source

2019-04-14 Thread Ashod Nakashian (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |3 ++-
 desktop/source/lib/init.cxx |   18 ++
 include/LibreOfficeKit/LibreOfficeKit.h |3 +++
 include/LibreOfficeKit/LibreOfficeKit.hxx   |8 
 include/vcl/ITiledRenderable.hxx|6 ++
 sd/source/ui/inc/unomodel.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx|7 +++
 7 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit 3c9660f99e477436348ff5a4afed423ff2888df5
Author: Ashod Nakashian 
AuthorDate: Sun Sep 16 17:27:35 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:32:45 2019 +0200

LOK: support for ordering/moving parts

Currently reordering of slides is only supported
for presentations, although it is provisioned for
spreadsheets as well.

Change-Id: I6c35066d6a5ef7586d34a8e8b89db69a20b86572
Reviewed-on: https://gerrit.libreoffice.org/69612
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 7fe2cc41f2a0..a952dcd0a0a0 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2669,9 +2669,10 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(47), offsetof(struct 
_LibreOfficeKitDocumentClass, createViewWithOptions));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(48), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowGestureEvent));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), offsetof(struct 
_LibreOfficeKitDocumentClass, selectPart));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), offsetof(struct 
_LibreOfficeKitDocumentClass, moveSelectedParts));
 // Extending is fine, update this, and add new assert for the offsetof the
 // new method
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(51), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c70b6d97dd29..26f3f585ade9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -684,6 +684,7 @@ static char* 
doc_getPartPageRectangles(LibreOfficeKitDocument* pThis);
 static int doc_getPart(LibreOfficeKitDocument* pThis);
 static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart);
 static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int 
nSelect);
+static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int 
nPosition, bool bDuplicate);
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart);
 static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode);
 static void doc_paintTile(LibreOfficeKitDocument* pThis,
@@ -835,6 +836,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
getPart = doc_getPart;
 m_pDocumentClass->setPart = doc_setPart;
 m_pDocumentClass->selectPart = doc_selectPart;
+m_pDocumentClass->moveSelectedParts = doc_moveSelectedParts;
 m_pDocumentClass->getPartName = doc_getPartName;
 m_pDocumentClass->setPartMode = doc_setPartMode;
 m_pDocumentClass->paintTile = doc_paintTile;
@@ -2265,6 +2267,22 @@ static void doc_selectPart(LibreOfficeKitDocument* 
pThis, int nPart, int nSelect
 pDoc->selectPart( nPart, nSelect );
 }
 
+static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int 
nPosition, bool bDuplicate)
+{
+SolarMutexGuard aGuard;
+if (gImpl)
+gImpl->maLastExceptionMsg.clear();
+
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return;
+}
+
+pDoc->moveSelectedParts(nPosition, bDuplicate);
+}
+
 static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 3cb204614f7c..4c3f0507e88b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -363,6 +363,9 @@ struct _LibreOfficeKitDocumentClass
 /// @see lok::Document::selectPart().
 void (*selectPart) (LibreOfficeKitDocument* pThis, int nPart, int nSelect);
 
+/// @see lok::Document::moveSelectedParts().
+void (*moveSelectedParts) (LibreOfficeKitDocument* pThis, int nPosition, 
bool bDuplicate);
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 3aadd72564a9..6f24ba0adcc5 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -628,6 +628,14 @@ public:
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/source sd/source

2019-04-14 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx  |2 --
 sd/source/ui/unoidl/unomodel.cxx |   11 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0446a69570ae8dc15b9f7a8f8325790953640140
Author: Ashod Nakashian 
AuthorDate: Sun Nov 11 23:37:24 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:33:36 2019 +0200

LOK: sd: initialize slide-sorter in sd

Change-Id: I4cb6ce6d961b4ba4d542c14cb37370788cf75e45
Reviewed-on: https://gerrit.libreoffice.org/69613
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 26f3f585ade9..5010fe406c1e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2640,8 +2640,6 @@ static void 
doc_initializeForRendering(LibreOfficeKitDocument* pThis,
 if (pDoc)
 {
 doc_iniUnoCommands();
-// Create the SlideSorter which is used for multiselection and 
reordering.
-doc_postUnoCommand(pThis, ".uno:LeftPaneImpress", nullptr, false);
 pDoc->initializeForTiledRendering(
 
comphelper::containerToSequence(jsonToPropertyValuesVector(pArguments)));
 }
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index fe0c82d9309a..96ba362c3c7b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -32,6 +32,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -2511,6 +2512,16 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence 
aPropertyValuesVector({aSynchronMode});
+
+// Create the SlideSorter which is used for multiselection and reordering.
+static const OUString aLeftPaneCommand(".uno:LeftPaneImpress");
+comphelper::dispatchCommand(aLeftPaneCommand, 
comphelper::containerToSequence(aPropertyValuesVector));
 }
 
 void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/qa sd/qa

2019-04-14 Thread Ashod Nakashian (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |2 
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  116 ++-
 2 files changed, 112 insertions(+), 6 deletions(-)

New commits:
commit 72da60a4fac5657de69c0651dd8e0a94fcc49b97
Author: Ashod Nakashian 
AuthorDate: Tue Nov 20 11:34:23 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:34:28 2019 +0200

sd: fix unittest failures due to enabling slide-sorter

Change-Id: Ife85b3c728c59f7fb4e0184211efc9b652c5f4e7
Reviewed-on: https://gerrit.libreoffice.org/69615
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index a952dcd0a0a0..ef83adc8f3e3 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1896,8 +1896,6 @@ void DesktopLOKTest::testPaintPartTile()
 //CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 
 mxComponent.clear();
-
-comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testWriterCommentInsertCursor()
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 1765db27be7d..04d2326cfd96 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2086,6 +2086,55 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
 SdXImpressDocument* pXImpressDocument = 
createDoc("paste_text_onslide.odp");
 CPPUNIT_ASSERT(pXImpressDocument);
 
+// Drain events.
+Scheduler::ProcessEventsToIdle();
+
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
+  convertMm100ToTwip(0), 
convertMm100ToTwip(0),
+  1, MOUSE_LEFT, 0);
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
+  convertMm100ToTwip(0), 
convertMm100ToTwip(0),
+  1, MOUSE_LEFT, 0);
+Scheduler::ProcessEventsToIdle();
+
+// select second text object
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+Scheduler::ProcessEventsToIdle();
+
+// step into text editing
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, '1', 0);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, '1', 0);
+Scheduler::ProcessEventsToIdle();
+
+// select full text
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_LEFT | 
KEY_SHIFT);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_LEFT | 
KEY_SHIFT);
+Scheduler::ProcessEventsToIdle();
+
+// Click on the title text to select it.
+const long xPos = 0;
+const long yPos = 50;
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
+  convertMm100ToTwip(xPos), 
convertMm100ToTwip(yPos),
+  1, MOUSE_LEFT, 0);
+pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
+  convertMm100ToTwip(xPos), 
convertMm100ToTwip(yPos),
+  1, MOUSE_LEFT, 0);
+Scheduler::ProcessEventsToIdle();
+
 // select second text object
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
@@ -2138,8 +2187,8 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
 CPPUNIT_ASSERT(pTextObj);
 CPPUNIT_ASSERT_EQUAL(static_cast(OBJ_TEXT), 
pTextObj->GetObjIdentifier());
 Point aPos = pTextObj->GetLastBoundRect().TopLeft();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast(12990), aPos.getX(), 100);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast(7393), aPos.getY(), 100);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast(6

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

2019-04-14 Thread Ashod Nakashian (via logerrit)
 sd/source/ui/view/drviews1.cxx |   26 +-
 1 file changed, 5 insertions(+), 21 deletions(-)

New commits:
commit 5db9926662a7a6dcbaa9a4605e535c42a8a1e493
Author: Ashod Nakashian 
AuthorDate: Wed Nov 28 22:06:05 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:39:58 2019 +0200

LOK: sd: use native SdPage to flag selection

The slide-sorter is actually still necessary to apply/change
the master slide of a given slide, so we must enable it.

Change-Id: I3f59f58be76ab1c63453b4f6288044572800a556

Change-Id: I7554ba4afd28d7ea4f3ed6ba375d9765a89ef21c
Reviewed-on: https://gerrit.libreoffice.org/69618
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 4002e032a58a..405804acff33 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -753,31 +753,15 @@ bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long 
nVerb)
  */
 bool DrawViewShell::SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect)
 {
-slidesorter::SlideSorterViewShell* pSlideSorterViewShell
-= 
slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase());
-if (pSlideSorterViewShell != nullptr)
+SdPage* pPage = GetDoc()->GetSdPage(nPage, PageKind::Standard);
+if (pPage)
 {
-slidesorter::controller::PageSelector& aPageSelector
-= 
pSlideSorterViewShell->GetSlideSorter().GetController().GetPageSelector();
 if (nSelect == 0)
-{
-// Deselect.
-aPageSelector.DeselectPage(nPage);
-
-}
+pPage->SetSelected(false); // Deselect.
 else if (nSelect == 1)
-{
-// Select.
-aPageSelector.SelectPage(nPage);
-}
+pPage->SetSelected(true); // Select.
 else
-{
-// Toggle.
-if (aPageSelector.IsPageSelected(nPage))
-aPageSelector.DeselectPage(nPage);
-else
-aPageSelector.SelectPage(nPage);
-}
+pPage->SetSelected(!pPage->IsSelected()); // Toggle.
 
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Ashod Nakashian (via logerrit)
 comphelper/source/misc/dispatchcommand.cxx |   21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit e928e5295db7e11d8f8773076cf122b4d16ec9f2
Author: Ashod Nakashian 
AuthorDate: Sat Apr 13 21:40:20 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:41:41 2019 +0200

comphelper: use dispatchwithNotification only when we have a callback

Change-Id: Ica7448458ecc5e9adc802a288f72b1fceb709f79
Reviewed-on: https://gerrit.libreoffice.org/70724
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/comphelper/source/misc/dispatchcommand.cxx 
b/comphelper/source/misc/dispatchcommand.cxx
index 90d181d2e0e4..73b778c53a4b 100644
--- a/comphelper/source/misc/dispatchcommand.cxx
+++ b/comphelper/source/misc/dispatchcommand.cxx
@@ -30,8 +30,9 @@
 using namespace css;
 
 namespace comphelper {
-
-bool dispatchCommand(const OUString& rCommand, const 
css::uno::Sequence& rArguments, const 
uno::Reference& aListener)
+bool dispatchCommand(const OUString& rCommand,
+ const css::uno::Sequence& 
rArguments,
+ const 
uno::Reference& aListener)
 {
 // Target where we will execute the .uno: command
 uno::Reference xContext = 
::comphelper::getProcessComponentContext();
@@ -55,11 +56,17 @@ bool dispatchCommand(const OUString& rCommand, const 
css::uno::Sequence xNotifyingDisp(xDisp, 
uno::UNO_QUERY);
-if (xNotifyingDisp.is())
-xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, 
aListener);
-else
-xDisp->dispatch(aCommandURL, rArguments);
+if (aListener.is())
+{
+uno::Reference xNotifyingDisp(xDisp, 
uno::UNO_QUERY);
+if (xNotifyingDisp.is())
+{
+xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, 
aListener);
+return true;
+}
+}
+
+xDisp->dispatch(aCommandURL, rArguments);
 
 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-4' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt

2019-04-14 Thread Libreoffice Gerrit user
 bundled/include/LibreOfficeKit/LibreOfficeKit.h  |3 +
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx|7 
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |1 
 kit/ChildSession.cpp |   32 +++
 kit/ChildSession.hpp |1 
 loleaflet/src/control/Control.PartsPreview.js|   12 ++-
 loleaflet/src/control/Parts.js   |   25 ++
 wsd/ClientSession.cpp|   20 +++
 wsd/protocol.txt |9 +
 9 files changed, 108 insertions(+), 2 deletions(-)

New commits:
commit 66930b7232c366968099d5e98ffa574425a52f04
Author: Ashod Nakashian 
AuthorDate: Tue Sep 11 19:30:55 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:49:31 2019 +0200

wsd: loleaflet: select multiple parts

Primarily support for selecting multiple slides
to edit their properties together.

Change-Id: I96c7ec048668494b5b769677db6874df91cbb42d
Reviewed-on: https://gerrit.libreoffice.org/69631
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index b694dc522..763e5311e 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -372,6 +372,9 @@ struct _LibreOfficeKitDocumentClass
   int nY,
   int nOffset);
 
+/// @see lok::Document::selectPart().
+void (*selectPart) (LibreOfficeKitDocument* pThis, int nPart, int nSelect);
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index f2163cd1f..36052cd64 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -649,6 +649,13 @@ public:
 return mpDoc->pClass->postWindowGestureEvent(mpDoc, nWindowId, pType, 
nX, nY, nOffset);
 }
 
+/// Set a part's selection mode.
+/// nSelect is 0 to deselect, 1 to select, and 2 to toggle.
+void selectPart(int nPart, int nSelect)
+{
+mpDoc->pClass->selectPart(mpDoc, nPart, nSelect);
+}
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 1d55ce858..26fb2ab74 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -563,6 +563,7 @@ typedef enum
  * "type" tells the type of the window the action is associated with
  *  - "dialog" - window is a dialog
  *  - "child" - window is a floating window (combo boxes, etc.)
+ *  - "panel" - window is a docked panel (i.e. in the sidebar)
  *
  * "action" can take following values:
  * - "created" - window is created in the backend, client can render it now
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 31e978894..ddf7dee8a 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -223,6 +223,10 @@ bool ChildSession::_handleInput(const char *buffer, int 
length)
 {
 return setClientPart(buffer, length, tokens);
 }
+else if (tokens[0] == "selectclientpart")
+{
+return selectClientPart(buffer, length, tokens);
+}
 else if (tokens[0] == "setpage")
 {
 return setPage(buffer, length, tokens);
@@ -1820,6 +1824,34 @@ bool ChildSession::setClientPart(const char* /*buffer*/, 
int /*length*/, const s
 return true;
 }
 
+bool ChildSession::selectClientPart(const char* /*buffer*/, int /*length*/, 
const std::vector& tokens)
+{
+int nPart;
+int nSelect;
+if (tokens.size() < 3 ||
+!getTokenInteger(tokens[1], "part", nPart) ||
+!getTokenInteger(tokens[2], "how", nSelect))
+{
+sendTextFrame("error: cmd=selectclientpart kind=invalid");
+return false;
+}
+
+std::unique_lock lock(_docManager.getDocumentMutex());
+
+getLOKitDocument()->setView(_viewId);
+
+if (getLOKitDocument()->getDocumentType() != LOK_DOCTYPE_TEXT && nPart != 
getLOKitDocument()->getPart())
+{
+getLOKitDocument()->selectPart(nPart, nSelect);
+}
+else
+{
+LOG_WRN("ChildSession::selectClientPart[" << getName() << "]: error 
selecting part on text documents.");
+}
+
+return true;
+}
+
 bool ChildSession::setPage(const char* /*buffer*/, int /*length*/, const 
std::vector& tokens)
 {
 int page;
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index 597002336..d37ab14a5 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -263,6 +263,7 @@ private:
 bool resetSelection(const char

[Libreoffice-commits] dev-tools.git: ciabot/run-libreoffice-ciabot.pl

2019-04-14 Thread Libreoffice Gerrit user
 ciabot/run-libreoffice-ciabot.pl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fef623f315aae63bd493960fe296d3e3a8af5ee0
Author: Thorsten Behrens 
AuthorDate: Mon Apr 15 03:15:58 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Apr 15 03:15:58 2019 +0200

ciabot: update git to production instance version

diff --git a/ciabot/run-libreoffice-ciabot.pl b/ciabot/run-libreoffice-ciabot.pl
index dfe0e9f..5ff97ec 100755
--- a/ciabot/run-libreoffice-ciabot.pl
+++ b/ciabot/run-libreoffice-ciabot.pl
@@ -123,7 +123,7 @@ sub report($$$) {
my $branch = $branch_name;
$branch = 'master' if ($branch eq '');
print "reporting to bugzilla: $_ and 
branch $branch";
-qx(python 
$cwd/libreoffice-bugzilla2.py -r $repo -c $_ -b $branch >> 
/home/ciabot/bugzilla.log);
+qx(python 
$cwd/libreoffice-bugzilla2.py -r $repo -c $_ -b $branch >> 
/srv/home/ciabot/bugzilla.log);
 }
 qx($ciabot $repo $_ $branch_name 
$ciaproxy);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/uiview/viewmdi.cxx |   27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

New commits:
commit b4869c08b81a1bc707c882a1b3668b056e8f44d1
Author: Jim Raykowski 
AuthorDate: Thu Apr 11 22:45:42 2019 -0800
Commit: Jim Raykowski 
CommitDate: Mon Apr 15 04:09:00 2019 +0200

tdf#115600 Display messages in Findbar for Navigate By Page

...and make Navigate By Page wrap

Change-Id: Iec45d87f665f75e90378c302b8c3098bb5cbe7d1
Reviewed-on: https://gerrit.libreoffice.org/70640
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/source/uibase/uiview/viewmdi.cxx 
b/sw/source/uibase/uiview/viewmdi.cxx
index dc910ca91427..bff30a24443d 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -348,7 +348,32 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
 switch( m_nMoveType )
 {
 case NID_PGE:
-bNext ? PhyPageDown() : PhyPageUp();
+if ( bNext )
+{
+if ( USHRT_MAX == rSh.GetNextPrevPageNum( true ) )
+{
+rSh.GotoPage( 1, true );
+SvxSearchDialogWrapper::SetSearchLabel( 
SearchLabel::EndWrapped );
+}
+else
+{
+PhyPageDown();
+SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty 
);
+}
+}
+else
+{
+if ( USHRT_MAX == rSh.GetNextPrevPageNum( false ) )
+{
+rSh.GotoPage( rSh.GetPageCnt(), true );
+SvxSearchDialogWrapper::SetSearchLabel( 
SearchLabel::StartWrapped );
+}
+else
+{
+PhyPageUp();
+SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty 
);
+}
+}
 break;
 case NID_TBL :
 rSh.EnterStdMode();
___
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-4' - kit/KitHelper.hpp loleaflet/src

2019-04-14 Thread Libreoffice Gerrit user
 kit/KitHelper.hpp  |   51 -
 loleaflet/src/control/Parts.js |1 
 loleaflet/src/core/Socket.js   |7 +
 3 files changed, 38 insertions(+), 21 deletions(-)

New commits:
commit b3fe7a05d8392d41951865cd2d0fad43dd7625cf
Author: Ashod Nakashian 
AuthorDate: Sun Sep 16 17:32:56 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 04:23:07 2019 +0200

wsd: leaflet: status now includes selected parts

Change-Id: I3eeb2fbc52d28047dd0ab7e4318fa44d5c5c0a98
Reviewed-on: https://gerrit.libreoffice.org/69632
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp
index b6225feda..f8ec0c9a3 100644
--- a/kit/KitHelper.hpp
+++ b/kit/KitHelper.hpp
@@ -157,32 +157,41 @@ namespace LOKitHelper
 
 if (type == LOK_DOCTYPE_SPREADSHEET || type == 
LOK_DOCTYPE_PRESENTATION)
 {
-if (type == LOK_DOCTYPE_SPREADSHEET)
+std::ostringstream hposs;
+std::ostringstream sposs;
+for (int i = 0; i < parts; ++i)
 {
-std::ostringstream hposs;
-for (int i = 0; i < parts; ++i)
+ptrValue = loKitDocument->pClass->getPartInfo(loKitDocument, 
i);
+const std::string partinfo(ptrValue);
+std::free(ptrValue);
+for (const auto& prop : Util::JsonToMap(partinfo))
 {
-
-ptrValue = 
loKitDocument->pClass->getPartInfo(loKitDocument, i);
-std::string partinfo(ptrValue);
-std::free(ptrValue);
-const auto aPartInfo = Util::JsonToMap(partinfo);
-for (const auto& prop: aPartInfo)
+const std::string& name = prop.first;
+if (name == "visible")
 {
-const std::string& name = prop.first;
-if (name == "visible")
-{
-if (prop.second == "0")
-hposs << i << ",";
-}
+if (prop.second == "0")
+hposs << i << ',';
+}
+else if (name == "selected")
+{
+if (prop.second == "1")
+sposs << i << ',';
 }
 }
-std::string hiddenparts = hposs.str();
-if (!hiddenparts.empty())
-{
-hiddenparts.pop_back();
-oss << " hiddenparts=" << hiddenparts;
-}
+}
+
+std::string hiddenparts = hposs.str();
+if (!hiddenparts.empty())
+{
+hiddenparts.pop_back(); // Remove last ','
+oss << " hiddenparts=" << hiddenparts;
+}
+
+std::string selectedparts = sposs.str();
+if (!selectedparts.empty())
+{
+selectedparts.pop_back(); // Remove last ','
+oss << " selectedparts=" << selectedparts;
 }
 
 for (int i = 0; i < parts; ++i)
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 49a8de3ec..24e57ba55 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -57,6 +57,7 @@ L.Map.include({
// part is the part index/id
// how is 0 to deselect, 1 to select, and 2 to toggle selection
selectPart: function (part, how, external) {
+   //TODO: Update/track selected parts.
var docLayer = this._docLayer;
if (typeof (part) === 'number' && part >= 0 && part < 
docLayer._parts) {
var selectedPart = part;
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index b21a3b496..4e3ee7547 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -996,6 +996,13 @@ L.Socket = L.Class.extend({

command.hiddenparts.push(parseInt(item));
});
}
+   else if (tokens[i].startsWith('selectedparts=')) {
+   var selectedparts = 
tokens[i].substring(14).split(',');
+   command.selectedparts = [];
+   selectedparts.forEach(function (item) {
+   
command.selectedparts.push(parseInt(item));
+   });
+   }
}
if (command.tileWidth && command.tileHeight && 
this._map._docLayer) {
var defaultZoom = this._map.options.zoom;
___
Libreoffice-commits mailing list
libreo

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - common/Util.cpp

2019-04-14 Thread Libreoffice Gerrit user
 common/Util.cpp |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3e8d395618c6dfbf952fd632ea26c8ffafd39ee8
Author: Ashod Nakashian 
AuthorDate: Sat Mar 9 21:21:48 2019 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 04:23:30 2019 +0200

wsd: parse empty json string as empty map

Change-Id: I11335e82e42e9f896ae33c2e57cb9d79b642171e
Reviewed-on: https://gerrit.libreoffice.org/69633
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/common/Util.cpp b/common/Util.cpp
index b0b870605..44a39fea8 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -571,6 +571,10 @@ namespace Util
 
 std::map JsonToMap(const std::string& jsonString)
 {
+std::map map;
+if (jsonString.empty())
+return map;
+
 Poco::JSON::Parser parser;
 const Poco::Dynamic::Var result = parser.parse(jsonString);
 const auto& json = result.extract();
@@ -578,7 +582,6 @@ namespace Util
 std::vector names;
 json->getNames(names);
 
-std::map map;
 for (const auto& name : names)
 {
 map[name] = json->get(name).toString();
___
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-4' - loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt

2019-04-14 Thread Libreoffice Gerrit user
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 wsd/ClientSession.cpp |4 +++-
 wsd/protocol.txt  |7 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 6dce712ff4680fb7add00ebf6e4b78f61dda3e79
Author: Ashod Nakashian 
AuthorDate: Mon Sep 17 06:45:57 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 04:23:45 2019 +0200

wsd: leaflet: support statusupdate: messages to sync clients

This new message is identical to status: except it doesn't
imply (re)connection. It's unfortunate that status: is
assumed to be sent only when establishing connection and
loading a document, so we need a different notification
that can be sent at any time, without triggering
initalization logic on the client-side.

Change-Id: I9c804119aec292b873aeed132cc32f13c030d845
Reviewed-on: https://gerrit.libreoffice.org/69634
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 42c880e57..ca302390e 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -432,7 +432,7 @@ L.TileLayer = L.GridLayer.extend({
else if (textMsg.startsWith('statechanged:')) {
this._onStateChangedMsg(textMsg);
}
-   else if (textMsg.startsWith('status:')) {
+   else if (textMsg.startsWith('status:') || 
textMsg.startsWith('statusupdate:')) {
this._onStatusMsg(textMsg);
}
else if (textMsg.startsWith('textselection:')) {
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index f9b8739f5..c2fbee956 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -167,6 +167,7 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
  tokens[0] != "selectclientpart" &&
  tokens[0] != "setpage" &&
  tokens[0] != "status" &&
+ tokens[0] != "statusupdate" &&
  tokens[0] != "tile" &&
  tokens[0] != "tilecombine" &&
  tokens[0] != "uno" &&
@@ -181,6 +182,7 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
  tokens[0] != "rendershapeselection" &&
  tokens[0] != "removesession")
 {
+LOG_ERR("Session [" << getId() << "] got unknown command [" << 
tokens[0] << "].");
 sendTextFrame("error: cmd=" + tokens[0] + " kind=unknown");
 return false;
 }
@@ -241,7 +243,7 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
 {
 return sendFontRendering(buffer, length, tokens, docBroker);
 }
-else if (tokens[0] == "status")
+else if (tokens[0] == "status" || tokens[0] == "statusupdate")
 {
 assert(firstLine.size() == static_cast(length));
 return forwardToChild(firstLine, docBroker);
diff --git a/wsd/protocol.txt b/wsd/protocol.txt
index a4631c912..cb5554e4c 100644
--- a/wsd/protocol.txt
+++ b/wsd/protocol.txt
@@ -369,11 +369,16 @@ saveas: url= name=
  is the resulting name (without path) that was created on the wopi
 host. It can differ from what was requested in case the file already 
existed.
 
-status: type= parts= current= 
width= height= viewid= [partNames]
+status: type= parts= current= 
width= height= viewid= hiddenparts= 
selectedparts= [partNames]
 
  is 'text, 'spreadsheet', 'presentation', 'drawing' or 'other. 
Others are numbers.
 if the document has multiple parts and those have names, part names follow 
separated by '\n'
 
+statusupdate: type= parts= 
current= width= height= viewid= 
hiddenparts= selectedparts= [partNames]
+
+Same as status: but issued whenever the document parts have updated 
significantly.
+status: implies document loading. statusupdate: is just an update.
+
 styles: {"styleFamily": ["styles in family"], etc. }
 
 statechanged: =
___
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-4' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/css loleaflet/src wsd/ClientSession.cpp wsd/protoco

2019-04-14 Thread Libreoffice Gerrit user
 bundled/include/LibreOfficeKit/LibreOfficeKit.h  |3 
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx|8 ++
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |2 
 kit/ChildSession.cpp |   35 ++
 kit/ChildSession.hpp |1 
 loleaflet/css/partsPreviewControl.css|6 +
 loleaflet/src/control/Control.PartsPreview.js|   61 +++
 wsd/ClientSession.cpp|   18 +
 wsd/protocol.txt |4 +
 9 files changed, 136 insertions(+), 2 deletions(-)

New commits:
commit 021d67f1430ff2a554b65c65d7aee752fed0b77f
Author: Ashod Nakashian 
AuthorDate: Mon Sep 17 07:17:31 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 04:24:45 2019 +0200

wsd: leaflet: support reordering of slides via drag-and-drop

Change-Id: I1b471ba07dd0a1016a0759de729171ae968262cb
Reviewed-on: https://gerrit.libreoffice.org/69635
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 763e5311e..510cafcdb 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -375,6 +375,9 @@ struct _LibreOfficeKitDocumentClass
 /// @see lok::Document::selectPart().
 void (*selectPart) (LibreOfficeKitDocument* pThis, int nPart, int nSelect);
 
+/// @see lok::Document::moveSelectedParts().
+void (*moveSelectedParts) (LibreOfficeKitDocument* pThis, int nPosition, 
bool bDuplicate);
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 36052cd64..4f9ef60d0 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -656,6 +656,14 @@ public:
 mpDoc->pClass->selectPart(mpDoc, nPart, nSelect);
 }
 
+/// Moves the selected pages/slides to a new position.
+/// nPosition is the new position where the selection
+/// should go. bDuplicate when true will copy instead of move.
+void moveSelectedParts(int nPosition, bool bDuplicate)
+{
+mpDoc->pClass->moveSelectedParts(mpDoc, nPosition, bDuplicate);
+}
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 26fb2ab74..aae23e319 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -563,7 +563,7 @@ typedef enum
  * "type" tells the type of the window the action is associated with
  *  - "dialog" - window is a dialog
  *  - "child" - window is a floating window (combo boxes, etc.)
- *  - "panel" - window is a docked panel (i.e. in the sidebar)
+ *  - "deck" - window is a docked/floating deck (i.e. the sidebar)
  *
  * "action" can take following values:
  * - "created" - window is created in the backend, client can render it now
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index ddf7dee8a..ea39697bb 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -227,6 +227,10 @@ bool ChildSession::_handleInput(const char *buffer, int 
length)
 {
 return selectClientPart(buffer, length, tokens);
 }
+else if (tokens[0] == "moveselectedclientparts")
+{
+return moveSelectedClientParts(buffer, length, tokens);
+}
 else if (tokens[0] == "setpage")
 {
 return setPage(buffer, length, tokens);
@@ -1852,6 +1856,37 @@ bool ChildSession::selectClientPart(const char* 
/*buffer*/, int /*length*/, cons
 return true;
 }
 
+bool ChildSession::moveSelectedClientParts(const char* /*buffer*/, int 
/*length*/, const std::vector& tokens)
+{
+int nPosition;
+if (tokens.size() < 2 ||
+!getTokenInteger(tokens[1], "position", nPosition))
+{
+sendTextFrame("error: cmd=moveselectedclientparts kind=invalid");
+return false;
+}
+
+std::unique_lock lock(_docManager.getDocumentMutex());
+
+getLOKitDocument()->setView(_viewId);
+
+if (getLOKitDocument()->getDocumentType() != LOK_DOCTYPE_TEXT)
+{
+getLOKitDocument()->moveSelectedParts(nPosition, false); // Move, 
don't duplicate.
+
+// Get the status to recreate the previews and correctly order parts.
+const std::string status = 
LOKitHelper::documentStatus(getLOKitDocument()->get());
+if (!status.empty())
+return sendTextFrame("statusupdate: " + status);
+}
+else
+{
+LOG_WRN("ChildSession::moveSelectedClientParts[" << getName() << "]: 
error moving parts on text documents.");
+}
+
+ret

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 dbaccess/source/ui/app/AppView.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 381626d0f5213d304080923427724998cbf87380
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:04:14 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 04:48:27 2019 +0200

Fix typo

Change-Id: I0e9d0b444d9cb122c0e02cbf521ba8a8ff1bb52c
Reviewed-on: https://gerrit.libreoffice.org/70748
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/dbaccess/source/ui/app/AppView.hxx 
b/dbaccess/source/ui/app/AppView.hxx
index 745ab56ee8f4..3cf3e986365b 100644
--- a/dbaccess/source/ui/app/AppView.hxx
+++ b/dbaccess/source/ui/app/AppView.hxx
@@ -212,7 +212,7 @@ namespace dbaui
 
 /** adds a new object to the detail page.
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rName
 The name of the object to be inserted
 @param  _rObject
@@ -224,9 +224,9 @@ namespace dbaui
 ,const OUString& _rName
 ,const css::uno::Any& _rObject );
 
-/** replaces a objects name with a new one
+/** replaces an objects name with a new one
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rOldName
 The old name of the object to be replaced
 @param  _rNewName
@@ -242,7 +242,7 @@ namespace dbaui
 
 /** removes an element from the detail page.
 @param  _eType
-The type where the entry shold be appended.
+The type where the entry should be appended.
 @param  _rName
 The name of the element to be removed.
 @param  _rxConn
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - cli_ure/source dbaccess/source

2019-04-14 Thread Andrea Gelmini (via logerrit)
 cli_ure/source/uno_bridge/cli_environment.h  |2 +-
 dbaccess/source/ui/inc/QueryPropertiesDialog.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3bae665ce86054b8422f5bb3ba849964b632780c
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:04:01 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 04:49:29 2019 +0200

Fix typo

Change-Id: I0eb72d26be05c5ce937f72930f2c16fce69c85e5
Reviewed-on: https://gerrit.libreoffice.org/70747
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx 
b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
index fde2e8ff9475..b5b1dc16626d 100644
--- a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
+++ b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
@@ -19,7 +19,7 @@ namespace dbaui
 
 /**
  * Dialog to set such properties of a query as distinct values and limit
- * It can be opened form Edit menu in Query Design View
+ * It can be opened from Edit menu in Query Design View
  */
 class QueryPropertiesDialog : public weld::GenericDialogController
 {
commit 9ad15c082c4f037437a74c49ba046c30a23e4980
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:05:48 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 04:48:51 2019 +0200

Fix typo

Change-Id: I90a02374666929aed5ae00b08af3faa187f09a5b
Reviewed-on: https://gerrit.libreoffice.org/70749
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/cli_ure/source/uno_bridge/cli_environment.h 
b/cli_ure/source/uno_bridge/cli_environment.h
index 41e1166494d6..46977fa657c7 100644
--- a/cli_ure/source/uno_bridge/cli_environment.h
+++ b/cli_ure/source/uno_bridge/cli_environment.h
@@ -94,7 +94,7 @@ public:
  * will give the same id.
  * 
  * @return the generated oid.
- * @param  object the object for which a Oid should be generated.
+ * @param  object the object for which an Oid should be generated.
  */
 static System::String^ getObjectIdentifier(Object^ obj);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 dbaccess/source/ui/inc/RelationTableView.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c84d974067a6a6aa17b6e5e3b289158c1e3cb74a
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:04:00 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 04:50:35 2019 +0200

Fix typo

Change-Id: I5d2751276497b0da8f50be21804ab6dd624b55ba
Reviewed-on: https://gerrit.libreoffice.org/70746
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx 
b/dbaccess/source/ui/inc/RelationTableView.hxx
index 54d779540c70..0bc8c86275bb 100644
--- a/dbaccess/source/ui/inc/RelationTableView.hxx
+++ b/dbaccess/source/ui/inc/RelationTableView.hxx
@@ -32,7 +32,7 @@ namespace dbaui
public OJoinTableView,
public ::comphelper::OContainerListener
 {
-VclPtr m_pExistingConnection; ///< is set when a 
connection was draged on an existing connection
+VclPtr m_pExistingConnection; ///< is set when a 
connection was dragged on an existing connection
 TTableConnectionData::value_type m_pCurrentlyTabConnData; ///< set 
when we creating a connection with more than one keycolumn
 ::rtl::Reference< comphelper::OContainerListenerAdapter> 
m_pContainerListener;
 bool m_bInRemove;
___
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-4' - loleaflet/css loleaflet/src

2019-04-14 Thread Libreoffice Gerrit user
 loleaflet/css/partsPreviewControl.css |2 +-
 loleaflet/src/control/Control.PartsPreview.js |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f5cdff4d7eec25a76f7776210beb929095ea81ae
Author: Ashod Nakashian 
AuthorDate: Fri Nov 23 01:50:30 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 05:03:08 2019 +0200

leaflet: make the slide drop sites more visible

Change-Id: Idc8e2ee33fc61449300180e8200f5aa75b82f07e
Reviewed-on: https://gerrit.libreoffice.org/69638
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loleaflet/css/partsPreviewControl.css 
b/loleaflet/css/partsPreviewControl.css
index 39bba0121..e5afa218a 100644
--- a/loleaflet/css/partsPreviewControl.css
+++ b/loleaflet/css/partsPreviewControl.css
@@ -41,5 +41,5 @@
 
 /* Highlight where a slide can be dropped when reordering by drag-and-drop. */
 .preview-img-dropsite {
-border-bottom: 2px solid red;
+border-bottom: 3px solid red;
 }
diff --git a/loleaflet/src/control/Control.PartsPreview.js 
b/loleaflet/src/control/Control.PartsPreview.js
index 1492f03ab..908d7e5ca 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -86,7 +86,8 @@ L.Control.PartsPreview = L.Control.extend({
var frame = L.DomUtil.create('div', 
'preview-frame', this._scrollContainer);
this._addDnDHandlers(frame);
frame.setAttribute('draggable', false);
-   L.DomUtil.setStyle(frame, 'height', '12px');
+   L.DomUtil.setStyle(frame, 'height', '20px');
+   L.DomUtil.setStyle(frame, 'margin', '0em');
 
// Create the preview parts
for (var i = 0; i < parts; i++) {
___
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-4' - kit/ChildSession.cpp kit/ChildSession.hpp kit/Kit.cpp loleaflet/css loleaflet/src test/WhiteBoxTests.cpp

2019-04-14 Thread Libreoffice Gerrit user
 kit/ChildSession.cpp  |9 +++--
 kit/ChildSession.hpp  |3 +++
 kit/Kit.cpp   |   12 ++--
 loleaflet/css/partsPreviewControl.css |   13 +++--
 loleaflet/src/control/Control.PartsPreview.js |   11 ---
 loleaflet/src/control/Parts.js|   23 +--
 loleaflet/src/core/Socket.js  |8 
 loleaflet/src/layer/tile/ImpressTileLayer.js  |2 ++
 test/WhiteBoxTests.cpp|5 +
 9 files changed, 67 insertions(+), 19 deletions(-)

New commits:
commit cee3fb4d6e0e1b0fbeaebf7cfbad76743ac958c8
Author: Ashod Nakashian 
AuthorDate: Mon Sep 17 06:31:36 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 05:02:11 2019 +0200

wsd: leaflet: track multi-selection

Change-Id: I17c092e950fb4d7a0cb4129c537d60a8e5edd06a
Reviewed-on: https://gerrit.libreoffice.org/69636
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index ea39697bb..1e3e00413 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1847,6 +1847,11 @@ bool ChildSession::selectClientPart(const char* 
/*buffer*/, int /*length*/, cons
 if (getLOKitDocument()->getDocumentType() != LOK_DOCTYPE_TEXT && nPart != 
getLOKitDocument()->getPart())
 {
 getLOKitDocument()->selectPart(nPart, nSelect);
+
+// Notify the client of the selection update.
+const std::string status = 
LOKitHelper::documentStatus(getLOKitDocument()->get());
+if (!status.empty())
+return sendTextFrame("statusupdate: " + status);
 }
 else
 {
@@ -1874,10 +1879,10 @@ bool ChildSession::moveSelectedClientParts(const char* 
/*buffer*/, int /*length*
 {
 getLOKitDocument()->moveSelectedParts(nPosition, false); // Move, 
don't duplicate.
 
-// Get the status to recreate the previews and correctly order parts.
+// Get the status to notify clients of the reordering and selection 
change.
 const std::string status = 
LOKitHelper::documentStatus(getLOKitDocument()->get());
 if (!status.empty())
-return sendTextFrame("statusupdate: " + status);
+return _docManager.notifyAll("statusupdate: " + status);
 }
 else
 {
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index 2cddff005..4e5f75297 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -58,6 +58,9 @@ public:
 /// Access to the office instance.
 virtual std::shared_ptr getLOKit() = 0;
 
+/// Send msg to all active sessions.
+virtual bool notifyAll(const std::string& msg) = 0;
+
 /// Send updated view info to all active sessions.
 virtual void notifyViewInfo() = 0;
 virtual void updateEditorSpeeds(int id, int speed) = 0;
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 019a061cb..76e41b4b3 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1491,6 +1491,15 @@ private:
 return _editorId;
 }
 
+/// Notify all views with the given message
+bool notifyAll(const std::string& msg) override
+{
+Util::assertIsLocked(_documentMutex);
+
+// Broadcast updated viewinfo to all clients.
+return sendTextFrame("client-all " + msg);
+}
+
 /// Notify all views of viewId and their associated usernames
 void notifyViewInfo() override
 {
@@ -1540,10 +1549,9 @@ private:
 
 oss.seekp(-1, std::ios_base::cur); // Remove last comma.
 oss << "]";
-const std::string msg = oss.str();
 
 // Broadcast updated viewinfo to all clients.
-sendTextFrame("client-all " + msg);
+notifyAll(oss.str());
 }
 
 void updateEditorSpeeds(int id, int speed) override
diff --git a/loleaflet/css/partsPreviewControl.css 
b/loleaflet/css/partsPreviewControl.css
index 66e47c9bb..39bba0121 100644
--- a/loleaflet/css/partsPreviewControl.css
+++ b/loleaflet/css/partsPreviewControl.css
@@ -27,10 +27,19 @@
border: 2px solid #dfdfdf;
}
 
-.preview-img-selected {
-   border-color: #00;
+/* The current part the user is on. */
+.preview-img-currentpart {
+border-color: #00;
+border-style: solid;
 }
 
+/* One of (potentially many) selected parts, but not the current. */
+.preview-img-selectedpart {
+border-color: #00;
+border-style: dotted;
+}
+
+/* Highlight where a slide can be dropped when reordering by drag-and-drop. */
 .preview-img-dropsite {
 border-bottom: 2px solid red;
 }
diff --git a/loleaflet/src/control/Control.PartsPreview.js 
b/loleaflet/src/control/Control.PartsPreview.js
index 78834a6d8..23ef831d2 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -26,6 +26,7 @@ L.Control.PartsPreview = L.Control.extend({
_updateDisabled: function (e) {
var parts = e.parts;
 

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

2019-04-14 Thread Libreoffice Gerrit user
 loleaflet/src/control/Control.PartsPreview.js |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 685f10a287c23e22ad77468f10cfc0f2dac5955e
Author: Ashod Nakashian 
AuthorDate: Fri Nov 23 01:36:17 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 05:02:39 2019 +0200

leaflet: support reordering slides to first position

Change-Id: I23fba5d7e10d861ec482974cf355c9fb1ae13a64
Reviewed-on: https://gerrit.libreoffice.org/69637
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.PartsPreview.js 
b/loleaflet/src/control/Control.PartsPreview.js
index 23ef831d2..1492f03ab 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -66,7 +66,7 @@ L.Control.PartsPreview = L.Control.extend({
this._map.on('click', function() {
this.partsFocused = false;
}, this);
-   
+
this._map.on('keydown', function(e) {
if (this.partsFocused === true) {
switch 
(e.originalEvent.keyCode) {
@@ -82,6 +82,12 @@ L.Control.PartsPreview = L.Control.extend({
 
this._scrollContainer = $('#slide-sorter 
.mCSB_container').get(0);
 
+   // Add a special frame just as a drop-site for 
reordering.
+   var frame = L.DomUtil.create('div', 
'preview-frame', this._scrollContainer);
+   this._addDnDHandlers(frame);
+   frame.setAttribute('draggable', false);
+   L.DomUtil.setStyle(frame, 'height', '12px');
+
// Create the preview parts
for (var i = 0; i < parts; i++) {

this._previewTiles.push(this._createPreview(i, e.partNames[i], bottomBound));
@@ -189,12 +195,12 @@ L.Control.PartsPreview = L.Control.extend({

$('#slide-sorter').mCustomScrollbar('scrollTo', 
nodePos-(sliderHeight-nodeHeight-nodeHeight/2));
}, 50);
}
-   } 
+   }
return;
}
var part = $('#slide-sorter .mCSB_container 
.preview-frame').index(e.target.parentNode);
if (part !== null) {
-   var partId = parseInt(part);
+   var partId = parseInt(part) - 1; // The first part is 
just a drop-site for reordering.
 
if (e.ctrlKey) {
this._map.selectPart(partId, 2, false); // 
Toggle selection on ctrl+click.
@@ -381,7 +387,9 @@ L.Control.PartsPreview = L.Control.extend({
 
var part = $('#slide-sorter .mCSB_container 
.preview-frame').index(e.target.parentNode);
if (part !== null) {
-   var partId = parseInt(part);
+   var partId = parseInt(part) - 1; // First frame is a 
drop-site for reordering.
+   if (partId < 0)
+   partId = -1; // First item is -1.

this.partsPreview._map._socket.sendMessage('moveselectedclientparts position=' 
+ partId);
}
 
___
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-4' - kit/ChildSession.cpp

2019-04-14 Thread Libreoffice Gerrit user
 kit/ChildSession.cpp |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 3b931560b945c25bb820ba0b24dab7d229f3336b
Author: Ashod Nakashian 
AuthorDate: Sun Jan 20 16:44:28 2019 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 05:03:58 2019 +0200

wsd: don't warn incorrectly when selecting current part

Change-Id: I3c872469911b1f232e40cc110859402fc0814f3a
Reviewed-on: https://gerrit.libreoffice.org/69640
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 1e3e00413..91398619a 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1844,14 +1844,17 @@ bool ChildSession::selectClientPart(const char* 
/*buffer*/, int /*length*/, cons
 
 getLOKitDocument()->setView(_viewId);
 
-if (getLOKitDocument()->getDocumentType() != LOK_DOCTYPE_TEXT && nPart != 
getLOKitDocument()->getPart())
+if (getLOKitDocument()->getDocumentType() != LOK_DOCTYPE_TEXT)
 {
-getLOKitDocument()->selectPart(nPart, nSelect);
+if (nPart != getLOKitDocument()->getPart())
+{
+getLOKitDocument()->selectPart(nPart, nSelect);
 
-// Notify the client of the selection update.
-const std::string status = 
LOKitHelper::documentStatus(getLOKitDocument()->get());
-if (!status.empty())
-return sendTextFrame("statusupdate: " + status);
+// Notify the client of the selection update.
+const std::string status = 
LOKitHelper::documentStatus(getLOKitDocument()->get());
+if (!status.empty())
+return sendTextFrame("statusupdate: " + status);
+}
 }
 else
 {
___
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-4' - loleaflet/src

2019-04-14 Thread Libreoffice Gerrit user
 loleaflet/src/control/Control.PartsPreview.js |8 
 loleaflet/src/control/Parts.js|1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 4e30d3d2a3dacfad34168e17a194e7bf78e725a2
Author: Ashod Nakashian 
AuthorDate: Wed Nov 28 22:07:33 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 05:03:41 2019 +0200

leaflet: select the current slide and update previews after reordering

Change-Id: Iec1c41b257744e99d8447518be0b38eb9a28d715
Reviewed-on: https://gerrit.libreoffice.org/69639
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.PartsPreview.js 
b/loleaflet/src/control/Control.PartsPreview.js
index 908d7e5ca..92bbd2673 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -211,6 +211,7 @@ L.Control.PartsPreview = L.Control.extend({
console.log('shift');
} else {
this._map.setPart(partId);
+   this._map.selectPart(partId, 1, false); // And 
select.
}
}
},
@@ -392,6 +393,13 @@ L.Control.PartsPreview = L.Control.extend({
if (partId < 0)
partId = -1; // First item is -1.

this.partsPreview._map._socket.sendMessage('moveselectedclientparts position=' 
+ partId);
+   // Update previews, after a second, since we only get 
the dragged one invalidated.
+   var that = this.partsPreview;
+   setTimeout(function () {
+   for (var i = 0; i < that._previewTiles.length; 
++i) {
+   that._map.getPreview(i, i, 180, 180, 
{autoUpdate: that.options.autoUpdate, broadcast: true});
+   }
+   }, 1000);
}
 
this.classList.remove('preview-img-dropsite');
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 95e5bc2a0..c428408e7 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -63,7 +63,6 @@ L.Map.include({
// part is the part index/id
// how is 0 to deselect, 1 to select, and 2 to toggle selection
selectPart: function (part, how, external) {
-   //TODO: Update/track selected parts(?).
var docLayer = this._docLayer;
var index = docLayer._selectedParts.indexOf(part);
if (index >= 0 && how != 1) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Andrea Gelmini (via logerrit)
 cli_ure/source/uno_bridge/cli_proxy.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d408080d7ce6abcf2a4788cbc70556e5e706cf4d
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:05:47 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 05:19:20 2019 +0200

Fix typo

Change-Id: Ie7578a8f1693d69ef5208659375968e43cb15aec
Reviewed-on: https://gerrit.libreoffice.org/70750
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/cli_ure/source/uno_bridge/cli_proxy.cxx 
b/cli_ure/source/uno_bridge/cli_proxy.cxx
index f980aa3452bd..6930cbfbe83b 100644
--- a/cli_ure/source/uno_bridge/cli_proxy.cxx
+++ b/cli_ure/source/uno_bridge/cli_proxy.cxx
@@ -421,7 +421,7 @@ srrm::IMessage^ UnoInterfaceProxy::Invoke(srrm::IMessage^ 
callmsg)
 UnoInterfaceInfo^ info = findInfo( typeBeingCalled );
 OSL_ASSERT( nullptr != info );
 
-// ToDo do without string conversion, a OUString is not needed here
+// ToDo do without string conversion, an OUString is not needed here
 // get the type description of the call
 OUString usMethodName(mapCliString(static_cast(
  props[m_methodNameString])));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Jens Carl (via logerrit)
 sc/qa/extras/scheaderfieldsobj.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit e11dcc7e599830bedd3595c8b1427f47e5525c11
Author: Jens Carl 
AuthorDate: Mon Apr 15 03:37:57 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 06:42:08 2019 +0200

Remove unnecessary calls to Reference::is() after an UNO_QUERY_THROW

Change-Id: I43f7e328b45d0058f867f3296c5a34740d51b4da
Reviewed-on: https://gerrit.libreoffice.org/70752
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/sc/qa/extras/scheaderfieldsobj.cxx 
b/sc/qa/extras/scheaderfieldsobj.cxx
index 89521b5270e1..e38e88fc0080 100644
--- a/sc/qa/extras/scheaderfieldsobj.cxx
+++ b/sc/qa/extras/scheaderfieldsobj.cxx
@@ -30,7 +30,6 @@
 #include 
 
 using namespace css;
-using namespace css::uno;
 
 namespace sc_apitest
 {
@@ -67,7 +66,6 @@ ScCellFieldsObj::ScCellFieldsObj()
 uno::Reference ScCellFieldsObj::init()
 {
 uno::Reference xDoc(m_xComponent, 
uno::UNO_QUERY_THROW);
-CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
 
 uno::Reference xSFS(xDoc, 
uno::UNO_QUERY_THROW);
 uno::Reference xNA(xSFS->getStyleFamilies(), 
uno::UNO_QUERY_THROW);
@@ -92,8 +90,8 @@ uno::Reference ScCellFieldsObj::init()
 void ScCellFieldsObj::setUp()
 {
 CalcUnoApiTest::setUp();
+// create calc document
 m_xComponent = loadFromDesktop("private:factory/scalc");
-CPPUNIT_ASSERT_MESSAGE("no component", m_xComponent.is());
 }
 
 void ScCellFieldsObj::tearDown()
@@ -103,6 +101,7 @@ void ScCellFieldsObj::tearDown()
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScCellFieldsObj);
+
 } // namespace sc_apitest
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: qadevOOo/objdsc sc/qa

2019-04-14 Thread Jens Carl (via logerrit)
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScPageObj.csv |   11 ---
 sc/qa/unoapi/sc_1.sce |1 -
 2 files changed, 12 deletions(-)

New commits:
commit 527c400ef0654761ac1a3835dc06f2373523ef64
Author: Jens Carl 
AuthorDate: Mon Apr 15 03:31:41 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 06:41:52 2019 +0200

tdf#45904 Remove obsolete ScPageObj tests

As mentioned i#84653 ScPageObj and ScDrawPageObj are supporting the same
service and the later one was convert to C++ with commits
ed6a71eafa61bade50219d2ff6233a42ab6d1c17,
f897e80d063436be07356049f595efe5afb04859,
eb0653ee80ad7249fde9ff752b56316fb98c4592,
ee503c36199d225f4c906fe43c927f911c2097c7
and b99ea0ff33b78ba76d1ae436895efac490252e0f.

Change-Id: Icb05b2a03893f47e5f3816366cb9f3c94fd6faeb
Reviewed-on: https://gerrit.libreoffice.org/70751
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScPageObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScPageObj.csv
deleted file mode 100644
index 4a2f50a0b2f6..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScPageObj.csv
+++ /dev/null
@@ -1,11 +0,0 @@
-"ScPageObj";"com::sun::star::container::XIndexAccess";"getCount()"
-"ScPageObj";"com::sun::star::container::XIndexAccess";"getByIndex()"
-"ScPageObj";"com::sun::star::lang::XServiceInfo";"getImplementationName()"
-"ScPageObj";"com::sun::star::lang::XServiceInfo";"supportsService()"
-"ScPageObj";"com::sun::star::lang::XServiceInfo";"getSupportedServiceNames()"
-"ScPageObj";"com::sun::star::container::XElementAccess";"getElementType()"
-"ScPageObj";"com::sun::star::container::XElementAccess";"hasElements()"
-"ScPageObj";"com::sun::star::drawing::XShapes";"add()"
-"ScPageObj";"com::sun::star::drawing::XShapes";"remove()"
-"ScPageObj";"com::sun::star::drawing::XShapeGrouper";"group()"
-"ScPageObj";"com::sun::star::drawing::XShapeGrouper";"ungroup()"
diff --git a/sc/qa/unoapi/sc_1.sce b/sc/qa/unoapi/sc_1.sce
index d11354465534..1bc68eabbced 100644
--- a/sc/qa/unoapi/sc_1.sce
+++ b/sc/qa/unoapi/sc_1.sce
@@ -15,7 +15,6 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-# i84653 -o sc.ScPageObj
 # i84554 -o sc.AccessibleEditableTextPara_PreviewNote
 # i88241 -o sc.AccessibleEditableTextPara_HeaderFooter
 -o sc.AccessibleEditableTextPara_PreviewCell
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: qadevOOo/objdsc

2019-04-14 Thread Jens Carl (via logerrit)
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv |   12 
--
 1 file changed, 12 deletions(-)

New commits:
commit 4ce6590223ab9a615afcf55ebc0e9cdb3ff2a73a
Author: Jens Carl 
AuthorDate: Mon Apr 15 04:14:20 2019 +
Commit: Jens Carl 
CommitDate: Mon Apr 15 07:02:28 2019 +0200

tdf#45904 Remove obsolete tests for ScHeaderFieldObj

These tests are already ported to C++ in ScEditFieldObj_Header.

Change-Id: I548a50b6e717f706ff89dce530542a0a710185a7
Reviewed-on: https://gerrit.libreoffice.org/70754
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
index 3ae50e42ac18..343631dee5b6 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
@@ -1,16 +1,4 @@
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"dispose()"
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"addEventListener()"
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"removeEventListener()"
-"ScHeaderFieldObj";"com::sun::star::text::TextContent";"AnchorType#optional"
-"ScHeaderFieldObj";"com::sun::star::text::TextContent";"AnchorTypes#optional"
-"ScHeaderFieldObj";"com::sun::star::text::TextContent";"TextWrap#optional"
 "ScHeaderFieldObj";"com::sun::star::text::XTextField";"getPresentation()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"getPropertySetInfo()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"setPropertyValue()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"getPropertyValue()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"addPropertyChangeListener()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"removePropertyChangeListener()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"addVetoableChangeListener()"
-"ScHeaderFieldObj";"com::sun::star::beans::XPropertySet#optional";"removeVetoableChangeListener()"
-"ScHeaderFieldObj";"com::sun::star::text::XTextContent";"attach()"
-"ScHeaderFieldObj";"com::sun::star::text::XTextContent";"getAnchor()"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/dociter.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3c364f5d574515a257ba0bb84e199275fbea944f
Author: Mike Kaganski 
AuthorDate: Mon Apr 15 06:54:31 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Apr 15 08:01:08 2019 +0200

Related: tdf#50916 create valid empty ScHorizontalCellIterator when...

completely outside allocated area.

Prevents crash in spell checker when scrolling into unallocated area, where
first visible column number is greater than maximal allocated column number.
The crash happened when std::vector::reserve threw std::length_error, and
Scheduler::ProcessTaskScheduling abort()ed catching that in std::exception
handler.

Change-Id: Id74706f4a5fedfcc5e4e316c7aea7f5a4fe110be
Reviewed-on: https://gerrit.libreoffice.org/70756
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 174ff54c43e8..8458e2895684 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1924,6 +1924,8 @@ 
ScHorizontalCellIterator::ScHorizontalCellIterator(ScDocument* pDocument, SCTAB
 OSL_FAIL("try to access index out of bounds, FIX IT");
 
 nEndCol = pDoc->maTabs[mnTab]->ClampToAllocatedColumns(nEndCol);
+if (nEndCol < nStartCol) // E.g., somewhere completely outside allocated 
area
+nEndCol = nStartCol - 1; // Empty
 
 maColPositions.reserve( nEndCol-nStartCol+1 );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-14 Thread Tomaž Vajngerl (via logerrit)
 extensions/source/macosx/spotlight/OOoContentDataParser.m |4 
 1 file changed, 4 insertions(+)

New commits:
commit 9f392d0c09bd946e4660ccc2d48ee3ae1367343c
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 15 13:14:53 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 15 08:07:32 2019 +0200

tdf#122172 set textContent to nil in OOoContentDataProvider

This should prevent the crash - at least it did for me AFAICS.

Change-Id: I489264d8054e6577b948b0ab307c863d3140788a
Reviewed-on: https://gerrit.libreoffice.org/70755
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.m 
b/extensions/source/macosx/spotlight/OOoContentDataParser.m
index d394115a3010..89d92a8c126a 100644
--- a/extensions/source/macosx/spotlight/OOoContentDataParser.m
+++ b/extensions/source/macosx/spotlight/OOoContentDataParser.m
@@ -98,6 +98,7 @@
 
 [textContent appendString:[NSString 
stringWithString:runningTextContent]];
 [runningTextContent release];
+runningTextContent = nil;
 }
 shouldReadCharacters = NO;
 }
@@ -125,9 +126,11 @@
 
 if (runningTextContent != nil) {
 [runningTextContent release];
+runningTextContent = nil;
 }
 if (textContent != nil) {
 [textContent release];
+textContent = nil;
 }
 }
 
@@ -137,6 +140,7 @@
 if (textContent != nil && [textContent length] > 0) {
 [mdiValues setObject:[NSString stringWithString:textContent] 
forKey:(NSString*)kMDItemTextContent];
 [textContent release];
+textContent = nil;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

libreoffice-6.2.2.2 component context fails to supply service com.sun.star.ui.ModuleUIConfigurationManager

2019-04-14 Thread John Frankish
Libreoffice-6.2.2.2 compiles on a 32-bit linux system, but will not run.

Strace does not show anything obvious - is there a way to debug the following 
error?

LibreOffice 6.2 - Fatal Error: The application cannot be started. 
component context fails to supply service 
com.sun.star.ui.ModuleUIConfigurationManager of type 
com.sun.star.ui.XModuleUIConfigurationManager2: an error occurred during file 
opening

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

[Libreoffice-commits] core.git: 2 commits - test/source toolkit/source tools/source ucb/source unotools/source uui/source vbahelper/source

2019-04-14 Thread Noel Grandin (via logerrit)
 test/source/sheet/xdatabaserange.cxx   |3 +--
 test/source/sheet/xdatapilotdescriptor.cxx |3 +--
 test/source/sheet/xfunctiondescriptions.cxx|3 +--
 toolkit/source/awt/vclxaccessiblecomponent.cxx |3 +--
 toolkit/source/awt/vclxprinter.cxx |6 ++
 toolkit/source/awt/vclxtoolkit.cxx |3 +--
 toolkit/source/controls/dialogcontrol.cxx  |3 +--
 toolkit/source/controls/geometrycontrolmodel.cxx   |3 +--
 toolkit/source/controls/unocontrolmodel.cxx|3 +--
 tools/source/generic/b3dtrans.cxx  |6 ++
 ucb/source/cacher/cachedcontentresultset.cxx   |3 +--
 ucb/source/cacher/cachedcontentresultsetstub.cxx   |3 +--
 ucb/source/cacher/cacheddynamicresultset.cxx   |3 +--
 ucb/source/cacher/cacheddynamicresultsetstub.cxx   |3 +--
 ucb/source/sorter/sortdynres.cxx   |3 +--
 ucb/source/ucp/gio/gio_content.cxx |3 +--
 ucb/source/ucp/hierarchy/hierarchycontent.cxx  |3 +--
 ucb/source/ucp/package/pkgcontent.cxx  |4 +---
 ucb/source/ucp/tdoc/tdoc_content.cxx   |3 +--
 ucb/source/ucp/webdav-neon/DAVTypes.cxx|   12 
 ucb/source/ucp/webdav-neon/PropfindCache.cxx   |6 ++
 ucb/source/ucp/webdav-neon/webdavcontent.cxx   |3 +--
 unotools/source/config/compatibility.cxx   |3 +--
 unotools/source/config/optionsdlg.cxx  |3 +--
 unotools/source/ucbhelper/ucblockbytes.cxx |3 +--
 uui/source/sslwarndlg.cxx  |5 ++---
 vbahelper/source/msforms/vbatextbox.cxx|9 +++--
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |4 +---
 vbahelper/source/vbahelper/vbafontbase.cxx |3 +--
 vbahelper/source/vbahelper/vbashape.cxx|6 ++
 vbahelper/source/vbahelper/vbashapes.cxx   |3 +--
 31 files changed, 41 insertions(+), 83 deletions(-)

New commits:
commit 897493fbd34a1bd10320767b48cbf04d422f89b3
Author: Noel Grandin 
AuthorDate: Sun Apr 14 16:40:35 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 15 08:37:34 2019 +0200

loplugin:sequentialassign in ucb..vbahelper

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

diff --git a/ucb/source/cacher/cachedcontentresultset.cxx 
b/ucb/source/cacher/cachedcontentresultset.cxx
index c9592879397f..0765e2baed3b 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -2136,8 +2136,7 @@ Reference< XResultSet > SAL_CALL 
CachedContentResultSetFactory
 const Reference< XResultSet > & xSource,
 const Reference< XContentIdentifierMapping > & xMapping )
 {
-Reference< XResultSet > xRet;
-xRet = new CachedContentResultSet( m_xContext, xSource, xMapping );
+Reference< XResultSet > xRet = new CachedContentResultSet( m_xContext, 
xSource, xMapping );
 return xRet;
 }
 
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx 
b/ucb/source/cacher/cachedcontentresultsetstub.cxx
index a648beac5e76..c410c19dfa68 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.cxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx
@@ -572,8 +572,7 @@ Reference< XResultSet > SAL_CALL 
CachedContentResultSetStubFactory
 {
 if( xSource.is() )
 {
-Reference< XResultSet > xRet;
-xRet = new CachedContentResultSetStub( xSource );
+Reference< XResultSet > xRet = new CachedContentResultSetStub( xSource 
);
 return xRet;
 }
 return nullptr;
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx 
b/ucb/source/cacher/cacheddynamicresultset.cxx
index 9f7f5e438b70..ba1f72616071 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -227,8 +227,7 @@ Reference< XDynamicResultSet > SAL_CALL 
CachedDynamicResultSetFactory
   const Reference< XDynamicResultSet > & SourceStub
 , const Reference< XContentIdentifierMapping > & 
ContentIdentifierMapping )
 {
-Reference< XDynamicResultSet > xRet;
-xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, 
m_xContext );
+Reference< XDynamicResultSet > xRet = new CachedDynamicResultSet( 
SourceStub, ContentIdentifierMapping, m_xContext );
 return xRet;
 }
 
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx 
b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 679ddbc0823a..927a6ac4e08c 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -218,8 +218,7 @@ Reference< XDynamicResultSet > SAL_CALL 
CachedDynamicResultSetStubFactory
 ::createCachedDynamicResultSetStub(
 const Reference< XDynamicResultSet > & Source )
 

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

2019-04-14 Thread Mike Kaganski (via logerrit)
 sc/qa/extras/macros-test.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 9cd36c589b51aa2b4b18534cd4f7d282827c9466
Author: Mike Kaganski 
AuthorDate: Mon Apr 15 08:36:47 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Apr 15 08:38:37 2019 +0200

Report failing document in ScMacrosTest::testVba

Change-Id: I7ce2e8ab0bdc4b6799cd351828b7b3c24ebb1a96
Reviewed-on: https://gerrit.libreoffice.org/70757
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index c801415fd2a5..de71456f1b79 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -335,7 +335,10 @@ void ScMacrosTest::testVba()
 OUString aStringRes;
 aRet >>= aStringRes;
 CPPUNIT_ASSERT_EQUAL_MESSAGE(
-"script reported failure", OUString("OK"), aStringRes);
+OUString("script reported failure in file " + 
testInfo[i].sFileBaseName + "xls")
+.toUtf8()
+.getStr(),
+OUString("OK"), aStringRes);
 pFoundShell->DoClose();
 if ( bWorkbooksHandling )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - accessibility/source basctl/source chart2/source compilerplugins/clang connectivity/source cppu/qa cui/source desktop/source drawinglayer/source editeng/sou

2019-04-14 Thread Noel Grandin (via logerrit)
 accessibility/source/standard/vclxaccessibletoolbox.cxx |2 
 basctl/source/basicide/scriptdocument.cxx   |2 
 basctl/source/dlged/managelang.cxx  |4 -
 chart2/source/controller/main/ChartController_Insert.cxx|4 -
 chart2/source/controller/main/ChartController_Properties.cxx|2 
 chart2/source/model/template/ChartTypeTemplate.cxx  |2 
 chart2/source/tools/LifeTime.cxx|6 -
 chart2/source/tools/MeanValueRegressionCurveCalculator.cxx  |2 
 compilerplugins/clang/sharedvisitor/sharedvisitor.cxx   |5 +
 compilerplugins/clang/simplifyconstruct.cxx |   37 
++
 compilerplugins/clang/test/simplifyconstruct.cxx|   31 

 connectivity/source/commontools/RowFunctionParser.cxx   |2 
 cppu/qa/test_any.cxx|2 
 cui/source/customize/cfg.cxx|4 -
 cui/source/dialogs/screenshotannotationdlg.cxx  |   18 ++--
 desktop/source/app/officeipcthread.cxx  |2 
 drawinglayer/source/tools/converters.cxx|4 -
 editeng/source/items/frmitems.cxx   |2 
 editeng/source/misc/svxacorr.cxx|2 
 filter/source/flash/swfwriter.cxx   |2 
 i18npool/source/indexentry/genindex_data.cxx|2 
 jvmfwk/source/elements.cxx  |   15 +---
 libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx |2 
 linguistic/source/convdic.cxx   |4 -
 linguistic/source/dicimp.cxx|4 -
 linguistic/source/dlistimp.cxx  |2 
 oox/source/export/drawingml.cxx |2 
 sal/osl/unx/file_path_helper.cxx|2 
 sal/osl/unx/uunxapi.cxx |2 
 sc/source/core/data/colorscale.cxx  |2 
 sc/source/core/opencl/formulagroupcl.cxx|2 
 sc/source/filter/excel/xetable.cxx  |2 
 sc/source/ui/app/rfindlst.cxx   |4 -
 sc/source/ui/view/viewdata.cxx  |2 
 sd/qa/unit/export-tests-ooxml2.cxx  |2 
 sd/source/filter/ppt/pptin.cxx  |2 
 sd/source/ui/animations/CustomAnimationDialog.cxx   |2 
 sd/source/ui/dlg/PhotoAlbumDialog.cxx   |2 
 sd/source/ui/slidesorter/view/SlsTheme.cxx  |4 -
 sfx2/source/appl/appserv.cxx|2 
 sfx2/source/appl/newhelp.cxx|2 
 sfx2/source/dialog/backingwindow.cxx|2 
 slideshow/source/engine/slide/userpaintoverlay.cxx  |2 
 slideshow/source/engine/transitions/combtransition.cxx  |2 
 svl/source/fsstor/fsstorage.cxx |3 
 svtools/source/uno/unoiface.cxx |4 -
 svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx   |2 
 svx/source/form/fmpgeimp.cxx|2 
 svx/source/items/algitem.cxx|2 
 svx/source/items/pageitem.cxx   |2 
 sw/qa/core/uwriter.cxx  |4 -
 sw/qa/extras/odfexport/odfexport.cxx|2 
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx   |2 
 sw/qa/extras/rtfexport/rtfexport.cxx|2 
 sw/qa/extras/uiwriter/uiwriter.cxx  |4 -
 sw/source/core/crsr/DropDownFormFieldButton.cxx |3 
 sw/source/core/doc/doctxm.cxx   |2 
 sw/source/core/edit/autofmt.cxx |   12 +--
 sw/source/core/fields/reffld.cxx|2 
 sw/source/core/text/frmcrsr.cxx |2 
 sw/source/core/text/guess.cxx   |2 
 sw/source/core/text/porlay.cxx  |2 
 sw/source/core/text/pormulti.cxx|4 -
 sw/source/core/txtnode/fntcache.cxx |2 
 sw/source/filter/html/htm

CppunitTest_sc_macros_test fails after commit 7282014e362a1529a36c88eb308df8ed359c2cfa

2019-04-14 Thread Kaganski Mike
Hi!

After commit 7282014e362a1529a36c88eb308df8ed359c2cfa, now 
CppunitTest_sc_macros_test fails when testing 
sc/qa/extras/testdocuments/Window.xls:

> C:/lo/src/core/sc/qa/extras/macros-test.cxx(338) : error : Assertion
> Test name: ScMacrosTest::testVba
> equality assertion failed
> - Expected: OK
> - Actual  : Test Results
> 
> 
>  Failed:  : Window.LargeScroll(ToLeft): ScrollColumn is: 10
>  Failed:  : Window.SmallScroll(ToLeft): ScrollColumn is: 10
>  Failed:  : Pane.LargeScroll(ToLeft): ScrollColumn is: 10
>  Failed:  : Pane.SmallScroll(ToLeft): ScrollColumn is: 10
> Tests passed: 26
> Tests failed: 4
> 
> - script reported failure in file Window.xls
> 
> Failures !!!
> Run: 5   Failure total: 1   Failures: 1   Errors: 0

Opening the said spreadsheet in master and performing the test also 
gives that error *if* Calc window is wide enough to show more than 16 
full columns. The problem is that after the first 64 columns, the width 
of them unexpectedly changes; so page-scrolling 3 pages right starts to 
show less then 16 full columns, which changes result of page-scrolling 3 
pages left.

I.e., with 17 full columns visible initially (last full column Q), 
calling LargeScroll to scroll 3 pages right makes first visible column 
AZ, and last visible full column is 52 (BO; 17*3+1) => 16 visible 
columns. Now calling LargeScroll to scroll 3 pages left moves to 16*3=48 
columns left => first visible would become D (while A expected).

Also the columns BM and later don't show normal grid.

Noel, does this ring a bell? How to make all unallocated columns to have 
standard width and grid?

-- 
Best regards,
Mike Kaganski
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: libreoffice-6.2.2.2 component context fails to supply service com.sun.star.ui.ModuleUIConfigurationManager

2019-04-14 Thread Stephan Bergmann

On 15/04/2019 08:19, John Frankish wrote:

Libreoffice-6.2.2.2 compiles on a 32-bit linux system, but will not run.

Strace does not show anything obvious - is there a way to debug the following 
error?

LibreOffice 6.2 - Fatal Error: The application cannot be started.
component context fails to supply service 
com.sun.star.ui.ModuleUIConfigurationManager of type 
com.sun.star.ui.XModuleUIConfigurationManager2: an error occurred during file 
opening


That's an atypical combination of "component context fails to supply 
service ..." (thrown from generated code, presumably during 
css::ui::ModuleUIConfigurationManager::createDefault in 
ModuleUIConfigurationManagerSupplier::getUIConfigurationManager, 
framework/source/uiconfiguration/moduleuicfgsupplier.cxx) and "an error 
occurred during file opening" (the underlying error, generated in 
fileaccess::throw_handler, ucb/source/ucp/file/filglob.cxx) errors. 
Maybe an `strace -f` output would tell more after all---if you can put 
it somewhere I can have a look.


Another place that might be useful to debug is the 
ModuleUIConfigurationManager constructor in 
framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx, if it 
is reached at all.  Also, configuring the build with --enable-debug or 
even --enable-dbgutil (where adding at least the latter requires a 
from-scratch rebuild via `make clean`, though) might give further useful 
stderr output.


What's the configure switches for your build?
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

[Libreoffice-commits] core.git: sd/uiconfig sd/UIConfig_simpress.mk solenv/sanitizers

2019-04-14 Thread Samuel Mehrbrodt (via logerrit)
 sd/UIConfig_simpress.mk|1 
 sd/uiconfig/simpress/ui/customanimationspanelhorizontal.ui |  437 -
 solenv/sanitizers/ui/modules/simpress.suppr|   13 
 3 files changed, 451 deletions(-)

New commits:
commit e21bc3267776d89e26368b62963fc57dc792f743
Author: Samuel Mehrbrodt 
AuthorDate: Fri Apr 12 17:12:46 2019 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Apr 15 08:57:45 2019 +0200

Remove unused customanimationspanelhorizontal.ui

Unused after 3df141b2084d3abc1587ef24d2b371b779bb3d50

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

diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index f17c0ecd2b26..bc12bca51f4f 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -108,7 +108,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/annotationtagmenu \
sd/uiconfig/simpress/ui/currentmastermenu \
sd/uiconfig/simpress/ui/customanimationspanel \
-   sd/uiconfig/simpress/ui/customanimationspanelhorizontal \
sd/uiconfig/simpress/ui/customanimationproperties \
sd/uiconfig/simpress/ui/customanimationeffecttab \
sd/uiconfig/simpress/ui/customanimationfragment \
diff --git a/sd/uiconfig/simpress/ui/customanimationspanelhorizontal.ui 
b/sd/uiconfig/simpress/ui/customanimationspanelhorizontal.ui
deleted file mode 100644
index f188bed4b705..
--- a/sd/uiconfig/simpress/ui/customanimationspanelhorizontal.ui
+++ /dev/null
@@ -1,437 +0,0 @@
-
-
-
-  
-  
-  
-True
-False
-cmd/sc_moveup.png
-  
-  
-True
-False
-cmd/sc_moveup.png
-2
-  
-  
-True
-False
-cmd/sc_moveup.png
-2
-  
-  
-True
-False
-cmd/sc_moveup.png
-  
-  
-True
-False
-cmd/sc_moveup.png
-2
-  
-  
-True
-False
-cmd/sc_moveup.png
-2
-  
-  
-True
-False
-vertical
-
-  
-70
-True
-False
-True
-6
-
-  
-350
-True
-False
-vertical
-center
-
-  
-True
-True
-True
-True
-immediate
-
-  
-
-  
-  
-False
-True
-0
-  
-
-  
-  
-False
-True
-0
-  
-
-
-  
-True
-False
-2
-6
-True
-center
-
-  
-True
-True
-True
-True
-Add 
Effect
-image_add1
-  
-  
-0
-0
-  
-
-
-  
-True
-True
-True
-True
-Remove 
Effect
-image_remove1
-  
-  
-0
-1
-  
-
-
-  
-True
-True
-True
-True
-Move 
Up
-image_up
-  
-  
-1
-0
-  
-
-
-  
-True
-True
-True
-True
-Move 
Down
-image_down
-  
-  
-1
-1
-  
-
-  
-  
-False
-True
-1
-  
-
-
-  
-300
-True
-False
-3
-6
-center
-
-  
-True
-False
-end
-_Start:
-True
-  
-  
-0
-0
-  
-
-
-  
-True
-False
-end
-_Direction:
-True
-  
-  
-0
-1
-  
-
-
-  
-True
-False
-True
-
-  On click
-  With previous
-  After 
previous
-
-  
-  
-1
-0
-  
-
-
-