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

2021-07-06 Thread merttumer (via logerrit)
 include/vcl/outdev.hxx |2 
 vcl/source/outdev/textline.cxx |  103 +++--
 2 files changed, 102 insertions(+), 3 deletions(-)

New commits:
commit 0759191e6923945469bc426b2c322ddeade12e09
Author: merttumer 
AuthorDate: Wed Jun 16 21:04:33 2021 +0300
Commit: Mert Tumer 
CommitDate: Wed Jul 7 08:05:58 2021 +0200

Cache a static wavy line as bitmap and reuse it

DrawWaveLine is cpu costly so render it as big as
possible so we can only crop it
Edit:
1) Moved the Cache class to textline.cxx file
as it is local to that
2) Provided a custom hash method for the unordered_map
to avoid double hashing the key. Used boost:hash_combine
for hashing.
3) changed unordered_map to o3tl::lru_map

Change-Id: I0ab191f7bb72ccd5074c78858de9831c1a462b7b
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117362
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117969
Tested-by: Jenkins

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ac688f5f2556..eb3c7815450a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -752,6 +752,8 @@ private:
 SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const 
basegfx::B2DPolyPolygon& rB2DPolyPoly);
 ///@}
 
+SAL_DLLPRIVATE void ImplDrawWaveLineBezier(tools::Long nStartX, 
tools::Long nStartY, tools::Long nEndX, tools::Long nEndY, tools::Long 
nWaveHeight, double fOrientation, tools::Long nLineWidth);
+
 
 /** @name Curved shape functions
  */
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 046952cf403a..8b22aa8fb847 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -33,10 +34,72 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #define UNDERLINE_LAST  LINESTYLE_BOLDWAVE
 #define STRIKEOUT_LAST  STRIKEOUT_X
 
+namespace {
+struct WavyLineCache final
+{
+WavyLineCache () : m_aItems( 10 ) {}
+
+bool find( Color aLineColor, size_t nLineWidth, size_t nWaveHeight, 
size_t nWordWidth, BitmapEx& rOutput )
+{
+Key aKey = { nWaveHeight, sal_uInt32(aLineColor) };
+auto item = m_aItems.find( aKey );
+if ( item == m_aItems.end() )
+return false;
+// needs update
+if ( item->second.m_aLineWidth != nLineWidth || 
item->second.m_aWordWidth < nWordWidth )
+{
+return false;
+}
+rOutput = item->second.m_Bitmap;
+return true;
+}
+
+void insert( const BitmapEx& aBitmap, const Color& aLineColor, const 
size_t nLineWidth, const size_t nWaveHeight, const size_t nWordWidth, BitmapEx& 
rOutput )
+{
+Key aKey = { nWaveHeight, sal_uInt32(aLineColor) };
+m_aItems.insert( std::pair< Key, WavyLineCacheItem>( aKey, { 
nLineWidth, nWordWidth, aBitmap } ) );
+rOutput = aBitmap;
+}
+
+private:
+struct WavyLineCacheItem
+{
+size_t m_aLineWidth;
+size_t m_aWordWidth;
+BitmapEx m_Bitmap;
+};
+
+struct Key
+{
+size_t m_aFirst;
+size_t m_aSecond;
+bool operator ==( const Key& rOther ) const
+{
+return ( m_aFirst == rOther.m_aFirst && m_aSecond == 
rOther.m_aSecond );
+}
+};
+
+struct Hash
+{
+size_t operator() ( const Key& rKey ) const
+{
+size_t aSeed = 0;
+boost::hash_combine(aSeed, rKey.m_aFirst);
+boost::hash_combine(aSeed, rKey.m_aSecond);
+return aSeed;
+}
+};
+
+o3tl::lru_map< Key, WavyLineCacheItem, Hash > m_aItems;
+};
+}
+
 void OutputDevice::ImplInitTextLineSize()
 {
 mpFontInstance->mxFontMetric->ImplInitTextLineSize( this );
@@ -1002,6 +1065,43 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
 nLineWidth = 0;
 }
 
+if ( fOrientation == 0.0 )
+{
+static vcl::DeleteOnDeinit< WavyLineCache > snLineCache( new 
WavyLineCache() );
+if ( !snLineCache.get() )
+return;
+WavyLineCache& rLineCache = *snLineCache.get();
+BitmapEx aWavylinebmp;
+if ( !rLineCache.find( GetLineColor(), nLineWidth, nWaveHeight, nEndX 
- nStartX, aWavylinebmp ) )
+{
+size_t nWordLength = nEndX - nStartX;
+// start with something big to avoid updating it frequently
+nWordLength = nWordLength < 1024 ? 1024 : nWordLength;
+ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, 
DeviceFormat::DEFAULT,
+   

[Libreoffice-commits] core.git: vcl/jsdialog

2021-07-06 Thread merttumer (via logerrit)
 vcl/jsdialog/executor.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c18d2b46a37893acb7922c5dc49ddc4631a2c05d
Author: merttumer 
AuthorDate: Mon Jun 7 20:16:50 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Jul 6 11:26:37 2021 +0200

Fix click on the drawing area of CSV dialog

Change-Id: I8c13698b5e9e2e9c8869aa9094ce93c38bf2276f
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116796
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117968
Tested-by: Jenkins

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 39d39601c02f..13cc7591d587 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -153,7 +153,11 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
 {
 double posX = std::atof(clickPosX.data());
 double posY = std::atof(clickPosY.data());
-Size size = pArea->get_size_request();
+OutputDevice& rRefDevice = pArea->get_ref_device();
+// We send OutPutSize for the drawing area bitmap
+// get_size_request is not necessarily updated
+// therefore it may be incorrect.
+Size size = rRefDevice.GetOutputSize();
 posX = posX * size.Width();
 posY = posY * size.Height();
 LOKTrigger::trigger_click(*pArea, Point(posX, 
posY));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - include/vcl vcl/source

2021-06-28 Thread merttumer (via logerrit)
 include/vcl/outdev.hxx |2 
 vcl/source/outdev/textline.cxx |  101 +++--
 2 files changed, 100 insertions(+), 3 deletions(-)

New commits:
commit 2cf427b9e986beadc638e40e0819f0526a9a7f93
Author: merttumer 
AuthorDate: Wed Jun 16 21:04:33 2021 +0300
Commit: Michael Meeks 
CommitDate: Mon Jun 28 10:07:35 2021 +0200

Cache a static wavy line as bitmap and reuse it

DrawWaveLine is cpu costly so render it as big as
possible so we can only crop it
Edit:
1) Moved the Cache class to textline.cxx file
as it is local to that
2) Provided a custom hash method for the unordered_map
to avoid double hashing the key. Used boost:hash_combine
for hashing.
3) changed unordered_map to o3tl::lru_map

Change-Id: I0ab191f7bb72ccd5074c78858de9831c1a462b7b
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117362
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117967

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ec40d6f46294..ac5fa932a5b0 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -878,6 +878,8 @@ private:
 SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const 
basegfx::B2DPolyPolygon& rB2DPolyPoly);
 ///@}
 
+SAL_DLLPRIVATE void ImplDrawWaveLineBezier(long nStartX, long 
nStartY, long nEndX, long nEndY, long nWaveHeight, double fOrientation, long 
nLineWidth);
+
 
 /** @name Curved shape functions
  */
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 09ee52f6339a..7b1ca2dede0b 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -33,10 +34,70 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #define UNDERLINE_LAST  LINESTYLE_BOLDWAVE
 #define STRIKEOUT_LAST  STRIKEOUT_X
 
+struct WavyLineCache final
+{
+WavyLineCache () : m_aItems( 10 ) {}
+
+bool find( Color aLineColor, size_t nLineWidth, size_t nWaveHeight, size_t 
nWordWidth, BitmapEx& rOutput )
+{
+Key aKey = { nWaveHeight, aLineColor.mValue };
+auto item = m_aItems.find( aKey );
+if ( item == m_aItems.end() )
+return false;
+// needs update
+if ( item->second.m_aLineWidth != nLineWidth || 
item->second.m_aWordWidth < nWordWidth )
+{
+return false;
+}
+rOutput = item->second.m_Bitmap;
+return true;
+}
+
+void insert( const BitmapEx& aBitmap, const Color& aLineColor, const 
size_t nLineWidth, const size_t nWaveHeight, const size_t nWordWidth, BitmapEx& 
rOutput )
+{
+Key aKey = { nWaveHeight, aLineColor.mValue };
+m_aItems.insert( std::pair< Key, WavyLineCacheItem>( aKey, { 
nLineWidth, nWordWidth, aBitmap } ) );
+rOutput = aBitmap;
+}
+
+private:
+struct WavyLineCacheItem
+{
+size_t m_aLineWidth;
+size_t m_aWordWidth;
+BitmapEx m_Bitmap;
+};
+
+struct Key
+{
+size_t m_aFirst;
+size_t m_aSecond;
+bool operator ==( const Key& rOther ) const
+{
+return ( m_aFirst == rOther.m_aFirst && m_aSecond == 
rOther.m_aSecond );
+}
+};
+
+struct Hash
+{
+size_t operator() ( const Key& rKey ) const
+{
+size_t aSeed = 0;
+boost::hash_combine(aSeed, rKey.m_aFirst);
+boost::hash_combine(aSeed, rKey.m_aSecond);
+return aSeed;
+}
+};
+
+o3tl::lru_map< Key, WavyLineCacheItem, Hash > m_aItems;
+};
+
 void OutputDevice::ImplInitTextLineSize()
 {
 mpFontInstance->mxFontMetric->ImplInitTextLineSize( this );
@@ -1001,6 +1062,43 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
 nLineWidth = 0;
 }
 
+if ( fOrientation == 0.0 )
+{
+static vcl::DeleteOnDeinit< WavyLineCache > snLineCache( new 
WavyLineCache() );
+if ( !snLineCache.get() )
+return;
+WavyLineCache& rLineCache = *snLineCache.get();
+BitmapEx aWavylinebmp;
+if ( !rLineCache.find( GetLineColor(), nLineWidth, nWaveHeight, nEndX 
- nStartX, aWavylinebmp ) )
+{
+size_t nWordLength = nEndX - nStartX;
+// start with something big to avoid updating it frequently
+nWordLength = nWordLength < 1024 ? 1024 : nWordLength;
+ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, 
DeviceFormat::DEFAULT,
+   
DeviceFormat::DEFAULT );
+pVirtDev->SetAntialiasing( AntialiasingFlags::Enable );
+pVirtDev->SetOutputSizePixel( Size( nWordLength, nWaveHeight * 2 
), false );
+pVirtDev->SetLineColor( GetLineColor() )

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

2021-06-24 Thread merttumer (via logerrit)
 include/vcl/outdev.hxx |2 
 vcl/source/outdev/textline.cxx |  101 +++--
 2 files changed, 100 insertions(+), 3 deletions(-)

New commits:
commit c2559714a7637a659d839d8ac42f6e9263159882
Author: merttumer 
AuthorDate: Wed Jun 16 21:04:33 2021 +0300
Commit: Michael Meeks 
CommitDate: Thu Jun 24 18:05:18 2021 +0200

Cache a static wavy line as bitmap and reuse it

DrawWaveLine is cpu costly so render it as big as
possible so we can only crop it
Edit:
1) Moved the Cache class to textline.cxx file
as it is local to that
2) Provided a custom hash method for the unordered_map
to avoid double hashing the key. Used boost:hash_combine
for hashing.
3) changed unordered_map to o3tl::lru_map

Change-Id: I0ab191f7bb72ccd5074c78858de9831c1a462b7b
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117362
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d9b6651e0c9e..137eda8f533f 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -854,6 +854,8 @@ private:
 SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const 
basegfx::B2DPolyPolygon& rB2DPolyPoly);
 ///@}
 
+SAL_DLLPRIVATE void ImplDrawWaveLineBezier(long nStartX, long 
nStartY, long nEndX, long nEndY, long nWaveHeight, double fOrientation, long 
nLineWidth);
+
 
 /** @name Curved shape functions
  */
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index e52b02410ebd..452a9dbfdfe9 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -33,10 +34,70 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #define UNDERLINE_LAST  LINESTYLE_BOLDWAVE
 #define STRIKEOUT_LAST  STRIKEOUT_X
 
+struct WavyLineCache final
+{
+WavyLineCache () : m_aItems( 10 ) {}
+
+bool find( Color aLineColor, size_t nLineWidth, size_t nWaveHeight, size_t 
nWordWidth, BitmapEx& rOutput )
+{
+Key aKey = { nWaveHeight, aLineColor.mValue };
+auto item = m_aItems.find( aKey );
+if ( item == m_aItems.end() )
+return false;
+// needs update
+if ( item->second.m_aLineWidth != nLineWidth || 
item->second.m_aWordWidth < nWordWidth )
+{
+return false;
+}
+rOutput = item->second.m_Bitmap;
+return true;
+}
+
+void insert( const BitmapEx& aBitmap, const Color& aLineColor, const 
size_t nLineWidth, const size_t nWaveHeight, const size_t nWordWidth, BitmapEx& 
rOutput )
+{
+Key aKey = { nWaveHeight, aLineColor.mValue };
+m_aItems.insert( std::pair< Key, WavyLineCacheItem>( aKey, { 
nLineWidth, nWordWidth, aBitmap } ) );
+rOutput = aBitmap;
+}
+
+private:
+struct WavyLineCacheItem
+{
+size_t m_aLineWidth;
+size_t m_aWordWidth;
+BitmapEx m_Bitmap;
+};
+
+struct Key
+{
+size_t m_aFirst;
+size_t m_aSecond;
+bool operator ==( const Key& rOther ) const
+{
+return ( m_aFirst == rOther.m_aFirst && m_aSecond == 
rOther.m_aSecond );
+}
+};
+
+struct Hash
+{
+size_t operator() ( const Key& rKey ) const
+{
+size_t aSeed = 0;
+boost::hash_combine(aSeed, rKey.m_aFirst);
+boost::hash_combine(aSeed, rKey.m_aSecond);
+return aSeed;
+}
+};
+
+o3tl::lru_map< Key, WavyLineCacheItem, Hash > m_aItems;
+};
+
 void OutputDevice::ImplInitTextLineSize()
 {
 mpFontInstance->mxFontMetric->ImplInitTextLineSize( this );
@@ -1000,6 +1061,43 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, lo
 nLineWidth = 1;
 }
 
+if ( fOrientation == 0.0 )
+{
+static vcl::DeleteOnDeinit< WavyLineCache > snLineCache( new 
WavyLineCache() );
+if ( !snLineCache.get() )
+return;
+WavyLineCache& rLineCache = *snLineCache.get();
+BitmapEx aWavylinebmp;
+if ( !rLineCache.find( GetLineColor(), nLineWidth, nWaveHeight, nEndX 
- nStartX, aWavylinebmp ) )
+{
+size_t nWordLength = nEndX - nStartX;
+// start with something big to avoid updating it frequently
+nWordLength = nWordLength < 1024 ? 1024 : nWordLength;
+ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, 
DeviceFormat::DEFAULT,
+   
DeviceFormat::DEFAULT );
+pVirtDev->SetAntialiasing( AntialiasingFlags::EnableB2dDraw );
+pVirtDev->SetOutputSizePixel( Size( nWordLength, nWaveHeight * 2 
), false );
+pVirtDev->SetLineColor( GetLineColor() );
+pVirtDev->SetBackground( Wallpaper( COL_TR

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

2021-06-15 Thread merttumer (via logerrit)
 svx/source/table/tablecontroller.cxx |   30 ++
 1 file changed, 22 insertions(+), 8 deletions(-)

New commits:
commit 690d7b87eda38b54585fed2fc16181897ecbf98d
Author: merttumer 
AuthorDate: Mon May 17 05:52:01 2021 +0300
Commit: Andras Timar 
CommitDate: Tue Jun 15 09:18:44 2021 +0200

Implemented Delete key deletes the table when all the cells are selected

Change-Id: I8a17c73781a3399b214d5655b83036652933a90a
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115689
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117191
Reviewed-by: Andras Timar 

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 04d0d7a17bc6..d7028fe42c0c 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1386,30 +1386,44 @@ bool SvxTableController::DeleteMarked()
 SdrTableObj& rTableObj(*mxTableObj.get());
 SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
 const bool bUndo(rModel.IsUndoEnabled());
+bool bDeleteTable = false;
 
 if (bUndo)
 rModel.BegUndo(SvxResId(STR_TABLE_DELETE_CELL_CONTENTS));
 
 CellPos aStart, aEnd;
 getSelectedCells( aStart, aEnd );
-for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+const sal_Int32 nRemovedColumns = aEnd.mnCol - aStart.mnCol + 1;
+const sal_Int32 nRemovedRows = aEnd.mnRow - aStart.mnRow + 1;
+if( nRemovedColumns == mxTable->getColumnCount() && nRemovedRows == 
mxTable->getRowCount())
 {
-for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+bDeleteTable = true;
+}
+else
+{
+for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
 {
-CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( 
nCol, nRow ).get() ) );
-if (xCell.is() && xCell->hasText())
+for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
 {
-if (bUndo)
-xCell->AddUndo();
-xCell->SetOutlinerParaObject(nullptr);
+CellRef xCell( dynamic_cast< Cell* >( 
mxTable->getCellByPosition( nCol, nRow ).get() ) );
+if (xCell.is() && xCell->hasText())
+{
+if (bUndo)
+xCell->AddUndo();
+xCell->SetOutlinerParaObject(nullptr);
+}
 }
 }
 }
 
+if (bDeleteTable)
+mrView.DeleteMarkedObj();
+
 if (bUndo)
 rModel.EndUndo();
 
-UpdateTableShape();
+if (!bDeleteTable)
+UpdateTableShape();
 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.2' - svx/source

2021-06-15 Thread merttumer (via logerrit)
 svx/source/table/svdotable.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 179e4e6901bdaf6577bad92817578c3b33a8514d
Author: merttumer 
AuthorDate: Thu Apr 15 11:27:08 2021 +0300
Commit: Andras Timar 
CommitDate: Tue Jun 15 09:18:28 2021 +0200

Fix Row size change is not updated

Row size is not taken into account when there is a change
Only if column size/position changes, it starts updating

Change-Id: I99f3aa9fe0e7f3428234062a2520ca8a61984067
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114130
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117190
Reviewed-by: Andras Timar 

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 45d184403c56..18ac30472a7b 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -243,6 +243,7 @@ private:
 static sal_Int32 lastRowCount;
 static sal_Int32 lastColCount;
 static std::vector lastColWidths;
+static bool rowSizeChanged;
 };
 
 SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = nullptr;
@@ -253,6 +254,7 @@ bool SdrTableObjImpl::lastLayoutFitHeight;
 WritingMode SdrTableObjImpl::lastLayoutMode;
 sal_Int32 SdrTableObjImpl::lastRowCount;
 sal_Int32 SdrTableObjImpl::lastColCount;
+bool SdrTableObjImpl::rowSizeChanged = false;
 std::vector SdrTableObjImpl::lastColWidths;
 
 SdrTableObjImpl::SdrTableObjImpl()
@@ -594,6 +596,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int 
nEdge, sal_Int32 nOffset
 Reference< XIndexAccess > xRows( mxTable->getRows(), 
UNO_QUERY_THROW );
 Reference< XPropertySet > xRowSet( xRows->getByIndex( 
(!nEdge)?nEdge:(nEdge-1) ), UNO_QUERY_THROW );
 xRowSet->setPropertyValue( sSize, Any( nHeight ) );
+rowSizeChanged = true;
 }
 }
 else
@@ -798,7 +801,8 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 || lastLayoutMode != writingMode
 || lastRowCount != getRowCount()
 || lastColCount != getColumnCount()
-|| lastColWidths != getColumnWidths() )
+|| lastColWidths != getColumnWidths()
+|| rowSizeChanged )
 {
 lastLayoutTable = this;
 lastLayoutInputRectangle = rArea;
@@ -813,6 +817,7 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 TableModelNotifyGuard aGuard( mxTable.get() );
 mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
 lastLayoutResultRectangle = rArea;
+rowSizeChanged = false;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-15 Thread merttumer (via logerrit)
 include/svx/sdr/table/tablecontroller.hxx |1 +
 include/svx/selectioncontroller.hxx   |2 ++
 svx/source/svdraw/selectioncontroller.cxx |4 
 svx/source/svdraw/svdview.cxx |   29 -
 svx/source/table/tablecontroller.cxx  |   15 ---
 5 files changed, 43 insertions(+), 8 deletions(-)

New commits:
commit aeaceb5b880f886ce01927f26b4bd9602315292c
Author: merttumer 
AuthorDate: Thu Apr 15 11:25:00 2021 +0300
Commit: Andras Timar 
CommitDate: Tue Jun 15 09:18:14 2021 +0200

Implemented CTRL + A selects all the cells

When the table is selected, ctrl + a should select
all the cells unless text editing is enabled.
The previous behavior was deselecting the table and
marking all the objects. However, for table it should
select all the cells instead.

Change-Id: I9fb512618a61a96ff21daa74c5a4ae9b31e3906e
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114129
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117189
Reviewed-by: Andras Timar 

diff --git a/include/svx/sdr/table/tablecontroller.hxx 
b/include/svx/sdr/table/tablecontroller.hxx
index cec83b996c87..9018e2587a2d 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -58,6 +58,7 @@ public:
 SVX_DLLPRIVATE virtual bool DeleteMarked() override;
 
 SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
+SVX_DLLPRIVATE virtual void onSelectAll() override;
 
 SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
 SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ) override;
diff --git a/include/svx/selectioncontroller.hxx 
b/include/svx/selectioncontroller.hxx
index 11acdac3cd59..3ce5f7849ec3 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -51,6 +51,8 @@ public:
 
 virtual void onSelectionHasChanged();
 
+virtual void onSelectAll();
+
 virtual void GetState( SfxItemSet& rSet );
 virtual void Execute( SfxRequest& rReq );
 
diff --git a/svx/source/svdraw/selectioncontroller.cxx 
b/svx/source/svdraw/selectioncontroller.cxx
index 8cb678d66467..bc31a7543366 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -47,6 +47,10 @@ void SelectionController::onSelectionHasChanged()
 {
 }
 
+void SelectionController::onSelectAll()
+{
+}
+
 void SelectionController::GetState( SfxItemSet& /*rSet*/ )
 {
 }
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index c68bbe443a72..ad6e4beb7cc4 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1359,7 +1360,33 @@ void SdrView::MarkAll()
 #endif
 } else if (IsGluePointEditMode()) MarkAllGluePoints();
 else if (HasMarkablePoints()) MarkAllPoints();
-else MarkAllObj();
+else {
+// check for table
+bool bMarkAll = true;
+const SdrMarkList& rMarkList = GetMarkedObjectList();
+if (rMarkList.GetMarkCount() == 1)
+{
+const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
+SdrView* pView(dynamic_cast(this));
+if (pObj && pView && (pObj->GetObjInventor() == 
SdrInventor::Default)
+&& (pObj->GetObjIdentifier() == OBJ_TABLE))
+{
+mxSelectionController.clear();
+mxSelectionController = sdr::table::CreateTableController(
+*pView, static_cast(*pObj),
+mxLastSelectionController);
+
+if (mxSelectionController.is())
+{
+mxLastSelectionController.clear();
+mxSelectionController->onSelectAll();
+bMarkAll = false;
+}
+}
+}
+if ( bMarkAll )
+MarkAllObj();
+}
 }
 
 void SdrView::UnmarkAll()
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index e4183878c637..04d0d7a17bc6 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -410,6 +410,14 @@ void SvxTableController::onSelectionHasChanged()
 destroySelectionOverlay();
 }
 }
+void SvxTableController::onSelectAll()
+{
+sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
+if ( pTableObj && !pTableObj->IsTextEditActive())
+{
+selectAll();
+}
+}
 
 
 void SvxTableController::GetState( SfxItemSet& rSet )
commit ebe0ba78ca7f6767351023a93fd03a0f336c4189
Author: merttumer 
AuthorDate: Thu Apr 15 11:21:01 2021 +0300
Commit: Andras Timar 
CommitDate: Tue Jun 15 09:17:59 2021 +0200

Fix ESC key selects all the cells of the table object

Selecting the table s

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/jsdialog

2021-06-08 Thread merttumer (via logerrit)
 vcl/jsdialog/executor.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 77f168f1f10313268a6d38db3e65929f4b9af440
Author: merttumer 
AuthorDate: Mon Jun 7 20:16:50 2021 +0300
Commit: Szymon Kłos 
CommitDate: Tue Jun 8 14:12:17 2021 +0200

Fix click on the drawing area of CSV dialog

Change-Id: I8c13698b5e9e2e9c8869aa9094ce93c38bf2276f
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116796
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit cb7a97c6ecf0bc1fbbf8a8b3494ed581cb9fb310)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116708

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 288ce5703d62..d5d22d984891 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -158,7 +158,11 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
 {
 double posX = std::atof(clickPosX.getStr());
 double posY = std::atof(clickPosY.getStr());
-Size size = pArea->get_size_request();
+OutputDevice& rRefDevice = pArea->get_ref_device();
+// We send OutPutSize for the drawing area bitmap
+// get_size_request is not necessarily updated
+// therefore it may be incorrect.
+Size size = rRefDevice.GetOutputSize();
 posX = posX * size.Width();
 posY = posY * size.Height();
 LOKTrigger::trigger_click(*pArea, Point(posX, 
posY));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-08 Thread merttumer (via logerrit)
 vcl/jsdialog/executor.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit cb7a97c6ecf0bc1fbbf8a8b3494ed581cb9fb310
Author: merttumer 
AuthorDate: Mon Jun 7 20:16:50 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Jun 8 09:58:41 2021 +0200

Fix click on the drawing area of CSV dialog

Change-Id: I8c13698b5e9e2e9c8869aa9094ce93c38bf2276f
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116796
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 4ce9b50e0364..4ee9865e5437 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -157,7 +157,11 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
 {
 double posX = std::atof(clickPosX.getStr());
 double posY = std::atof(clickPosY.getStr());
-Size size = pArea->get_size_request();
+OutputDevice& rRefDevice = pArea->get_ref_device();
+// We send OutPutSize for the drawing area bitmap
+// get_size_request is not necessarily updated
+// therefore it may be incorrect.
+Size size = rRefDevice.GetOutputSize();
 posX = posX * size.Width();
 posY = posY * size.Height();
 LOKTrigger::trigger_click(*pArea, Point(posX, 
posY));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-04 Thread merttumer (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 720438d2c43ee676af9002b92f97d650f45184e7
Author: merttumer 
AuthorDate: Wed May 26 11:30:14 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 20:03:15 2021 +0200

lok: Hide file name from Text Import Dialog (csv)

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 49c46330bfd9..93032a5d913e 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -326,8 +327,11 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 m_xDialog->set_title(mxAltTitle->get_label());
 break;
 case SC_IMPORTFILE:
-aName += " - [" + aDatName + "]";
-m_xDialog->set_title(aName);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+aName += " - [" + aDatName + "]";
+m_xDialog->set_title(aName);
+}
 break;
 default:
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-04 Thread merttumer (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   26 ++
 sw/source/uibase/shells/basesh.cxx   |3 +--
 2 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 73c37ef7595cde0a9b46681106672170e3eb6ffb
Author: merttumer 
AuthorDate: Wed May 26 10:34:22 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 20:02:57 2021 +0200

lok: Re-Enable AnchorToPara context menu item

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

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index df3d6da3976a..a81ae435829c 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1779,8 +1779,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
 
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_PARAGRAPH
-|| nWhich == FN_TOOL_ANCHOR_FRAME)
+if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_FRAME)
 {
 rSet.DisableItem(nWhich);
 }
commit fe634a991bd94f9f1f0f9ef5c401648b8dd85f6c
Author: merttumer 
AuthorDate: Mon May 24 18:56:56 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 20:02:46 2021 +0200

sd: Unit test for Table deletion with Delete Key

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

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 4b33a9c45b46..02f1968a8232 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -132,6 +132,7 @@ public:
 void testSpellOnlineRenderParameter();
 void testSlideDuplicateUndo();
 void testMoveShapeHandle();
+void testDeleteTable();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testCreateDestroy);
@@ -188,6 +189,7 @@ public:
 CPPUNIT_TEST(testSpellOnlineRenderParameter);
 CPPUNIT_TEST(testSlideDuplicateUndo);
 CPPUNIT_TEST(testMoveShapeHandle);
+CPPUNIT_TEST(testDeleteTable);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -738,6 +740,30 @@ void SdTiledRenderingTest::testInsertTable()
 CPPUNIT_ASSERT(aPos.Y() != 0);
 }
 
+void SdTiledRenderingTest::testDeleteTable()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+
+uno::Sequence aArgs(comphelper::InitPropertySequence(
+{
+{ "Rows", uno::makeAny(sal_Int32(3)) },
+{ "Columns", uno::makeAny(sal_Int32(5)) }
+}));
+
+comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+Scheduler::ProcessEventsToIdle();
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+SdrView* pSdrView = pViewShell->GetView();
+const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+CPPUNIT_ASSERT(rMarkList.GetMarkCount());
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(!rMarkList.GetMarkCount());
+}
+
 void SdTiledRenderingTest::testPartHash()
 {
 SdXImpressDocument* pDoc = createDoc("dummy.odp");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-04 Thread merttumer (via logerrit)
 svx/source/svdraw/svdmrkv.cxx  |   21 -
 sw/source/core/draw/dview.cxx  |6 --
 sw/source/uibase/shells/drawsh.cxx |   10 +-
 sw/source/uibase/uiview/view2.cxx  |7 ++-
 4 files changed, 35 insertions(+), 9 deletions(-)

New commits:
commit 6c879cd2dc4517c8ee9dbff0f228f95702e7f88b
Author: merttumer 
AuthorDate: Mon May 24 10:52:13 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 10:39:44 2021 +0200

Extended MoveShapeHandle command for Anchors as well

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index eef111ce4103..5f368c04a4a3 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -982,6 +982,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 {
 boost::property_tree::ptree responseJSON;
 boost::property_tree::ptree others;
+boost::property_tree::ptree anchor;
 boost::property_tree::ptree rectangle;
 boost::property_tree::ptree poly;
 boost::property_tree::ptree custom;
@@ -1016,6 +1017,14 @@ void 
SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
 {
 selectedNode = &custom;
 }
+else if (kind == 
static_cast(SdrHdlKind::Anchor) || kind == 
static_cast(SdrHdlKind::Anchor_TR))
+{
+if (getSdrModelFromSdrView().IsWriter())
+selectedNode = &anchor;
+else
+// put it to others as we dont render them except 
in writer
+selectedNode = &others;
+}
 else
 {
 selectedNode = &others;
@@ -1034,6 +1043,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 nodes.add_child("rectangle", rectangle);
 nodes.add_child("poly", poly);
 nodes.add_child("custom", custom);
+nodes.add_child("anchor", anchor);
 nodes.add_child("others", others);
 responseJSON.add_child("kinds", nodes);
 std::stringstream aStream;
@@ -1391,11 +1401,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 }
 }
 
-// moved it here to access all the handles for callback.
-if (bTiledRendering && pViewShell)
-{
-SetMarkHandlesForLOKit(aRect, pOtherShell);
-}
 // rotation point/axis of reflection
 if(!bLimitedRotation)
 {
@@ -1408,6 +1413,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 // add custom handles (used by other apps, e.g. AnchorPos)
 AddCustomHdl();
 
+// moved it here to access all the handles for callback.
+if (bTiledRendering && pViewShell)
+{
+SetMarkHandlesForLOKit(aRect, pOtherShell);
+}
+
 // try to restore focus handle index from remembered values
 if(!bSaveOldFocus)
 return;
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index dfa884e80db5..b2ad0f39c14e 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -243,8 +243,10 @@ void SwDrawView::AddCustomHdl()
 }
 
 // add anchor handle:
-maHdlList.AddHdl( std::make_unique( aPos, ( pAnch->IsVertical() 
&& !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+std::unique_ptr hdl = std::make_unique( aPos, ( 
pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
+hdl->SetObjHdlNum(maHdlList.GetHdlCount());
+maHdlList.AddHdl(std::move(hdl));
 }
 
 SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
diff --git a/sw/source/uibase/shells/drawsh.cxx 
b/sw/source/uibase/shells/drawsh.cxx
index 9f0de0c2a0f1..bd1e50e26871 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -210,7 +210,15 @@ void SwDrawShell::Execute(SfxRequest &rReq)
 const sal_uLong handleNum = handleNumItem->GetValue();
 const sal_uLong newPosX = newPosXTwips->GetValue();
 const sal_uLong newPosY = newPosYTwips->GetValue();
-pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), 
OrdNum ? OrdNum->GetValue() : -1);
+const Point mPoint(newPosX, newPosY);
+const SdrHdl* handle = 
pSdrView->GetHdlList().GetHdl(handleNum);
+if (handle->GetKind() == SdrHd

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

2021-06-04 Thread merttumer (via logerrit)
 svx/source/table/tablecontroller.cxx |   30 ++
 1 file changed, 22 insertions(+), 8 deletions(-)

New commits:
commit 13f981e262b04f40c377d0e4fff717b57855d8a3
Author: merttumer 
AuthorDate: Mon May 17 05:52:01 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 10:39:24 2021 +0200

Implemented Delete key deletes the table when all the cells are selected

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

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 0f8faaa0fc6d..06aa2d615127 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1425,30 +1425,44 @@ bool SvxTableController::DeleteMarked()
 SdrTableObj& rTableObj(*mxTableObj);
 SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
 const bool bUndo(rModel.IsUndoEnabled());
+bool bDeleteTable = false;
 
 if (bUndo)
 rModel.BegUndo(SvxResId(STR_TABLE_DELETE_CELL_CONTENTS));
 
 CellPos aStart, aEnd;
 getSelectedCells( aStart, aEnd );
-for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+const sal_Int32 nRemovedColumns = aEnd.mnCol - aStart.mnCol + 1;
+const sal_Int32 nRemovedRows = aEnd.mnRow - aStart.mnRow + 1;
+if( nRemovedColumns == mxTable->getColumnCount() && nRemovedRows == 
mxTable->getRowCount())
 {
-for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+bDeleteTable = true;
+}
+else
+{
+for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
 {
-CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( 
nCol, nRow ).get() ) );
-if (xCell.is() && xCell->hasText())
+for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
 {
-if (bUndo)
-xCell->AddUndo();
-xCell->SetOutlinerParaObject(nullptr);
+CellRef xCell( dynamic_cast< Cell* >( 
mxTable->getCellByPosition( nCol, nRow ).get() ) );
+if (xCell.is() && xCell->hasText())
+{
+if (bUndo)
+xCell->AddUndo();
+xCell->SetOutlinerParaObject(nullptr);
+}
 }
 }
 }
 
+if (bDeleteTable)
+mrView.DeleteMarkedObj();
+
 if (bUndo)
 rModel.EndUndo();
 
-UpdateTableShape();
+if (!bDeleteTable)
+UpdateTableShape();
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-04 Thread merttumer (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   52 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   59 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |  860 +
 3 files changed, 571 insertions(+), 400 deletions(-)

New commits:
commit 67277595902dd22c68d9db1f7cf94f53447b237a
Author: merttumer 
AuthorDate: Thu May 13 11:21:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 10:39:05 2021 +0200

Unit tests for .uno:MoveShapeHandle command

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 092dcf8cb863..08cc5d724dcd 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -116,6 +116,7 @@ public:
 void testSortAscendingDescending();
 void testAutoInputStringBlock();
 void testAutoInputExactMatch();
+void testMoveShapeHandle();
 
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
@@ -167,6 +168,7 @@ public:
 CPPUNIT_TEST(testSortAscendingDescending);
 CPPUNIT_TEST(testAutoInputStringBlock);
 CPPUNIT_TEST(testAutoInputExactMatch);
+CPPUNIT_TEST(testMoveShapeHandle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -444,6 +446,7 @@ public:
 boost::property_tree::ptree m_aCommentCallbackResult;
 OString m_sInvalidateHeader;
 OString m_sInvalidateSheetGeometry;
+OString m_ShapeSelection;
 
 ViewCallback(bool bDeleteListenerOnDestruct=true)
 : m_bOwnCursorInvalidated(false),
@@ -506,6 +509,7 @@ public:
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 {
 m_bGraphicSelection = true;
+m_ShapeSelection = OString(pPayload);
 }
 break;
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
@@ -666,6 +670,54 @@ void ScTiledRenderingTest::testViewLock()
 CPPUNIT_ASSERT(!aView1.m_bViewLock);
 }
 
+void lcl_extractHandleParameters(const OString& selection, int& id, int& x, 
int& y)
+{
+OString extraInfo = selection.copy(selection.indexOf("{"));
+std::stringstream aStream(extraInfo.getStr());
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+boost::property_tree::ptree
+handle0 = aTree
+.get_child("handles")
+.get_child("kinds")
+.get_child("rectangle")
+.get_child("1")
+.begin()->second;
+id = handle0.get_child("id").get_value();
+x = handle0.get_child("point").get_child("x").get_value();
+y = handle0.get_child("point").get_child("y").get_value();
+}
+
+void ScTiledRenderingTest::testMoveShapeHandle()
+{
+comphelper::LibreOfficeKit::setActive();
+ScModelObj* pModelObj = createDoc("shape.ods");
+ViewCallback aView1;
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, /*x=*/ 1,/*y=*/ 
1,/*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, /*x=*/ 1, /*y=*/ 
1, /*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+{
+int id, x, y;
+lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+int oldX = x;
+int oldY = y;
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
+{
+{"HandleNum", uno::makeAny(id)},
+{"NewPosX", uno::makeAny(x+1)},
+{"NewPosY", uno::makeAny(y+1)}
+}));
+comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+CPPUNIT_ASSERT_EQUAL(x-1, oldX);
+CPPUNIT_ASSERT_EQUAL(y-1, oldY);
+}
+}
+
 void ScTiledRenderingTest::testColRowResize()
 {
 comphelper::LibreOfficeKit::setActive();
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index de5e8d9133d9..4b33a9c45b46 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -131,6 +131,7 @@ public:
 void testInsertDeletePageInvalidation();
 void testSpellOnlineRenderParameter();
 void testSlideDuplicateUndo();
+void testMoveShapeHandle();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testCreateDestroy);
@@ -186,6 +187,7 @@ public:
 CPPUNIT_TEST(testInsertDeletePageInvalidation);
 CPPUNIT_TEST(testSpellOnlineRenderParameter);
 CPPUNIT_TEST(testSlideDuplicateUndo);
+CPPUNIT_TEST(testMoveShapeHandle);
 
 CPPUNIT_TEST_SUITE_END();
 
@

[Libreoffice-commits] core.git: distro-configs/CPAndroidBranding.conf distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOfficeAndroid.conf distro-configs/LibreOfficeAndroidX86_64.conf

2021-06-04 Thread merttumer (via logerrit)
 distro-configs/CPAndroidBranding.conf |1 +
 distro-configs/LibreOfficeAndroid.conf|1 +
 distro-configs/LibreOfficeAndroidAarch64.conf |1 +
 distro-configs/LibreOfficeAndroidX86.conf |1 +
 distro-configs/LibreOfficeAndroidX86_64.conf  |1 +
 5 files changed, 5 insertions(+)

New commits:
commit 19b9da3e1f67611a3ec34cd5a8af508db4c05a4e
Author: merttumer 
AuthorDate: Tue May 11 06:36:31 2021 +
Commit: Mert Tumer 
CommitDate: Fri Jun 4 10:38:48 2021 +0200

Enable PdfIum for android build

Change-Id: I58d09db362f0de991eab3920683530e1ec43e2bc
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115373
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116296
Tested-by: Jenkins

diff --git a/distro-configs/CPAndroidBranding.conf 
b/distro-configs/CPAndroidBranding.conf
index 7c2f898b4105..3200e3c5ebe4 100644
--- a/distro-configs/CPAndroidBranding.conf
+++ b/distro-configs/CPAndroidBranding.conf
@@ -9,4 +9,5 @@
 --disable-scripting-javascript
 --with-lang=de en-US es pt-BR
 --with-myspell-dicts
+--enable-pdfimport
 --enable-release-build
diff --git a/distro-configs/LibreOfficeAndroid.conf 
b/distro-configs/LibreOfficeAndroid.conf
index c95bef658956..e6ef6f551580 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -4,3 +4,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidAarch64.conf 
b/distro-configs/LibreOfficeAndroidAarch64.conf
index 538ae3b07975..aef3dfdbd3e8 100644
--- a/distro-configs/LibreOfficeAndroidAarch64.conf
+++ b/distro-configs/LibreOfficeAndroidAarch64.conf
@@ -3,3 +3,4 @@
 --without-helppack-integration
 --without-junit
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86.conf 
b/distro-configs/LibreOfficeAndroidX86.conf
index 49f4b4729971..f71b1ab72018 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -4,3 +4,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86_64.conf 
b/distro-configs/LibreOfficeAndroidX86_64.conf
index 307fe3b38603..ebd7fadc9091 100644
--- a/distro-configs/LibreOfficeAndroidX86_64.conf
+++ b/distro-configs/LibreOfficeAndroidX86_64.conf
@@ -4,3 +4,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-03 Thread merttumer (via logerrit)
 vcl/source/window/layout.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 50b640a298604ecd10ce095a005cd8eaaf82fc14
Author: merttumer 
AuthorDate: Fri May 7 10:19:05 2021 +
Commit: Mert Tumer 
CommitDate: Fri Jun 4 07:47:31 2021 +0200

android: Fix DrawingArea inside CsvTableBox is shrinked

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

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 2a76145e9247..3f70e767e344 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -272,6 +273,14 @@ void VclBox::setAllocation(const Size &rAllocation)
 {
 Size aRequisition = calculateRequisition();
 nExtraSpace = (getPrimaryDimension(rAllocation) - 
getPrimaryDimension(aRequisition)) / nExpandChildren;
+// In mobile, the screen size is small and extraSpace can become negative
+// Though the dialogs are rendered in javascript for LOK Android some widgets 
like weld::DrawingArea
+// is sent as bitmap but it is rendered from only the visible part
+// when it gets negative, it shrinks instead of expands and it becomes 
invisible
+#if HAVE_FEATURE_ANDROID_LOK
+if (nExtraSpace < 0)
+nExtraSpace = 0;
+#endif
 }
 
 //Split into those we pack from the start onwards, and those we pack from 
the end backwards
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: solenv/bin

2021-06-03 Thread merttumer (via logerrit)
 solenv/bin/native-code.py |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 437facda5898b476f6b4a6baaf4c3e22c5eb1e35
Author: merttumer 
AuthorDate: Thu Apr 29 06:20:19 2021 +
Commit: Mert Tumer 
CommitDate: Fri Jun 4 07:47:08 2021 +0200

Add missing FilterOptionsDialog constructor for android

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

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 0cbb5cc9cc8d..4316bb233fbe 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -565,6 +565,7 @@ edit_constructor_list = [
 "Calc_XMLOasisMetaExporter_get_implementation",
 "Calc_XMLOasisSettingsExporter_get_implementation",
 "Calc_XMLOasisStylesExporter_get_implementation",
+"Calc_FilterOptionsDialog_get_implementation",
 # starmath/util/sm.component
 "Math_XMLContentExporter_get_implementation",
 "Math_XMLOasisMetaExporter_get_implementation",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-03 Thread merttumer (via logerrit)
 desktop/source/lib/lokinteractionhandler.cxx |   23 +++
 desktop/source/lib/lokinteractionhandler.hxx |2 ++
 sfx2/source/doc/objstor.cxx  |3 ++-
 3 files changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 8c26772822e2f768e48be72feb29ec06f00d9cf2
Author: merttumer 
AuthorDate: Mon Apr 26 08:12:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 07:46:39 2021 +0200

lok: Interaction handler for FilterOptions

This will enable Text Import Dialog to be executed
before the document is loaded

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

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index eb7d120a5e3e..325e5893184a 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -40,6 +40,8 @@
 #include 
 #include 
 
+#include 
+
 #include "../../inc/lib/init.hxx"
 
 #include 
@@ -350,6 +352,24 @@ bool 
LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference<
 return false;
 }
 
+bool LOKInteractionHandler::handleFilterOptionsRequest(const 
uno::Reference& xRequest)
+{
+document::FilterOptionsRequest aFilterOptionsRequest;
+uno::Any const request(xRequest->getRequest());
+if (request >>= aFilterOptionsRequest)
+{
+uno::Reference< task::XInteractionHandler2 > xInteraction(
+task::InteractionHandler::createWithParent(
+::comphelper::getProcessComponentContext(), nullptr));
+
+if (xInteraction.is())
+xInteraction->handleInteractionRequest(xRequest);
+
+return true;
+}
+return false;
+}
+
 sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
 const uno::Reference& xRequest)
 {
@@ -365,6 +385,9 @@ sal_Bool SAL_CALL 
LOKInteractionHandler::handleInteractionRequest(
 if (handlePasswordRequest(rContinuations, request))
 return true;
 
+if (handleFilterOptionsRequest(xRequest))
+return true;
+
 if (handleMacroConfirmationRequest(xRequest))
 return true;
 
diff --git a/desktop/source/lib/lokinteractionhandler.hxx 
b/desktop/source/lib/lokinteractionhandler.hxx
index 9c15f85f4bc8..108343ec22e3 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -76,6 +76,8 @@ private:
 bool handlePasswordRequest(const 
css::uno::Sequence> 
&rContinuations, const css::uno::Any& rRequest);
 static bool handleMacroConfirmationRequest(const 
css::uno::Reference& xRequest);
 
+static bool handleFilterOptionsRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
Request);
+
 public:
 void SetPassword(char const* pPassword);
 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0b5080d23230..d30e52f25c03 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -853,7 +853,8 @@ ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const *
 SfxItemSet* pSet = pMedium->GetItemSet();
 const SfxStringItem* pOptions = SfxItemSet::GetItem(pSet, 
SID_FILE_FILTEROPTIONS, false);
 const SfxUnoAnyItem* pData = SfxItemSet::GetItem(pSet, 
SID_FILTER_DATA, false);
-if ( !pData && !pOptions )
+const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+if ( !pData && (bTiledRendering || !pOptions) )
 {
 css::uno::Reference< XMultiServiceFactory > xServiceManager = 
::comphelper::getProcessServiceFactory();
 css::uno::Reference< XNameAccess > xFilterCFG;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-03 Thread merttumer (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |7 +++
 sc/source/ui/inc/scuiasciiopt.hxx   |2 ++
 2 files changed, 9 insertions(+)

New commits:
commit 790f7deb17cede31c780b3e296672bbe7577763c
Author: merttumer 
AuthorDate: Mon Apr 26 06:52:34 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 07:46:17 2021 +0200

lok: add global notifier to the "Text Import Dialog"

This dialog is displayed before the document is loaded
so no way to get access to the view shell notifier
when model/view/controller are not created yet.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 395d2595937b..49c46330bfd9 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -527,6 +528,12 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 mxCkbSkipEmptyCells->set_active(false);
 mxCkbSkipEmptyCells->hide();
 }
+m_xDialog->SetInstallLOKNotifierHdl(LINK(this, ScImportAsciiDlg, 
InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(ScImportAsciiDlg, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+return GetpApp();
 }
 
 ScImportAsciiDlg::~ScImportAsciiDlg()
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx 
b/sc/source/ui/inc/scuiasciiopt.hxx
index 5064243ae58e..140ca09122d0 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -114,6 +114,8 @@ private:
 DECL_LINK( LbColTypeHdl, weld::ComboBox&, void 
);
 DECL_LINK( UpdateTextHdl, ScCsvTableBox&, void 
);
 DECL_LINK( ColTypeHdl, ScCsvTableBox&, void );
+DECL_STATIC_LINK(ScImportAsciiDlg, 
InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
+
 };
 
 inline bool ScImportAsciiDlg::Seek(sal_uLong nPos)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-03 Thread merttumer (via logerrit)
 vcl/source/window/builder.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a4b5170eeb134ae5b838f480db1ac5d64dafceac
Author: merttumer 
AuthorDate: Mon Apr 26 06:29:43 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 07:46:03 2021 +0200

Added Text Import Dialog to JSDialogs list

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2e8c26aef83a..7c955a76e476 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -214,7 +214,8 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 || rUIFile == "modules/scalc/ui/datafielddialog.ui"
 || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
 || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
-|| rUIFile == "svx/ui/fontworkgallerydialog.ui")
+|| rUIFile == "svx/ui/fontworkgallerydialog.ui"
+|| rUIFile == "modules/scalc/ui/textimportcsv.ui")
 {
 bUseJSBuilder = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/source

2021-05-30 Thread merttumer (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 4df6fa6dab7d620bf2fdc722371fae690163d752
Author: merttumer 
AuthorDate: Wed May 26 11:30:14 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 07:50:17 2021 +0200

lok: Hide file name from Text Import Dialog (csv)

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 564b167fe58e..2d8efaefa3f3 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -327,8 +328,11 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 m_xDialog->set_title(mxAltTitle->get_label());
 break;
 case SC_IMPORTFILE:
-aName += " - [" + aDatName + "]";
-m_xDialog->set_title(aName);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+aName += " - [" + aDatName + "]";
+m_xDialog->set_title(aName);
+}
 break;
 default:
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - sd/qa sw/source

2021-05-30 Thread merttumer (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   26 ++
 sw/source/uibase/shells/basesh.cxx   |3 +--
 2 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit a7e6d1af84a3df887562b1e5e0a1f9aef79bc05e
Author: merttumer 
AuthorDate: Wed May 26 10:34:22 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 07:50:03 2021 +0200

lok: Re-Enable AnchorToPara context menu item

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

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 359dea043183..57e9394fc03c 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1705,8 +1705,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
 
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_PARAGRAPH
-|| nWhich == FN_TOOL_ANCHOR_FRAME)
+if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == 
FN_TOOL_ANCHOR_FRAME)
 {
 rSet.DisableItem(nWhich);
 }
commit d17f982436006d1dc59d7679f2959ee931904372
Author: merttumer 
AuthorDate: Mon May 24 18:56:56 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 07:49:49 2021 +0200

sd: Unit test for Table deletion with Delete Key

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

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index fe6ee4e628b7..5c852d854c90 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -132,6 +132,7 @@ public:
 void testSpellOnlineRenderParameter();
 void testSlideDuplicateUndo();
 void testMoveShapeHandle();
+void testDeleteTable();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testCreateDestroy);
@@ -188,6 +189,7 @@ public:
 CPPUNIT_TEST(testSpellOnlineRenderParameter);
 CPPUNIT_TEST(testSlideDuplicateUndo);
 CPPUNIT_TEST(testMoveShapeHandle);
+CPPUNIT_TEST(testDeleteTable);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -738,6 +740,30 @@ void SdTiledRenderingTest::testInsertTable()
 CPPUNIT_ASSERT(aPos.Y() != 0);
 }
 
+void SdTiledRenderingTest::testDeleteTable()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+
+uno::Sequence aArgs(comphelper::InitPropertySequence(
+{
+{ "Rows", uno::makeAny(sal_Int32(3)) },
+{ "Columns", uno::makeAny(sal_Int32(5)) }
+}));
+
+comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+Scheduler::ProcessEventsToIdle();
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+SdrView* pSdrView = pViewShell->GetView();
+const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 1);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 0);
+}
+
 void SdTiledRenderingTest::testPartHash()
 {
 SdXImpressDocument* pDoc = createDoc("dummy.odp");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - svx/source sw/source

2021-05-30 Thread merttumer (via logerrit)
 svx/source/svdraw/svdmrkv.cxx  |   21 -
 sw/source/core/draw/dview.cxx  |6 --
 sw/source/uibase/shells/drawsh.cxx |   12 +++-
 sw/source/uibase/uiview/view2.cxx  |7 ++-
 4 files changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 7eed711a6115bf892c998cbd73a2c5b706c6f99d
Author: merttumer 
AuthorDate: Mon May 24 10:52:13 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 05:53:58 2021 +0200

Extended MoveShapeHandle command for Anchors as well

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 80bca0ef12c9..442a872253f3 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -982,6 +982,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 {
 boost::property_tree::ptree responseJSON;
 boost::property_tree::ptree others;
+boost::property_tree::ptree anchor;
 boost::property_tree::ptree rectangle;
 boost::property_tree::ptree poly;
 boost::property_tree::ptree custom;
@@ -1016,6 +1017,14 @@ void 
SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
 {
 selectedNode = &custom;
 }
+else if (kind == 
static_cast(SdrHdlKind::Anchor) || kind == 
static_cast(SdrHdlKind::Anchor_TR))
+{
+if (getSdrModelFromSdrView().IsWriter())
+selectedNode = &anchor;
+else
+// put it to others as we dont render them except 
in writer
+selectedNode = &others;
+}
 else
 {
 selectedNode = &others;
@@ -1034,6 +1043,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 nodes.add_child("rectangle", rectangle);
 nodes.add_child("poly", poly);
 nodes.add_child("custom", custom);
+nodes.add_child("anchor", anchor);
 nodes.add_child("others", others);
 responseJSON.add_child("kinds", nodes);
 std::stringstream aStream;
@@ -1395,11 +1405,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 }
 }
 
-// moved it here to access all the handles for callback.
-if (bTiledRendering && pViewShell)
-{
-SetMarkHandlesForLOKit(aRect, pOtherShell);
-}
 // rotation point/axis of reflection
 if(!bLimitedRotation)
 {
@@ -1412,6 +1417,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 // add custom handles (used by other apps, e.g. AnchorPos)
 AddCustomHdl();
 
+// moved it here to access all the handles for callback.
+if (bTiledRendering && pViewShell)
+{
+SetMarkHandlesForLOKit(aRect, pOtherShell);
+}
+
 // try to restore focus handle index from remembered values
 if(!bSaveOldFocus)
 return;
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 1d4a4d448120..3f00c8613294 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -243,8 +243,10 @@ void SwDrawView::AddCustomHdl()
 }
 
 // add anchor handle:
-maHdlList.AddHdl( std::make_unique( aPos, ( pAnch->IsVertical() 
&& !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+std::unique_ptr hdl = std::make_unique( aPos, ( 
pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
+hdl->SetObjHdlNum(maHdlList.GetHdlCount());
+maHdlList.AddHdl(std::move(hdl));
 }
 
 SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
diff --git a/sw/source/uibase/shells/drawsh.cxx 
b/sw/source/uibase/shells/drawsh.cxx
index ebc014e8fb45..cf90304da675 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -213,7 +213,17 @@ void SwDrawShell::Execute(SfxRequest &rReq)
 const sal_uLong handleNum = handleNumItem->GetValue();
 const sal_uLong newPosX = newPosXTwips->GetValue();
 const sal_uLong newPosY = newPosYTwips->GetValue();
-pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), 
OrdNum ? OrdNum->GetValue() : -1);
+const Point mPoint(newPosX, newPosY);
+const SdrHdl* handle = 
pSdrView->GetHdlList().GetHdl(handleNum);
+if (handle->GetKind() == SdrHdlKind::Anchor || 
ha

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - sc/qa sd/qa svx/source sw/qa

2021-05-30 Thread merttumer (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   52 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   54 ++
 svx/source/table/tablecontroller.cxx   |   30 +---
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   60 +
 4 files changed, 188 insertions(+), 8 deletions(-)

New commits:
commit 0f94dd7975e19e40665a74fd8c847f1213825d79
Author: merttumer 
AuthorDate: Mon May 17 05:52:01 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 05:53:45 2021 +0200

Implemented Delete key deletes the table when all the cells are selected

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

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 4ad539380e63..9b1cfd516b3d 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1424,30 +1424,44 @@ bool SvxTableController::DeleteMarked()
 SdrTableObj& rTableObj(*mxTableObj);
 SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
 const bool bUndo(rModel.IsUndoEnabled());
+bool bDeleteTable = false;
 
 if (bUndo)
 rModel.BegUndo(SvxResId(STR_TABLE_DELETE_CELL_CONTENTS));
 
 CellPos aStart, aEnd;
 getSelectedCells( aStart, aEnd );
-for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+const sal_Int32 nRemovedColumns = aEnd.mnCol - aStart.mnCol + 1;
+const sal_Int32 nRemovedRows = aEnd.mnRow - aStart.mnRow + 1;
+if( nRemovedColumns == mxTable->getColumnCount() && nRemovedRows == 
mxTable->getRowCount())
 {
-for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+bDeleteTable = true;
+}
+else
+{
+for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
 {
-CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( 
nCol, nRow ).get() ) );
-if (xCell.is() && xCell->hasText())
+for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
 {
-if (bUndo)
-xCell->AddUndo();
-xCell->SetOutlinerParaObject(nullptr);
+CellRef xCell( dynamic_cast< Cell* >( 
mxTable->getCellByPosition( nCol, nRow ).get() ) );
+if (xCell.is() && xCell->hasText())
+{
+if (bUndo)
+xCell->AddUndo();
+xCell->SetOutlinerParaObject(nullptr);
+}
 }
 }
 }
 
+if (bDeleteTable)
+mrView.DeleteMarkedObj();
+
 if (bUndo)
 rModel.EndUndo();
 
-UpdateTableShape();
+if (!bDeleteTable)
+UpdateTableShape();
 return true;
 }
 
commit e39f6b4d296ce9325ff3910c9cf25ca689c0eedb
Author: merttumer 
AuthorDate: Thu May 13 11:21:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 05:53:30 2021 +0200

Unit tests for .uno:MoveShapeHandle command

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 80e0f7b2e2f0..620e79541a28 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -120,6 +120,7 @@ public:
 void testSortAscendingDescending();
 void testAutoInputStringBlock();
 void testAutoInputExactMatch();
+void testMoveShapeHandle();
 
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
@@ -171,6 +172,7 @@ public:
 CPPUNIT_TEST(testSortAscendingDescending);
 CPPUNIT_TEST(testAutoInputStringBlock);
 CPPUNIT_TEST(testAutoInputExactMatch);
+CPPUNIT_TEST(testMoveShapeHandle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -448,6 +450,7 @@ public:
 boost::property_tree::ptree m_aCommentCallbackResult;
 OString m_sInvalidateHeader;
 OString m_sInvalidateSheetGeometry;
+OString m_ShapeSelection;
 
 ViewCallback(bool bDeleteListenerOnDestruct=true)
 : m_bOwnCursorInvalidated(false),
@@ -510,6 +513,7 @@ public:
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 {
 m_bGraphicSelection = true;
+m_ShapeSelection = OString(pPayload);
 }
 break;
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
@@ -670,6 +674,54 @@ void ScTiledRenderingTest::testViewLock()
 CPPUNIT_ASSERT(!aView1.m_bViewLock);
 }
 
+static void lcl_extractHandleParameters(const OString& selection, int& id, 
int& x, int& y)
+{
+OString extraInfo = selection.copy(selection.indexO

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - distro-configs/CPAndroidBranding.conf distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOfficeAndroid.co

2021-05-30 Thread merttumer (via logerrit)
 distro-configs/CPAndroidBranding.conf |1 +
 distro-configs/LibreOfficeAndroid.conf|1 +
 distro-configs/LibreOfficeAndroidAarch64.conf |1 +
 distro-configs/LibreOfficeAndroidX86.conf |1 +
 distro-configs/LibreOfficeAndroidX86_64.conf  |1 +
 vcl/source/window/layout.cxx  |9 +
 6 files changed, 14 insertions(+)

New commits:
commit 1844e4a34e52450932c342d1c3ffe159faf20315
Author: merttumer 
AuthorDate: Tue May 11 06:36:31 2021 +
Commit: Mert Tumer 
CommitDate: Mon May 31 05:53:15 2021 +0200

Enable PdfIum for android build

Change-Id: I58d09db362f0de991eab3920683530e1ec43e2bc
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115373
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116307
Tested-by: Jenkins CollaboraOffice 

diff --git a/distro-configs/CPAndroidBranding.conf 
b/distro-configs/CPAndroidBranding.conf
index 21b5bb5635e0..f34f642fdf5d 100644
--- a/distro-configs/CPAndroidBranding.conf
+++ b/distro-configs/CPAndroidBranding.conf
@@ -9,5 +9,6 @@
 --disable-scripting-javascript
 --with-lang=de en-US es fr pt-BR zh-CN zh-TW
 --with-myspell-dicts
+--enable-pdfimport
 --enable-release-build
 --disable-community-flavor
diff --git a/distro-configs/LibreOfficeAndroid.conf 
b/distro-configs/LibreOfficeAndroid.conf
index 3ff76a8d60a9..82bc4afe0029 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidAarch64.conf 
b/distro-configs/LibreOfficeAndroidAarch64.conf
index bfc948c021f7..27ad9d1c788c 100644
--- a/distro-configs/LibreOfficeAndroidAarch64.conf
+++ b/distro-configs/LibreOfficeAndroidAarch64.conf
@@ -7,3 +7,4 @@
 --without-helppack-integration
 --without-junit
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86.conf 
b/distro-configs/LibreOfficeAndroidX86.conf
index 8fc92786c5e7..2692d796195b 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86_64.conf 
b/distro-configs/LibreOfficeAndroidX86_64.conf
index efbbdbb1e945..afc917d9a3f7 100644
--- a/distro-configs/LibreOfficeAndroidX86_64.conf
+++ b/distro-configs/LibreOfficeAndroidX86_64.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
commit 4fd30dfcbfc8ce8cfe3cfb72a8f59621f83ea1b6
Author: merttumer 
AuthorDate: Fri May 7 10:19:05 2021 +
Commit: Mert Tumer 
CommitDate: Mon May 31 05:53:01 2021 +0200

android: Fix DrawingArea inside CsvTableBox is shrinked

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

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9b0ee7452577..0018971e0f5c 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -271,6 +272,14 @@ void VclBox::setAllocation(const Size &rAllocation)
 {
 Size aRequisition = calculateRequisition();
 nExtraSpace = (getPrimaryDimension(rAllocation) - 
getPrimaryDimension(aRequisition)) / nExpandChildren;
+// In mobile, the screen size is small and extraSpace can become negative
+// Though the dialogs are rendered in javascript for LOK Android some widgets 
like weld::DrawingArea
+// is sent as bitmap but it is rendered from only the visible part
+// when it gets negative, it shrinks instead of expands and it becomes 
invisible
+#if HAVE_FEATURE_ANDROID_LOK
+if (nExtraSpace < 0)
+nExtraSpace = 0;
+#endif
 }
 
 //Split into those we pack from the start onwards, and those we pack from 
the end backwards
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - solenv/bin

2021-05-30 Thread merttumer (via logerrit)
 solenv/bin/native-code.py |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c7661f475b017d18123ff04af99530ffa06d26d3
Author: merttumer 
AuthorDate: Thu Apr 29 06:20:19 2021 +
Commit: Mert Tumer 
CommitDate: Mon May 31 05:52:42 2021 +0200

Add missing FilterOptionsDialog constructor for android

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

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 3574347bb204..924cd81d1a4e 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -565,6 +565,7 @@ edit_constructor_list = [
 "Calc_XMLOasisMetaExporter_get_implementation",
 "Calc_XMLOasisSettingsExporter_get_implementation",
 "Calc_XMLOasisStylesExporter_get_implementation",
+"Calc_FilterOptionsDialog_get_implementation",
 # starmath/util/sm.component
 "Math_XMLContentExporter_get_implementation",
 "Math_XMLOasisMetaExporter_get_implementation",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - desktop/source sc/source sfx2/source

2021-05-30 Thread merttumer (via logerrit)
 desktop/source/lib/lokinteractionhandler.cxx |   22 ++
 desktop/source/lib/lokinteractionhandler.hxx |2 ++
 sc/source/ui/dbgui/scuiasciiopt.cxx  |7 +++
 sc/source/ui/inc/scuiasciiopt.hxx|2 ++
 sfx2/source/doc/objstor.cxx  |3 ++-
 5 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 20c48df295e0108d907b503a5adf3c24d4242a24
Author: merttumer 
AuthorDate: Mon Apr 26 08:12:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 05:51:51 2021 +0200

lok: Interaction handler for FilterOptions

This will enable Text Import Dialog to be executed
before the document is loaded

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

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index eb7d120a5e3e..e4ce45ce672d 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -40,6 +40,8 @@
 #include 
 #include 
 
+#include 
+
 #include "../../inc/lib/init.hxx"
 
 #include 
@@ -341,6 +343,23 @@ bool 
LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference<
 if (request >>= aConfirmRequest)
 {
 auto 
xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(),
 nullptr));
+if (xInteraction.is())
+xInteraction->handleInteractionRequest(xRequest);
+
+return true;
+}
+return false;
+}
+
+bool LOKInteractionHandler::handleFilterOptionsRequest(const 
uno::Reference& xRequest)
+{
+document::FilterOptionsRequest aFilterOptionsRequest;
+uno::Any const request(xRequest->getRequest());
+if (request >>= aFilterOptionsRequest)
+{
+uno::Reference< task::XInteractionHandler2 > xInteraction(
+task::InteractionHandler::createWithParent(
+::comphelper::getProcessComponentContext(), nullptr));
 
 if (xInteraction.is())
 xInteraction->handleInteractionRequest(xRequest);
@@ -365,6 +384,9 @@ sal_Bool SAL_CALL 
LOKInteractionHandler::handleInteractionRequest(
 if (handlePasswordRequest(rContinuations, request))
 return true;
 
+if (handleFilterOptionsRequest(xRequest))
+return true;
+
 if (handleMacroConfirmationRequest(xRequest))
 return true;
 
diff --git a/desktop/source/lib/lokinteractionhandler.hxx 
b/desktop/source/lib/lokinteractionhandler.hxx
index 9c15f85f4bc8..108343ec22e3 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -76,6 +76,8 @@ private:
 bool handlePasswordRequest(const 
css::uno::Sequence> 
&rContinuations, const css::uno::Any& rRequest);
 static bool handleMacroConfirmationRequest(const 
css::uno::Reference& xRequest);
 
+static bool handleFilterOptionsRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
Request);
+
 public:
 void SetPassword(char const* pPassword);
 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 29ca6d9a0fed..fd85ce09aabb 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -853,7 +853,8 @@ ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const *
 SfxItemSet* pSet = pMedium->GetItemSet();
 const SfxStringItem* pOptions = SfxItemSet::GetItem(pSet, 
SID_FILE_FILTEROPTIONS, false);
 const SfxUnoAnyItem* pData = SfxItemSet::GetItem(pSet, 
SID_FILTER_DATA, false);
-if ( !pData && !pOptions )
+const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+if ( !pData && (bTiledRendering || !pOptions) )
 {
 css::uno::Reference< XMultiServiceFactory > xServiceManager = 
::comphelper::getProcessServiceFactory();
 css::uno::Reference< XNameAccess > xFilterCFG;
commit 4cb1998f2a0715aa512dbc7c7902cad16bb4fe16
Author: merttumer 
AuthorDate: Mon Apr 26 06:52:34 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 31 05:51:39 2021 +0200

lok: add global notifier to the "Text Import Dialog"

This dialog is displayed before the document is loaded
so no way to get access to the view shell notifier
when model/view/controller are not created yet.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index be524ab15437..564b167fe58e 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -3

[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-6.4-39'

2021-05-27 Thread merttumer (via logerrit)
Tag 'cp-6.4-39' created by Andras Timar  at 
2021-05-27 09:09 +

cp-6.4-39

Changes since cp-6.4-38-12:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-26 Thread merttumer (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 54d1534ad00f113aa38586fca45ff43a28422843
Author: merttumer 
AuthorDate: Wed May 26 11:30:14 2021 +0300
Commit: Mert Tumer 
CommitDate: Wed May 26 19:17:42 2021 +0200

lok: Hide file name from Text Import Dialog (csv)

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 58e50fb943d5..3a55f96b77b5 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 //! TODO make dynamic
 const SCSIZE ASCIIDLG_MAXROWS= MAXROWCOUNT;
@@ -320,8 +321,11 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 m_xDialog->set_title(mxAltTitle->get_label());
 break;
 case SC_IMPORTFILE:
-aName += " - [" + aDatName + "]";
-m_xDialog->set_title(aName);
+if (!comphelper::LibreOfficeKit::isActive())
+{
+aName += " - [" + aDatName + "]";
+m_xDialog->set_title(aName);
+}
 break;
 default:
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

lok: Re-Enable AnchorToPara context menu item

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

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


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

2021-05-24 Thread merttumer (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   26 ++
 1 file changed, 26 insertions(+)

New commits:
commit 4a22243d5ea830d99506ac274d072ad998e3aafb
Author: merttumer 
AuthorDate: Mon May 24 18:56:56 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue May 25 06:20:10 2021 +0200

sd: Unit test for Table deletion with Delete Key

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

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index ac1380ad2165..99c30b852a40 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -131,6 +131,7 @@ public:
 void testSpellOnlineRenderParameter();
 void testSlideDuplicateUndo();
 void testMoveShapeHandle();
+void testDeleteTable();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testCreateDestroy);
@@ -187,6 +188,7 @@ public:
 CPPUNIT_TEST(testSpellOnlineRenderParameter);
 CPPUNIT_TEST(testSlideDuplicateUndo);
 CPPUNIT_TEST(testMoveShapeHandle);
+CPPUNIT_TEST(testDeleteTable);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -737,6 +739,30 @@ void SdTiledRenderingTest::testInsertTable()
 CPPUNIT_ASSERT(aPos.Y() != 0);
 }
 
+void SdTiledRenderingTest::testDeleteTable()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+
+uno::Sequence aArgs(comphelper::InitPropertySequence(
+{
+{ "Rows", uno::makeAny(sal_Int32(3)) },
+{ "Columns", uno::makeAny(sal_Int32(5)) }
+}));
+
+comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+Scheduler::ProcessEventsToIdle();
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+SdrView* pSdrView = pViewShell->GetView();
+const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 1);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | 
awt::Key::A);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 0);
+}
+
 void SdTiledRenderingTest::testPartHash()
 {
 SdXImpressDocument* pDoc = createDoc("dummy.odp");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-24 Thread merttumer (via logerrit)
 svx/source/svdraw/svdmrkv.cxx  |   21 -
 sw/source/core/draw/dview.cxx  |6 --
 sw/source/uibase/shells/drawsh.cxx |   12 +++-
 sw/source/uibase/uiview/view2.cxx  |7 ++-
 4 files changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 0a5606dc180c7a643ff4820f7e05413398352b2d
Author: merttumer 
AuthorDate: Mon May 24 10:52:13 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue May 25 06:19:44 2021 +0200

Extended MoveShapeHandle command for Anchors as well

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 875d0dfc3993..61f7d472ecd6 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1002,6 +1002,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 {
 boost::property_tree::ptree responseJSON;
 boost::property_tree::ptree others;
+boost::property_tree::ptree anchor;
 boost::property_tree::ptree rectangle;
 boost::property_tree::ptree poly;
 boost::property_tree::ptree custom;
@@ -1036,6 +1037,14 @@ void 
SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
 {
 selectedNode = &custom;
 }
+else if (kind == 
static_cast(SdrHdlKind::Anchor) || kind == 
static_cast(SdrHdlKind::Anchor_TR))
+{
+if (getSdrModelFromSdrView().IsWriter())
+selectedNode = &anchor;
+else
+// put it to others as we dont render them except 
in writer
+selectedNode = &others;
+}
 else
 {
 selectedNode = &others;
@@ -1054,6 +1063,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 nodes.add_child("rectangle", rectangle);
 nodes.add_child("poly", poly);
 nodes.add_child("custom", custom);
+nodes.add_child("anchor", anchor);
 nodes.add_child("others", others);
 responseJSON.add_child("kinds", nodes);
 std::stringstream aStream;
@@ -1415,11 +1425,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 }
 }
 
-// moved it here to access all the handles for callback.
-if (bTiledRendering && pViewShell)
-{
-SetMarkHandlesForLOKit(aRect, pOtherShell);
-}
 // rotation point/axis of reflection
 if(!bLimitedRotation)
 {
@@ -1432,6 +1437,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 // add custom handles (used by other apps, e.g. AnchorPos)
 AddCustomHdl();
 
+// moved it here to access all the handles for callback.
+if (bTiledRendering && pViewShell)
+{
+SetMarkHandlesForLOKit(aRect, pOtherShell);
+}
+
 // try to restore focus handle index from remembered values
 if(bSaveOldFocus)
 {
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index c1a7b6a8cbbc..f9ef11b99897 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -239,8 +239,10 @@ void SwDrawView::AddCustomHdl()
 }
 
 // add anchor handle:
-maHdlList.AddHdl( std::make_unique( aPos, ( pAnch->IsVertical() 
&& !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+std::unique_ptr hdl = std::make_unique( aPos, ( 
pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
+hdl->SetObjHdlNum(maHdlList.GetHdlCount());
+maHdlList.AddHdl(std::move(hdl));
 }
 
 SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
diff --git a/sw/source/uibase/shells/drawsh.cxx 
b/sw/source/uibase/shells/drawsh.cxx
index a37d57f84e28..ef91d2efb9c3 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -231,7 +231,17 @@ void SwDrawShell::Execute(SfxRequest &rReq)
 const sal_uLong handleNum = handleNumItem->GetValue();
 const sal_uLong newPosX = newPosXTwips->GetValue();
 const sal_uLong newPosY = newPosYTwips->GetValue();
-pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), 
OrdNum ? OrdNum->GetValue() : -1);
+const Point mPoint(newPosX, newPosY);
+const SdrHdl* handle = 
pSdrView->GetHdlList().GetHdl(handleNum);
+if (handle->GetKind() == SdrHdlKind::Anchor || 
handle->GetKind() == SdrHdlKind::Anchor_TR)
+{
+   

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

2021-05-24 Thread merttumer (via logerrit)
 svx/source/table/tablecontroller.cxx |   30 ++
 1 file changed, 22 insertions(+), 8 deletions(-)

New commits:
commit 86fad1dfee9f6678cdca46c607c6a05306ac622e
Author: merttumer 
AuthorDate: Mon May 17 05:52:01 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue May 25 06:18:33 2021 +0200

Implemented Delete key deletes the table when all the cells are selected

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

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 464d8290e572..eee8278090ed 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1419,30 +1419,44 @@ bool SvxTableController::DeleteMarked()
 SdrTableObj& rTableObj(*mxTableObj.get());
 SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
 const bool bUndo(rModel.IsUndoEnabled());
+bool bDeleteTable = false;
 
 if (bUndo)
 rModel.BegUndo(SvxResId(STR_TABLE_DELETE_CELL_CONTENTS));
 
 CellPos aStart, aEnd;
 getSelectedCells( aStart, aEnd );
-for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+const sal_Int32 nRemovedColumns = aEnd.mnCol - aStart.mnCol + 1;
+const sal_Int32 nRemovedRows = aEnd.mnRow - aStart.mnRow + 1;
+if( nRemovedColumns == mxTable->getColumnCount() && nRemovedRows == 
mxTable->getRowCount())
 {
-for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+bDeleteTable = true;
+}
+else
+{
+for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
 {
-CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( 
nCol, nRow ).get() ) );
-if (xCell.is() && xCell->hasText())
+for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
 {
-if (bUndo)
-xCell->AddUndo();
-xCell->SetOutlinerParaObject(nullptr);
+CellRef xCell( dynamic_cast< Cell* >( 
mxTable->getCellByPosition( nCol, nRow ).get() ) );
+if (xCell.is() && xCell->hasText())
+{
+if (bUndo)
+xCell->AddUndo();
+xCell->SetOutlinerParaObject(nullptr);
+}
 }
 }
 }
 
+if (bDeleteTable)
+mrView.DeleteMarkedObj();
+
 if (bUndo)
 rModel.EndUndo();
 
-UpdateTableShape();
+if (!bDeleteTable)
+UpdateTableShape();
 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/co-2021' - 30 commits - canvas/source chart2/source dbaccess/source emfio/inc emfio/qa emfio/source extensions/source framework/source include/

2021-05-16 Thread merttumer (via logerrit)
 canvas/source/directx/dx_canvashelper.cxx|   
33 
 chart2/source/controller/dialogs/DataBrowser.cxx |
2 
 dbaccess/source/ui/browser/unodatbr.cxx  |
9 
 emfio/inc/mtftools.hxx   |   
23 
 emfio/qa/cppunit/emf/EmfImportTest.cxx   |  
201 
 emfio/qa/cppunit/emf/data/TestChordWithModifyWorldTransform.emf  
|binary
 emfio/qa/cppunit/emf/data/TestEllipseWithSelectClipPath.emf  
|binary
 emfio/qa/cppunit/emf/data/TestEllipseXformIntersectClipRect.emf  
|binary
 emfio/qa/cppunit/emf/data/TestPolyLineWidth.emf  
|binary
 emfio/qa/cppunit/emf/data/TestPolylinetoCloseStroke.emf  
|binary
 emfio/qa/cppunit/emf/data/TestRectangleWithModifyWorldTransform.emf  
|binary
 emfio/qa/cppunit/emf/data/TestRoundRect.emf  
|binary
 emfio/qa/cppunit/wmf/data/TestPalette.wmf
|binary
 emfio/source/reader/emfreader.cxx|   
58 
 emfio/source/reader/mtftools.cxx |   
81 
 emfio/source/reader/wmfreader.cxx|   
19 
 extensions/source/bibliography/framectr.cxx  |   
78 
 extensions/source/bibliography/framectr.hxx  |   
12 
 framework/source/fwe/helper/titlehelper.cxx  |
4 
 framework/source/helper/persistentwindowstate.cxx|
4 
 framework/source/helper/tagwindowasmodified.cxx  |
3 
 framework/source/helper/titlebarupdate.cxx   |
4 
 framework/source/uielement/resourcemenucontroller.cxx|
6 
 include/svx/sdr/table/tablecontroller.hxx|
1 
 include/svx/selectioncontroller.hxx  |
2 
 include/vcl/sysdata.hxx  |
3 
 oox/source/drawingml/shape.cxx   |
4 
 readlicense_oo/license/CREDITS.fodt  | 
3742 --
 reportdesign/Library_rpt.mk  |
1 
 reportdesign/inc/ReportDefinition.hxx|
7 
 reportdesign/source/core/api/FixedLine.cxx   |   
30 
 reportdesign/source/core/api/FixedText.cxx   |   
30 
 reportdesign/source/core/api/FormatCondition.cxx |   
29 
 reportdesign/source/core/api/FormattedField.cxx  |   
27 
 reportdesign/source/core/api/Function.cxx|   
29 
 reportdesign/source/core/api/ImageControl.cxx|   
30 
 reportdesign/source/core/api/ReportDefinition.cxx|   
26 
 reportdesign/source/core/api/ReportEngineJFree.cxx   |   
30 
 reportdesign/source/core/api/Shape.cxx   |   
27 
 reportdesign/source/core/api/services.cxx|   
82 
 reportdesign/source/core/inc/FixedLine.hxx   |
6 
 reportdesign/source/core/inc/FixedText.hxx   |
6 
 reportdesign/source/core/inc/FormatCondition.hxx |
6 
 reportdesign/source/core/inc/FormattedField.hxx  |
6 
 reportdesign/source/core/inc/Function.hxx|
6 
 reportdesign/source/core/inc/ImageControl.hxx|
6 
 reportdesign/source/core/inc/ReportEngineJFree.hxx   |
6 
 reportdesign/source/core/inc/Shape.hxx   |
6 
 reportdesign/util/rpt.component  |   
29 
 sc/source/ui/view/viewfun2.cxx   |   
14 
 sd/qa/unit/tiledrendering/tiledrendering.cxx |
4 
 sd/source/ui/view/sdwindow.cxx   |   
11 
 sdext/source/presenter/PresenterController.cxx   |   
12 
 sfx2/source/dialog/infobar.cxx   |
2 
 solenv/gbuild/platform/com_GCC_defs.mk   |
4 
 svl/source/numbers/zforfind.cxx  |   
28 
 svx/inc/galbrws2.hxx |
2 
 svx/source/form/datanavi.cxx |
7 
 svx/source/svdraw/selectioncontroller.cxx|
4 
 svx/source/svdraw/svdview.cxx|   
35 
 svx/sour

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

2021-05-14 Thread merttumer (via logerrit)
 vcl/source/window/builder.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 0548f0fa8699f6192d1fa688b3081b18aefaee03
Author: merttumer 
AuthorDate: Mon Apr 26 06:29:43 2021 +0300
Commit: Szymon Kłos 
CommitDate: Fri May 14 16:20:54 2021 +0200

Added Text Import Dialog to JSDialogs list

Change-Id: I8da4c929ebe7b93fe9211ba432ce321e31482a8f
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114636
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115454
Reviewed-by: Szymon Kłos 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 077534436651..ce39e7a81ca6 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -186,7 +186,6 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 || rUIFile == "modules/scalc/ui/selectsource.ui"
 || rUIFile == "modules/scalc/ui/managenamesdialog.ui"
 || rUIFile == "modules/scalc/ui/definename.ui"
-|| rUIFile == "cui/ui/macroselectordialog.ui"
 || rUIFile == "modules/scalc/ui/correlationdialog.ui"
 || rUIFile == "modules/scalc/ui/samplingdialog.ui"
 || rUIFile == "modules/scalc/ui/descriptivestatisticsdialog.ui"
@@ -200,11 +199,13 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 || rUIFile == "modules/scalc/ui/ztestdialog.ui"
 || rUIFile == "modules/scalc/ui/chisquaretestdialog.ui"
 || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui"
-|| rUIFile == "uui/ui/macrowarnmedium.ui"
 || rUIFile == "modules/scalc/ui/datafielddialog.ui"
 || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
 || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
-|| rUIFile == "svx/ui/fontworkgallerydialog.ui")
+|| rUIFile == "svx/ui/fontworkgallerydialog.ui"
+|| rUIFile == "cui/ui/macroselectordialog.ui"
+|| rUIFile == "uui/ui/macrowarnmedium.ui"
+|| rUIFile == "modules/scalc/ui/textimportcsv.ui")
 {
 bUseJSBuilder = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-13 Thread merttumer (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   52 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   54 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   60 +
 3 files changed, 166 insertions(+)

New commits:
commit 285a41709835eba970cd3528a23b47eaea42d282
Author: merttumer 
AuthorDate: Thu May 13 11:21:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Thu May 13 13:47:20 2021 +0200

Unit tests for .uno:MoveShapeHandle command

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index ffb570d3fdf6..5772a5405f04 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -118,6 +118,7 @@ public:
 void testSortAscendingDescending();
 void testAutoInputStringBlock();
 void testAutoInputExactMatch();
+void testMoveShapeHandle();
 
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
@@ -169,6 +170,7 @@ public:
 CPPUNIT_TEST(testSortAscendingDescending);
 CPPUNIT_TEST(testAutoInputStringBlock);
 CPPUNIT_TEST(testAutoInputExactMatch);
+CPPUNIT_TEST(testMoveShapeHandle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -446,6 +448,7 @@ public:
 boost::property_tree::ptree m_aCommentCallbackResult;
 OString m_sInvalidateHeader;
 OString m_sInvalidateSheetGeometry;
+OString m_ShapeSelection;
 
 ViewCallback(bool bDeleteListenerOnDestruct=true)
 : m_bOwnCursorInvalidated(false),
@@ -508,6 +511,7 @@ public:
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 {
 m_bGraphicSelection = true;
+m_ShapeSelection = OString(pPayload);
 }
 break;
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
@@ -668,6 +672,54 @@ void ScTiledRenderingTest::testViewLock()
 CPPUNIT_ASSERT(!aView1.m_bViewLock);
 }
 
+static void lcl_extractHandleParameters(const OString& selection, int& id, 
int& x, int& y)
+{
+OString extraInfo = selection.copy(selection.indexOf("{"));
+std::stringstream aStream(extraInfo.getStr());
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+boost::property_tree::ptree
+handle0 = aTree
+.get_child("handles")
+.get_child("kinds")
+.get_child("rectangle")
+.get_child("1")
+.begin()->second;
+id = handle0.get_child("id").get_value();
+x = handle0.get_child("point").get_child("x").get_value();
+y = handle0.get_child("point").get_child("y").get_value();
+}
+
+void ScTiledRenderingTest::testMoveShapeHandle()
+{
+comphelper::LibreOfficeKit::setActive();
+ScModelObj* pModelObj = createDoc("shape.ods");
+ViewCallback aView1;
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, /*x=*/ 1,/*y=*/ 
1,/*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, /*x=*/ 1, /*y=*/ 
1, /*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+{
+int id, x, y;
+lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+int oldX = x;
+int oldY = y;
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
+{
+{"HandleNum", uno::makeAny(id)},
+{"NewPosX", uno::makeAny(x+1)},
+{"NewPosY", uno::makeAny(y+1)}
+}));
+comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+CPPUNIT_ASSERT_EQUAL(x-1, oldX);
+CPPUNIT_ASSERT_EQUAL(y-1, oldY);
+}
+}
+
 void ScTiledRenderingTest::testColRowResize()
 {
 comphelper::LibreOfficeKit::setActive();
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 109cc29edc87..ac1380ad2165 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -130,6 +130,7 @@ public:
 void testInsertDeletePageInvalidation();
 void testSpellOnlineRenderParameter();
 void testSlideDuplicateUndo();
+void testMoveShapeHandle();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testCreateDestroy);
@@ -185,6 +186,7 @@ public:
 CPPUNIT_TEST(testInsertDeletePageInvalidation);
 CPPUNIT_TEST(testSpellOnlineRenderParameter);
 CPPUNIT_TEST(testSlideDuplicateUndo);
+CPPUNIT_TEST(testMoveShapeHandle);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -866,6 +868,7 @@ public:
 std::map m_aViewCursorVi

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - configure.ac distro-configs/CPAndroidBranding.conf distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOfficeAndroid.co

2021-05-12 Thread merttumer (via logerrit)
 configure.ac  |2 +-
 distro-configs/CPAndroidBranding.conf |1 +
 distro-configs/LibreOfficeAndroid.conf|1 +
 distro-configs/LibreOfficeAndroidAarch64.conf |1 +
 distro-configs/LibreOfficeAndroidX86.conf |1 +
 distro-configs/LibreOfficeAndroidX86_64.conf  |1 +
 6 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit b9b5c8cc959fea981feaefd35050b2409e63d94e
Author: merttumer 
AuthorDate: Tue May 11 06:36:31 2021 +
Commit: Andras Timar 
CommitDate: Wed May 12 10:38:05 2021 +0200

Enable PdfIum for android build

Change-Id: I58d09db362f0de991eab3920683530e1ec43e2bc
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115373
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/configure.ac b/configure.ac
index a120ef24069f..86178a7014e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10993,7 +10993,7 @@ AC_SUBST([ENABLE_DCONF])
 # pdf import?
 AC_MSG_CHECKING([whether to build the PDF import feature])
 ENABLE_PDFIMPORT=
-if test $_os != Android -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = 
yes \); then
+if test \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
 AC_MSG_RESULT([yes])
 ENABLE_PDFIMPORT=TRUE
 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
diff --git a/distro-configs/CPAndroidBranding.conf 
b/distro-configs/CPAndroidBranding.conf
index 7d242f78fd07..3331bd483702 100644
--- a/distro-configs/CPAndroidBranding.conf
+++ b/distro-configs/CPAndroidBranding.conf
@@ -9,4 +9,5 @@
 --disable-scripting-javascript
 --with-lang=de en-US es fr pt-BR zh-CN zh-TW
 --with-myspell-dicts
+--enable-pdfimport
 --enable-release-build
diff --git a/distro-configs/LibreOfficeAndroid.conf 
b/distro-configs/LibreOfficeAndroid.conf
index 3ff76a8d60a9..82bc4afe0029 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidAarch64.conf 
b/distro-configs/LibreOfficeAndroidAarch64.conf
index bfc948c021f7..27ad9d1c788c 100644
--- a/distro-configs/LibreOfficeAndroidAarch64.conf
+++ b/distro-configs/LibreOfficeAndroidAarch64.conf
@@ -7,3 +7,4 @@
 --without-helppack-integration
 --without-junit
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86.conf 
b/distro-configs/LibreOfficeAndroidX86.conf
index 8fc92786c5e7..2692d796195b 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86_64.conf 
b/distro-configs/LibreOfficeAndroidX86_64.conf
index efbbdbb1e945..afc917d9a3f7 100644
--- a/distro-configs/LibreOfficeAndroidX86_64.conf
+++ b/distro-configs/LibreOfficeAndroidX86_64.conf
@@ -8,3 +8,4 @@
 --without-junit
 --disable-largefile
 --with-theme=colibre
+--disable-poppler
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-11 Thread merttumer (via logerrit)
 vcl/source/window/layout.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 0a0d19f8d604ea9560484817948f690978c8489a
Author: merttumer 
AuthorDate: Fri May 7 10:19:05 2021 +
Commit: Mert Tumer 
CommitDate: Wed May 12 05:55:56 2021 +0200

android: Fix DrawingArea inside CsvTableBox is shrinked

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

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 110ffa6b4f87..edebff002f8f 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -262,6 +263,14 @@ void VclBox::setAllocation(const Size &rAllocation)
 {
 Size aRequisition = calculateRequisition();
 nExtraSpace = (getPrimaryDimension(rAllocation) - 
getPrimaryDimension(aRequisition)) / nExpandChildren;
+// In mobile, the screen size is small and extraSpace can become negative
+// Though the dialogs are rendered in javascript for LOK Android some widgets 
like weld::DrawingArea
+// is sent as bitmap but it is rendered from only the visible part
+// when it gets negative, it shrinks instead of expands and it becomes 
invisible
+#if HAVE_FEATURE_ANDROID_LOK
+if (nExtraSpace < 0)
+nExtraSpace = 0;
+#endif
 }
 
 //Split into those we pack from the start onwards, and those we pack from 
the end backwards
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread merttumer (via logerrit)
 solenv/bin/native-code.py|1 +
 vcl/source/window/dialog.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a632d90b3e17c7efb9b9f712758896e8d8fdf2ea
Author: merttumer 
AuthorDate: Thu Apr 29 06:20:56 2021 +
Commit: Mert Tumer 
CommitDate: Mon May 3 06:54:15 2021 +0200

Wait for dialog response on Android

Do not return RET_OK immediately.

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

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index bf6bf188f14c..df02e19654bc 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 
 #ifdef IOS
 #include 
@@ -1037,7 +1038,7 @@ short Dialog::Execute()
 // Once the Android app is based on same idea as the iOS one currently
 // being developed, no conditional should be needed here. Until then,
 // play it safe.
-#if HAVE_FEATURE_DESKTOP || defined IOS
+#if HAVE_FEATURE_DESKTOP || defined IOS || HAVE_FEATURE_ANDROID_LOK
 VclPtr xWindow = this;
 
 mbInSyncExecute = true;
commit 661e6b9a993e262f96e2d2b02ed356017c1fa436
Author: merttumer 
AuthorDate: Thu Apr 29 06:20:19 2021 +
Commit: Mert Tumer 
CommitDate: Mon May 3 06:54:05 2021 +0200

Add missing FilterOptionsDialog constructor for android

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

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 996a12247ca8..8248a69bdb63 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -362,6 +362,7 @@ edit_constructor_list = [
 "Calc_XMLOasisMetaExporter_get_implementation",
 "Calc_XMLOasisSettingsExporter_get_implementation",
 "Calc_XMLOasisStylesExporter_get_implementation",
+"Calc_FilterOptionsDialog_get_implementation",
 # starmath/util/sm.component
 "Math_XMLOasisMetaExporter_get_implementation",
 "Math_XMLOasisSettingsExporter_get_implementation",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread merttumer (via logerrit)
 svx/source/svdraw/svdview.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 6f35a3a7c0549fc5803522a3fdd02da97276fadc
Author: merttumer 
AuthorDate: Wed Apr 21 12:05:07 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 3 06:52:31 2021 +0200

lok: Edit the click selected cell on table selection

for LOK case, it should start editing when table is selected
from the cell that is under the cursor instead of selecting the
table object.

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

diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index f819deba699f..dbb4c405bb10 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -48,6 +48,8 @@
 #include 
 #include 
 #include 
+#include 
+
 
 SdrViewEvent::SdrViewEvent()
 : pHdl(nullptr),
@@ -374,7 +376,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, 
SdrViewEvent& rVEvt) co
 // for e.g. URL links when hoovering and clicking
 // them will not work. Tried several other changes,
 // but this one safely keeps existing behaviour as-is.
-eHit = SdrHitKind::UnmarkedObject;
+// Except for the LOK. LOK doesn't have hoovering popup
+// feature.
+eHit = comphelper::LibreOfficeKit::isActive() ? 
SdrHitKind::TextEditObj : SdrHitKind::UnmarkedObject;
 break;
 default:
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread merttumer (via logerrit)
 svx/source/table/svdotable.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 4603627360eae1bd42d3dda5348abe11d79b261d
Author: merttumer 
AuthorDate: Thu Apr 15 11:27:08 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 3 06:52:06 2021 +0200

Fix Row size change is not updated

Row size is not taken into account when there is a change
Only if column size/position changes, it starts updating

Change-Id: I99f3aa9fe0e7f3428234062a2520ca8a61984067
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114130
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114645
Tested-by: Jenkins

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 9acef67c552f..05e8dda38e21 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -248,6 +248,7 @@ private:
 static sal_Int32 lastRowCount;
 static sal_Int32 lastColCount;
 static std::vector lastColWidths;
+static bool rowSizeChanged;
 };
 
 SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = nullptr;
@@ -258,6 +259,7 @@ bool SdrTableObjImpl::lastLayoutFitHeight;
 WritingMode SdrTableObjImpl::lastLayoutMode;
 sal_Int32 SdrTableObjImpl::lastRowCount;
 sal_Int32 SdrTableObjImpl::lastColCount;
+bool SdrTableObjImpl::rowSizeChanged = false;
 std::vector SdrTableObjImpl::lastColWidths;
 
 SdrTableObjImpl::SdrTableObjImpl()
@@ -604,6 +606,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int 
nEdge, sal_Int32 nOffset
 Reference< XIndexAccess > xRows( mxTable->getRows(), 
UNO_QUERY_THROW );
 Reference< XPropertySet > xRowSet( xRows->getByIndex( 
(!nEdge)?nEdge:(nEdge-1) ), UNO_QUERY_THROW );
 xRowSet->setPropertyValue( sSize, Any( nHeight ) );
+rowSizeChanged = true;
 }
 }
 else
@@ -807,7 +810,8 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 || lastLayoutMode != writingMode
 || lastRowCount != getRowCount()
 || lastColCount != getColumnCount()
-|| lastColWidths != getColumnWidths() )
+|| lastColWidths != getColumnWidths()
+|| rowSizeChanged )
 {
 lastLayoutTable = this;
 lastLayoutInputRectangle = rArea;
@@ -822,6 +826,7 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 TableModelNotifyGuard aGuard( mxTable.get() );
 mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
 lastLayoutResultRectangle = rArea;
+rowSizeChanged = false;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread merttumer (via logerrit)
 include/svx/sdr/table/tablecontroller.hxx |1 +
 include/svx/selectioncontroller.hxx   |2 ++
 svx/source/svdraw/selectioncontroller.cxx |4 
 svx/source/svdraw/svdview.cxx |   29 -
 svx/source/table/tablecontroller.cxx  |8 
 5 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 45602eb63bcea8e0fe084690144b6aba45f0a56a
Author: merttumer 
AuthorDate: Thu Apr 15 11:25:00 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 3 06:51:36 2021 +0200

Implemented CTRL + A selects all the cells

When the table is selected, ctrl + a should select
all the cells unless text editing is enabled.
The previous behavior was deselecting the table and
marking all the objects. However, for table it should
select all the cells instead.

Change-Id: I9fb512618a61a96ff21daa74c5a4ae9b31e3906e
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114129
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114644
Tested-by: Jenkins

diff --git a/include/svx/sdr/table/tablecontroller.hxx 
b/include/svx/sdr/table/tablecontroller.hxx
index 6b505ae4dfd3..e4b406b1f77a 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -58,6 +58,7 @@ public:
 SVX_DLLPRIVATE virtual bool DeleteMarked() override;
 
 SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
+SVX_DLLPRIVATE virtual void onSelectAll() override;
 
 SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
 virtual void Execute( SfxRequest& rReq ) override;
diff --git a/include/svx/selectioncontroller.hxx 
b/include/svx/selectioncontroller.hxx
index c9e12c322a5d..57dec07b9fd6 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -49,6 +49,8 @@ public:
 
 virtual void onSelectionHasChanged();
 
+virtual void onSelectAll();
+
 virtual void GetState( SfxItemSet& rSet );
 virtual void Execute( SfxRequest& rReq );
 
diff --git a/svx/source/svdraw/selectioncontroller.cxx 
b/svx/source/svdraw/selectioncontroller.cxx
index 28dda4ed27a2..5f6f51312f4e 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -47,6 +47,10 @@ void SelectionController::onSelectionHasChanged()
 {
 }
 
+void SelectionController::onSelectAll()
+{
+}
+
 void SelectionController::GetState( SfxItemSet& /*rSet*/ )
 {
 }
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 2cbed57bb1c2..f819deba699f 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1338,7 +1339,33 @@ void SdrView::MarkAll()
 
GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
 } else if (IsGluePointEditMode()) MarkAllGluePoints();
 else if (HasMarkablePoints()) MarkAllPoints();
-else MarkAllObj();
+else {
+// check for table
+bool bMarkAll = true;
+const SdrMarkList& rMarkList = GetMarkedObjectList();
+if (rMarkList.GetMarkCount() == 1)
+{
+const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
+SdrView* pView = this;
+if (pObj && pView && (pObj->GetObjInventor() == 
SdrInventor::Default)
+&& (pObj->GetObjIdentifier() == OBJ_TABLE))
+{
+mxSelectionController.clear();
+mxSelectionController = sdr::table::CreateTableController(
+*pView, static_cast(*pObj),
+mxLastSelectionController);
+
+if (mxSelectionController.is())
+{
+mxLastSelectionController.clear();
+mxSelectionController->onSelectAll();
+bMarkAll = false;
+}
+}
+}
+if ( bMarkAll )
+MarkAllObj();
+}
 }
 
 void SdrView::UnmarkAll()
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 438ffbcb9392..a81756c0ffdc 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -418,6 +418,14 @@ void SvxTableController::onSelectionHasChanged()
 destroySelectionOverlay();
 }
 }
+void SvxTableController::onSelectAll()
+{
+sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
+if ( pTableObj && !pTableObj->IsTextEditActive())
+{
+selectAll();
+}
+}
 
 
 void SvxTableController::GetState( SfxItemSet& rSet )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread merttumer (via logerrit)
 sd/qa/unit/tiledrendering/tiledrendering.cxx |4 ++--
 svx/source/table/tablecontroller.cxx |7 ---
 2 files changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 3ba86ee82a2d0c2d8cac3c7ee83e2c5f0a3c291e
Author: merttumer 
AuthorDate: Thu Apr 15 11:21:01 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon May 3 06:51:22 2021 +0200

Fix ESC key selects all the cells of the table object

Selecting the table should not necessarily mean
selecting all the cells. If all the cells are selected
which ESC key does the same thing, it is impossible to
delete the table with the delete key,
only after an input following by an ESC
deleselects them and deleting becomes possible.

Change-Id: I33f182d330f1cbc411d47b86098a4aea544a90ae
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114128
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114643
Tested-by: Jenkins

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 55d724a6a069..c9dbbd74fa14 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1453,8 +1453,8 @@ void SdTiledRenderingTest::testTdf118354()
 Scheduler::ProcessEventsToIdle();
 
 SdrView* pView = pViewShell->GetView();
-rtl::Reference 
xSelectionController(pView->getSelectionController());
-CPPUNIT_ASSERT(xSelectionController->hasSelectedCells());
+auto pMarkedObj = 
dynamic_cast(pView->GetMarkedObjectByIndex(0));
+CPPUNIT_ASSERT_EQUAL(pMarkedObj, pTableObject);
 }
 
 void SdTiledRenderingTest::testPostKeyEventInvalidation()
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 68880ad34754..438ffbcb9392 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -407,13 +407,6 @@ void SvxTableController::onSelectionHasChanged()
 const SdrMarkList& rMarkList= mrView.GetMarkedObjectList();
 if( rMarkList.GetMarkCount() == 1 )
 bSelected = mxTableObj.get() == 
rMarkList.GetMark(0)->GetMarkedSdrObj();
-/* fdo#46186 Selecting the table means selecting the entire cells */
-if (!hasSelectedCells() && pTableObj)
-{
-maCursorFirstPos = SdrTableObj::getFirstCell();
-maCursorLastPos = pTableObj->getLastCell();
-mbCellSelectionMode=true;
-}
 }
 
 if( bSelected )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-26 Thread merttumer (via logerrit)
 desktop/source/lib/lokinteractionhandler.cxx |   23 +++
 desktop/source/lib/lokinteractionhandler.hxx |1 +
 sfx2/source/doc/objstor.cxx  |3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 3f754470815e0dc5ac169a480931282107aad0f9
Author: merttumer 
AuthorDate: Mon Apr 26 08:12:11 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 26 14:17:05 2021 +0200

lok: Interaction handler for FilterOptions

This will enable Text Import Dialog to be executed
before the document is loaded

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

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 3ee9c891f6ea..ad480964616c 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -41,6 +41,8 @@
 #include 
 #include 
 
+#include 
+
 #include "../../inc/lib/init.hxx"
 
 #include 
@@ -330,6 +332,24 @@ bool LOKInteractionHandler::handlePasswordRequest(const 
uno::Sequence& xRequest)
+{
+document::FilterOptionsRequest aFilterOptionsRequest;
+uno::Any const request(xRequest->getRequest());
+if (request >>= aFilterOptionsRequest)
+{
+uno::Reference< task::XInteractionHandler2 > xInteraction(
+task::InteractionHandler::createWithParent(
+::comphelper::getProcessComponentContext(), nullptr));
+
+if (xInteraction.is())
+xInteraction->handleInteractionRequest(xRequest);
+
+return true;
+}
+return false;
+}
+
 sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
 const uno::Reference& xRequest)
 {
@@ -345,6 +365,9 @@ sal_Bool SAL_CALL 
LOKInteractionHandler::handleInteractionRequest(
 if (handlePasswordRequest(rContinuations, request))
 return true;
 
+if (handleFilterOptionsRequest(xRequest))
+return true;
+
 task::DocumentMacroConfirmationRequest aConfirmRequest;
 if (request >>= aConfirmRequest)
 {
diff --git a/desktop/source/lib/lokinteractionhandler.hxx 
b/desktop/source/lib/lokinteractionhandler.hxx
index f6dc441327d8..dc827b33d78f 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -76,6 +76,7 @@ private:
 bool handleIOException(const 
css::uno::Sequence> 
&rContinuations, const css::uno::Any& rRequest);
 bool handleNetworkException(const 
css::uno::Sequence> 
&rContinuations, const css::uno::Any& rRequest);
 bool handlePasswordRequest(const 
css::uno::Sequence> 
&rContinuations, const css::uno::Any& rRequest);
+bool handleFilterOptionsRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
Request);
 
 public:
 void SetPassword(char const* pPassword);
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9e54c3771f92..0a2dd750dad7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -874,7 +874,8 @@ ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const *
 SfxItemSet* pSet = pMedium->GetItemSet();
 const SfxStringItem* pOptions = SfxItemSet::GetItem(pSet, 
SID_FILE_FILTEROPTIONS, false);
 const SfxUnoAnyItem* pData = SfxItemSet::GetItem(pSet, 
SID_FILTER_DATA, false);
-if ( !pData && !pOptions )
+const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+if ( !pData && (bTiledRendering || !pOptions) )
 {
 css::uno::Reference< XMultiServiceFactory > xServiceManager = 
::comphelper::getProcessServiceFactory();
 css::uno::Reference< XNameAccess > xFilterCFG;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-26 Thread merttumer (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |7 +++
 sc/source/ui/inc/scuiasciiopt.hxx   |2 ++
 2 files changed, 9 insertions(+)

New commits:
commit a31145dee7908dd1dc800cdc0aea26b5fd17645d
Author: merttumer 
AuthorDate: Mon Apr 26 06:52:34 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 26 10:03:19 2021 +0200

lok: add global notifier to the "Text Import Dialog"

This dialog is displayed before the document is loaded
so no way to get access to the view shell notifier
when model/view/controller are not created yet.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 75d915438f44..58e50fb943d5 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 //! TODO make dynamic
 const SCSIZE ASCIIDLG_MAXROWS= MAXROWCOUNT;
@@ -516,6 +517,12 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 mxCkbSkipEmptyCells->set_active(false);
 mxCkbSkipEmptyCells->hide();
 }
+m_xDialog->SetInstallLOKNotifierHdl(LINK(this, ScImportAsciiDlg, 
InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(ScImportAsciiDlg, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+return GetpApp();
 }
 
 ScImportAsciiDlg::~ScImportAsciiDlg()
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx 
b/sc/source/ui/inc/scuiasciiopt.hxx
index 1b263931bc6f..b8cb2bcc6794 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -121,6 +121,8 @@ private:
 DECL_LINK( LbColTypeHdl, weld::ComboBox&, void 
);
 DECL_LINK( UpdateTextHdl, ScCsvTableBox&, void 
);
 DECL_LINK( ColTypeHdl, ScCsvTableBox&, void );
+DECL_STATIC_LINK(ScImportAsciiDlg, 
InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
+
 };
 
 inline bool ScImportAsciiDlg::Seek(sal_uLong nPos)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-26 Thread merttumer (via logerrit)
 vcl/source/window/builder.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6299bbc9c56faf9b03a01574065405ff301b2f1f
Author: merttumer 
AuthorDate: Mon Apr 26 06:29:43 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 26 10:02:52 2021 +0200

Added Text Import Dialog to JSDialogs list

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8a5c3783830d..901725d94859 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -192,7 +192,8 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
 || rUIFile == "svx/ui/fontworkgallerydialog.ui"
 || rUIFile == "cui/ui/macroselectordialog.ui"
-|| rUIFile == "uui/ui/macrowarnmedium.ui")
+|| rUIFile == "uui/ui/macrowarnmedium.ui"
+|| rUIFile == "modules/scalc/ui/textimportcsv.ui")
 {
 bUseJSBuilder = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-22 Thread merttumer (via logerrit)
 svx/source/svdraw/svdview.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e7ef006f2f3d27904618adf59dd8b2f2c403f30a
Author: merttumer 
AuthorDate: Wed Apr 21 12:05:07 2021 +0300
Commit: Mert Tumer 
CommitDate: Thu Apr 22 09:17:34 2021 +0200

lok: Edit the click selected cell on table selection

for LOK case, it should start editing when table is selected
from the cell that is under the cursor instead of selecting the
table object.

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

diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index bb677b7707e6..2c784b6a6e2e 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 SdrViewEvent::SdrViewEvent()
@@ -385,7 +386,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, 
SdrViewEvent& rVEvt) co
 // for e.g. URL links when hoovering and clicking
 // them will not work. Tried several other changes,
 // but this one safely keeps existing behaviour as-is.
-eHit = SdrHitKind::UnmarkedObject;
+// Except for the LOK. LOK doesn't have hoovering popup
+// feature.
+eHit = comphelper::LibreOfficeKit::isActive() ? 
SdrHitKind::TextEditObj : SdrHitKind::UnmarkedObject;
 break;
 default:
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 9 commits - include/svx sc/source sd/source svx/sdi svx/source sw/source

2021-04-20 Thread merttumer (via logerrit)
 include/svx/svddrag.hxx|   12 ++
 include/svx/svdmrkv.hxx|1 
 include/svx/svdoedge.hxx   |2 
 include/svx/svdview.hxx|3 
 sc/source/ui/drawfunc/drawsh.cxx   |5 -
 sc/source/ui/view/tabvwsh2.cxx |2 
 sd/source/ui/view/drviews2.cxx |6 -
 sd/source/ui/view/drviewse.cxx |4 
 svx/sdi/svx.sdi|2 
 svx/source/sdr/contact/objectcontactofpageview.cxx |3 
 svx/source/sdr/contact/viewobjectcontact.cxx   |7 +
 svx/source/svdraw/svddrgv.cxx  |   13 +-
 svx/source/svdraw/svdglue.cxx  |5 +
 svx/source/svdraw/svdmrkv.cxx  |   98 -
 svx/source/svdraw/svdoedge.cxx |   22 
 svx/source/svdraw/svdpntv.cxx  |5 +
 svx/source/svdraw/svdview.cxx  |   17 ++-
 sw/source/uibase/shells/drawsh.cxx |5 -
 sw/source/uibase/uiview/view2.cxx  |5 -
 sw/source/uibase/uiview/viewdraw.cxx   |3 
 20 files changed, 194 insertions(+), 26 deletions(-)

New commits:
commit f241aaec7895b1f72fec3433a43404468ec68a3e
Author: merttumer 
AuthorDate: Fri Apr 2 16:18:05 2021 +0300
Commit: Andras Timar 
CommitDate: Tue Apr 20 09:53:43 2021 +0200

lok: Pass object ord num in the uno command

When multiple objects' glue points collide the ordnum
will be used to decide which glue point to connect to
for the connectors. Without that the default logic chooses
the lowest ordered object which is searched and found in the object list

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

diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
index 80c2406b9046..6718e5f36b5d 100644
--- a/include/svx/svddrag.hxx
+++ b/include/svx/svddrag.hxx
@@ -79,6 +79,16 @@ class SVXCORE_DLLPUBLIC SdrDragStat final
 
 sal_Int32 GetPrevPos() const { return mvPnts.size()-(mvPnts.size()>1 ? 2 : 
1); }
 
+// This is passed all the way through to ApplySpecialDrag of the Edge 
Object
+// For LOK, we cannot really specify which glue point to select by default
+// It selects the nearest glue points after DragEnd event.
+// When multiple objects are on top of each other or somehow their glue 
points
+// collide, the glue point is selected from the lowest order numbered 
object
+// We can pass the ord number information inside the draginfo and choose 
the correct shape
+struct {
+sal_Int32 objectOrdNum = -1;
+} mGlueOptions;
+
 public:
 SdrDragStat(){ Reset(); }
 ~SdrDragStat();
@@ -158,6 +168,8 @@ public:
 
 // Also considering 1stPointAsCenter
 void TakeCreateRect(tools::Rectangle& rRect) const;
+
+auto&GetGlueOptions() { return mGlueOptions; }
 };
 
 #endif // INCLUDED_SVX_SVDDRAG_HXX
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 5d0116cb97d8..8a927494714d 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -177,7 +177,7 @@ protected:
 XPolygon ImpCalcEdgeTrack(const Point& rPt1, tools::Long nAngle1, const 
tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1,
 const Point& rPt2, tools::Long nAngle2, const tools::Rectangle& 
rBoundRect2, const tools::Rectangle& rBewareRect2,
 sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
-static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr);
+static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr, 
SdrDragStat* pDragStat = nullptr);
 static SdrEscapeDirection ImpCalcEscAngle(SdrObject const * pObj, const 
Point& aPt2);
 void ImpSetTailPoint(bool bTail1, const Point& rPt);
 void ImpUndirtyEdgeTrack();  // potential recalculation of the connection 
track
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index 149b17f9ece9..7020f6447b4d 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -242,7 +242,8 @@ public:
 SdrPageWindow& rPageWindow,
 const char* pDebugName) const;
 
-bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint);
+// Interactive Move Action programmaticaly
+bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, 
const sal_Int32 aObjectOrdNum = -1);
 };
 
 // First of all the app creates a SdrModel.
diff --git a/sc/so

[Libreoffice-commits] core.git: include/svx sc/source sd/source svx/sdi svx/source sw/source

2021-04-19 Thread merttumer (via logerrit)
 include/svx/svddrag.hxx|   12 
 include/svx/svdoedge.hxx   |2 +-
 include/svx/svdview.hxx|3 ++-
 sc/source/ui/drawfunc/drawsh.cxx   |5 +++--
 sd/source/ui/view/drviews2.cxx |6 --
 svx/sdi/svx.sdi|2 +-
 svx/source/svdraw/svdoedge.cxx |   22 --
 svx/source/svdraw/svdview.cxx  |   17 -
 sw/source/uibase/shells/drawsh.cxx |5 +++--
 sw/source/uibase/uiview/view2.cxx  |5 +++--
 10 files changed, 61 insertions(+), 18 deletions(-)

New commits:
commit b18bff18785cc194f9918f6bdf69523827ef
Author: merttumer 
AuthorDate: Fri Apr 2 16:18:05 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 06:52:26 2021 +0200

lok: Pass object ord num in the uno command

When multiple objects' glue points collide the ordnum
will be used to decide which glue point to connect to
for the connectors. Without that the default logic chooses
the lowest ordered object which is searched and found in the object list

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

diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
index 80c2406b9046..6718e5f36b5d 100644
--- a/include/svx/svddrag.hxx
+++ b/include/svx/svddrag.hxx
@@ -79,6 +79,16 @@ class SVXCORE_DLLPUBLIC SdrDragStat final
 
 sal_Int32 GetPrevPos() const { return mvPnts.size()-(mvPnts.size()>1 ? 2 : 
1); }
 
+// This is passed all the way through to ApplySpecialDrag of the Edge 
Object
+// For LOK, we cannot really specify which glue point to select by default
+// It selects the nearest glue points after DragEnd event.
+// When multiple objects are on top of each other or somehow their glue 
points
+// collide, the glue point is selected from the lowest order numbered 
object
+// We can pass the ord number information inside the draginfo and choose 
the correct shape
+struct {
+sal_Int32 objectOrdNum = -1;
+} mGlueOptions;
+
 public:
 SdrDragStat(){ Reset(); }
 ~SdrDragStat();
@@ -158,6 +168,8 @@ public:
 
 // Also considering 1stPointAsCenter
 void TakeCreateRect(tools::Rectangle& rRect) const;
+
+auto&GetGlueOptions() { return mGlueOptions; }
 };
 
 #endif // INCLUDED_SVX_SVDDRAG_HXX
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index fe09104dbc4e..17108ad856ec 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -177,7 +177,7 @@ protected:
 XPolygon ImpCalcEdgeTrack(const Point& rPt1, tools::Long nAngle1, const 
tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1,
 const Point& rPt2, tools::Long nAngle2, const tools::Rectangle& 
rBoundRect2, const tools::Rectangle& rBewareRect2,
 sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
-static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr);
+static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr, 
SdrDragStat* pDragStat = nullptr);
 static SdrEscapeDirection ImpCalcEscAngle(SdrObject const * pObj, const 
Point& aPt2);
 void ImpSetTailPoint(bool bTail1, const Point& rPt);
 void ImpUndirtyEdgeTrack();  // potential recalculation of the connection 
track
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index 149b17f9ece9..7020f6447b4d 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -242,7 +242,8 @@ public:
 SdrPageWindow& rPageWindow,
 const char* pDebugName) const;
 
-bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint);
+// Interactive Move Action programmaticaly
+bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, 
const sal_Int32 aObjectOrdNum = -1);
 };
 
 // First of all the app creates a SdrModel.
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 90bf9f8e51cd..4a46f3d69c90 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -205,16 +205,17 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 case SID_MOVE_SHAPE_HANDLE:
 {
 const SfxItemSet *pArgs = rReq.GetArgs ();
-if (pArgs && pArgs->Count () == 3)
+if (pArgs && pArgs->Count () >= 3)
 {
 const SfxUInt32Item* handleNumItem = 
rReq.GetArg(FN_PARAM_1);
 const SfxUInt32Item* newPosXTwips = 
rReq.GetArg(FN_PARAM_2);
 const SfxUInt32Item* newPosYTwips = 
rReq.GetArg(FN_PARAM_3);
+   

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

2021-04-19 Thread merttumer (via logerrit)
 svx/source/svdraw/svdmrkv.cxx |   62 +-
 1 file changed, 38 insertions(+), 24 deletions(-)

New commits:
commit 7f26b1b47819754ed5461517300346961a5bbbe4
Author: merttumer 
AuthorDate: Fri Apr 2 16:14:55 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 06:52:15 2021 +0200

Improve dumpGluePointsAsJSON

added gridoffset for the shape for calc
changed the logic, now the ordnum would be enough

Change-Id: Iebe7d29c569a4cb968fe2e5ef1692b59f0c4b2d8
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113516
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114031
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index c0ccd27d070f..b5adf79a6b3b 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -694,37 +694,51 @@ bool 
SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
 if (rOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
 bConvertUnit = true;
 const SdrObjList* pOL = mpMarkedPV->GetObjList();
+if (!pOL)
+return false;
 const size_t nObjCount = pOL->GetObjCount();
 boost::property_tree::ptree elements;
 for (size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
 {
-const SdrObject* pObj = pOL->GetObj(nObjNum);
+SdrObject* pObj = pOL->GetObj(nObjNum);
+if (!pObj)
+continue;
+if (pObj == GetMarkedObjectByIndex(0))
+continue;
 const SdrGluePointList* pGPL = pObj->GetGluePointList();
-if (pGPL != nullptr && pGPL->GetCount())
+bool VertexObject = !(pGPL && pGPL->GetCount());
+const size_t count = !VertexObject ? pGPL->GetCount() : 4;
+boost::property_tree::ptree object;
+boost::property_tree::ptree points;
+for (size_t i = 0; i < count; ++i)
 {
-boost::property_tree::ptree object;
-boost::property_tree::ptree points;
-for (size_t i = 0; i < pGPL->GetCount(); ++i)
-{
-boost::property_tree::ptree node;
-boost::property_tree::ptree point;
-const SdrGluePoint& rGP = (*pGPL)[i];
-// coordinates are relative to the OBJ snap rect
-Point rPoint = pObj->GetSnapRect().TopLeft();
-rPoint.Move(rGP.GetPos().getX(), rGP.GetPos().getY());
-if (bConvertUnit)
-rPoint = OutputDevice::LogicToLogic(rPoint, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-point.put("x", rPoint.getX());
-point.put("y", rPoint.getY());
-node.put("glueId", rGP.GetId());
-node.add_child("point", point);
-points.push_back(std::make_pair("", node));
-}
-object.put("id", reinterpret_cast(pObj));
-object.add_child("gluepoints", points);
-elements.push_back(std::make_pair("", object));
-result = true;
+boost::property_tree::ptree node;
+boost::property_tree::ptree point;
+const SdrGluePoint& rGP = !VertexObject ? (*pGPL)[i] : 
pObj->GetVertexGluePoint(i);
+Point rPoint = rGP.GetAbsolutePos(*pObj);
+if (bConvertUnit)
+rPoint = OutputDevice::LogicToLogic(rPoint, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+point.put("x", rPoint.getX());
+point.put("y", rPoint.getY());
+node.add_child("point", point);
+points.push_back(std::make_pair("", node));
+}
+basegfx::B2DVector aGridOffset(0.0, 0.0);
+Point objLogicRectTopLeft = pObj->GetLogicRect().TopLeft();
+if(getPossibleGridOffsetForPosition(aGridOffset, 
basegfx::B2DPoint(objLogicRectTopLeft.X(), objLogicRectTopLeft.Y()), 
GetSdrPageView()))
+{
+Point p(aGridOffset.getX(), aGridOffset.getY());
+if (bConvertUnit)
+p = OutputDevice::LogicToLogic(p, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+boost::property_tree::ptree gridOffset;
+gridOffset.put("x", p.getX());
+gridOffset.put("y", p.getY());
+object.add_child("gridoffset", gridOffset);
 }
+object.put("ordnum", pObj->GetOrdNum());
+object.add_child("gluepoints", points);
+elements.push_back(std::make_pair("", object));
+result = true;
 }
 rTree.add_child("shapes", elements);
 }
___
Libreoffice-commits 

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

2021-04-19 Thread merttumer (via logerrit)
 include/svx/svdmrkv.hxx   |1 
 svx/source/svdraw/svdmrkv.cxx |   59 ++
 2 files changed, 60 insertions(+)

New commits:
commit 415622a523a783fc3494bc09a52ee870a6458e2c
Author: merttumer 
AuthorDate: Thu Mar 11 12:16:51 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:33:35 2021 +0200

Get Glue Points in the selection callback

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

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 17e9ad2b15f9..bbe0e8eb2446 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -148,6 +148,7 @@ private:
 void UndirtyMrkPnt() const;
 
 void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell);
+bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree);
 
 protected:
 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index f42214daf8ad..c0ccd27d070f 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -685,6 +685,52 @@ OUString lcl_getDragParameterString( const OUString& rCID )
 }
 } // anonymous namespace
 
+bool SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
+{
+bool result = false;
+if (OutputDevice* rOutDev = mpMarkedPV->GetView().GetFirstOutputDevice())
+{
+bool bConvertUnit = false;
+if (rOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+bConvertUnit = true;
+const SdrObjList* pOL = mpMarkedPV->GetObjList();
+const size_t nObjCount = pOL->GetObjCount();
+boost::property_tree::ptree elements;
+for (size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
+{
+const SdrObject* pObj = pOL->GetObj(nObjNum);
+const SdrGluePointList* pGPL = pObj->GetGluePointList();
+if (pGPL != nullptr && pGPL->GetCount())
+{
+boost::property_tree::ptree object;
+boost::property_tree::ptree points;
+for (size_t i = 0; i < pGPL->GetCount(); ++i)
+{
+boost::property_tree::ptree node;
+boost::property_tree::ptree point;
+const SdrGluePoint& rGP = (*pGPL)[i];
+// coordinates are relative to the OBJ snap rect
+Point rPoint = pObj->GetSnapRect().TopLeft();
+rPoint.Move(rGP.GetPos().getX(), rGP.GetPos().getY());
+if (bConvertUnit)
+rPoint = OutputDevice::LogicToLogic(rPoint, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+point.put("x", rPoint.getX());
+point.put("y", rPoint.getY());
+node.put("glueId", rGP.GetId());
+node.add_child("point", point);
+points.push_back(std::make_pair("", node));
+}
+object.put("id", reinterpret_cast(pObj));
+object.add_child("gluepoints", points);
+elements.push_back(std::make_pair("", object));
+result = true;
+}
+}
+rTree.add_child("shapes", elements);
+}
+return result;
+}
+
 void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell)
 {
 SfxViewShell* pViewShell = GetSfxViewShell();
@@ -737,13 +783,19 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 OString sSelectionText;
 OString sSelectionTextView;
 boost::property_tree::ptree aTableJsonTree;
+boost::property_tree::ptree aGluePointsTree;
 bool bTableSelection = false;
+bool bConnectorSelection = false;
 
 if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
 {
 auto& rTableObject = 
dynamic_cast(*mpMarkedObj);
 bTableSelection = 
rTableObject.createTableEdgesJson(aTableJsonTree);
 }
+if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_EDGE)
+{
+bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree);
+}
 if (GetMarkedObjectCount())
 {
 SdrMark* pM = GetSdrMarkByIndex(0);
@@ -971,6 +1023,13 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 boost::property_tree::write_json(aStream, responseJSON, 
/*pretty=*/ false);
 handleArrayStr = ", \"handles\":";
 handleArrayStr = handleArrayStr + aStream.str().c_str();
+if (bConnectorSelection)
+

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

2021-04-19 Thread merttumer (via logerrit)
 svx/source/svdraw/svdglue.cxx |5 +
 svx/source/svdraw/svdpntv.cxx |5 +
 2 files changed, 10 insertions(+)

New commits:
commit 611130065625650adad4e2e2204ca5b42b9f65c0
Author: merttumer 
AuthorDate: Thu Mar 11 10:33:04 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:33:16 2021 +0200

lok: Don't invalidate GluePoints

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

diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 4cce1a58ad26..05a89173e5df 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 const Size aGlueHalfSize(4,4);
 
@@ -253,6 +254,8 @@ void SdrGluePoint::Shear(const Point& rRef, double tn, bool 
bVShear, const SdrOb
 
 void SdrGluePoint::Invalidate(vcl::Window& rWin, const SdrObject* pObj) const
 {
+if (comphelper::LibreOfficeKit::isActive())
+return;
 bool bMapMode=rWin.IsMapModeEnabled();
 Point aPt(pObj!=nullptr ? GetAbsolutePos(*pObj) : GetPos());
 aPt=rWin.LogicToPixel(aPt);
@@ -324,6 +327,8 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
 
 void SdrGluePointList::Invalidate(vcl::Window& rWin, const SdrObject* pObj) 
const
 {
+if (comphelper::LibreOfficeKit::isActive())
+return;
 for (auto& xGP : aList)
 xGP->Invalidate(rWin,pObj);
 }
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 59d1a55a..9074036a3edc 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -780,6 +780,11 @@ bool SdrPaintView::KeyInput(const KeyEvent& /*rKEvt*/, 
vcl::Window* /*pWin*/)
 
 void SdrPaintView::GlueInvalidate() const
 {
+// Do not invalidate GluePoints in Online
+// They are handled on front-end
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 const sal_uInt32 nWindowCount(PaintWindowCount());
 
 for(sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-19 Thread merttumer (via logerrit)
 svx/source/sdr/contact/objectcontactofpageview.cxx |3 +-
 svx/source/svdraw/svdmrkv.cxx  |   25 -
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 836afbb007e7f34e3587de34fdf1fbb2371fd60b
Author: merttumer 
AuthorDate: Thu Mar 11 09:52:00 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:58 2021 +0200

Hide GluePoints in LOK

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

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 364b0d90bfea..41717d276381 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -340,7 +340,8 @@ namespace sdr::contact
 // Get info about the need to visualize GluePoints
 bool ObjectContactOfPageView::AreGluePointsVisible() const
 {
-return GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
+bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+return !bTiledRendering && 
GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
 }
 
 // check if text animation is allowed.
commit fa8991840e122303bf9fa43d36864dd29529b0d2
Author: merttumer 
AuthorDate: Thu Mar 25 12:44:17 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:43 2021 +0200

lok: Send gridOffset of the shape

In core, the gridOffset is calculated based on the LogicRect's TopLeft 
coordinate
In online, we have the SnapRect and we calculate it based on its TopLeft 
coordinate
SnapRect's TopLeft and LogicRect's TopLeft match when there is no rotation
but the rotation is not applied to the LogicRect. Therefore,
what we calculate in online does not match in case of the rotated shape.
Here we can send the correct gridOffset in the selection callback.
whether the shape is rotated or not, we will always have the correct 
gridOffset
Note that the gridOffset is always calculated from the first selected obj

Change-Id: Icc62a94879367f9b55ad05887945393452021777
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113078
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114027
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 5f1d65ef185b..f42214daf8ad 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -692,6 +692,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 tools::Rectangle aSelection(rRect);
 bool bIsChart = false;
 Point addLogicOffset(0, 0);
+bool convertMapMode = false;
 if (!rRect.IsEmpty())
 {
 sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -721,7 +722,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 if (OutputDevice* pOutputDevice = 
mpMarkedPV->GetView().GetFirstOutputDevice())
 {
 if (pOutputDevice->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM)
+{
 aSelection = OutputDevice::LogicToLogic(aSelection, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+convertMapMode = true;
+}
 }
 }
 
@@ -757,6 +761,26 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 aExtraInfo.append("\",\"type\":");
 aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
 
+// In core, the gridOffset is calculated based on the LogicRect's 
TopLeft coordinate
+// In online, we have the SnapRect and we calculate it based on 
its TopLeft coordinate
+// SnapRect's TopLeft and LogicRect's TopLeft match unless there 
is rotation
+// but the rotation is not applied to the LogicRect. Therefore,
+// what we calculate in online does not match with the core in 
case of the rotation.
+// Here we can send the correct gridOffset in the selection 
callback, this way
+// whether the shape is rotated or not, we will always have the 
correct gridOffset
+// Note that the gridOffset is calculated from the first selected 
obj
+basegfx::B2DVector aGridOffset(0.0, 0.0);
+if(getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+{
+Point p(aGridOffset.getX(), aGridOffset.getY());
+if (convertMapMode)
+p = OutputDevice::

[Libreoffice-commits] core.git: 2 commits - sc/source sd/source svx/source sw/source

2021-04-19 Thread merttumer (via logerrit)
 sc/source/ui/view/tabvwsh2.cxx   |2 ++
 sd/source/ui/view/drviewse.cxx   |4 
 svx/source/svdraw/svddrgv.cxx|   13 +
 sw/source/uibase/uiview/viewdraw.cxx |3 +++
 4 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit 2a91d96591001c83cac56e924fc6748c7900f7e5
Author: merttumer 
AuthorDate: Wed Mar 24 12:06:08 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:22 2021 +0200

LOK: Fix Moving drag handles calculates wrong offset

When dragging the shape handles for resizing,
the handle's grid offset must be the shapes grid
offset. In small numbered row&column orders, it is
not visible much since the difference is very little
but as the number gets greater, the difference becomes more visible.

Change-Id: I44d03cc67a239c8b7758206930def331ed8e5e42
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113028
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114026
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 9807a53bd99e..6cbba5494070 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace sdr;
 
@@ -206,10 +207,12 @@ bool SdrDragView::BegDragObj(const Point& rPnt, 
OutputDevice* pOut, SdrHdl* pHdl
 
 // Coordinate maybe affected by GridOffset, so we may need to
 // adapt to Model-coordinates here
-if(getPossibleGridOffsetForPosition(
+if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
+&& getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+|| (getPossibleGridOffsetForPosition(
 aGridOffset,
 basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
-GetSdrPageView()))
+GetSdrPageView(
 {
 aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
 aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
@@ -508,10 +511,12 @@ void SdrDragView::MovDragObj(const Point& rPnt)
 
 // Coordinate maybe affected by GridOffset, so we may need to
 // adapt to Model-coordinates here
-if(getPossibleGridOffsetForPosition(
+if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
+&& getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+|| (getPossibleGridOffsetForPosition(
 aGridOffset,
 basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
-GetSdrPageView()))
+GetSdrPageView(
 {
 aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
 aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
commit c853d446a7cd8a8436cb5f43bbf81a723bd86c99
Author: merttumer 
AuthorDate: Fri Mar 19 12:31:42 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:00 2021 +0200

Fix Line and Connectors enable interactive drawing

We add them directly for LOK case and have no functionality
for interactive drawing.

Noticed that in Writer we didnt even add them directly
I also implemented that as well.

Change-Id: If90bfc8d2cdf84f200bc7963ae4126ef789524ff
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112703
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114025
Tested-by: Jenkins

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index f213c5b822ef..652482ec5d6f 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -231,6 +231,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_ELLIPSE:
 case SID_DRAW_MEASURELINE:
 pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
pDoc, aNewReq));
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
 break;
 
 case SID_DRAW_CAPTION:
@@ -332,6 +333,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 }
 else
 {
+GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, 
SfxCallMode::ASYNCHRON);
 ScViewData& rViewData = GetViewData();
 aInsertPos = rViewData.getLOKVisibleArea().Center();
 if (comphelper::LibreOfficeKit::isCompatFlagSet(
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index b833b1d3b719..2247294cfaba 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -605,6 +605,10 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 if(!(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || 
bCreateDirectly)))
 return;
 
+// disable interactive drawing for LOK
+if (bCreateDirectly)
+GetViewFrame()->GetDispa

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

2021-04-19 Thread merttumer (via logerrit)
 svx/source/sdr/contact/viewobjectcontact.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit da7dcf0037b374a8cecdbd2af27748d94a316a79
Author: merttumer 
AuthorDate: Wed Mar 17 09:01:45 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:31:49 2021 +0200

LOK: Fix wrong gridOffset when shape is moved on calc

Change-Id: I37501128068943cee8f67a5d91a35ec1a76fe550
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112599
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114024
Tested-by: Jenkins

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 7e214b76199e..6387c39afcbf 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -224,8 +224,11 @@ void ViewObjectContact::ActionChanged()
 // invalidate current valid range
 GetObjectContact().InvalidatePartOfView(maObjectRange);
 
-// reset ObjectRange, it needs to be recalculated
-maObjectRange.reset();
+// reset gridOffset, it needs to be recalculated
+if (GetObjectContact().supportsGridOffsets())
+resetGridOffset();
+else
+maObjectRange.reset();
 }
 
 // register at OC for lazy invalidate
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-18 Thread merttumer (via logerrit)
 svx/source/table/svdotable.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit a20fee0312bd3bcf41e88cdb8a84d0ee10de901f
Author: merttumer 
AuthorDate: Thu Apr 15 11:27:08 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 19 07:52:31 2021 +0200

Fix Row size change is not updated

Row size is not taken into account when there is a change
Only if column size/position changes, it starts updating

Change-Id: I99f3aa9fe0e7f3428234062a2520ca8a61984067
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114130
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 77dc10165480..18e94d7a9bae 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -245,6 +245,7 @@ private:
 static sal_Int32 lastRowCount;
 static sal_Int32 lastColCount;
 static std::vector lastColWidths;
+static bool rowSizeChanged;
 };
 
 SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = nullptr;
@@ -255,6 +256,7 @@ bool SdrTableObjImpl::lastLayoutFitHeight;
 WritingMode SdrTableObjImpl::lastLayoutMode;
 sal_Int32 SdrTableObjImpl::lastRowCount;
 sal_Int32 SdrTableObjImpl::lastColCount;
+bool SdrTableObjImpl::rowSizeChanged = false;
 std::vector SdrTableObjImpl::lastColWidths;
 
 SdrTableObjImpl::SdrTableObjImpl()
@@ -599,6 +601,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int 
nEdge, sal_Int32 nOffset
 Reference< XIndexAccess > xRows( mxTable->getRows(), 
UNO_QUERY_THROW );
 Reference< XPropertySet > xRowSet( xRows->getByIndex( 
(!nEdge)?nEdge:(nEdge-1) ), UNO_QUERY_THROW );
 xRowSet->setPropertyValue( sSize, Any( nHeight ) );
+rowSizeChanged = true;
 }
 }
 else
@@ -801,7 +804,8 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 || lastLayoutMode != writingMode
 || lastRowCount != getRowCount()
 || lastColCount != getColumnCount()
-|| lastColWidths != getColumnWidths() )
+|| lastColWidths != getColumnWidths()
+|| rowSizeChanged )
 {
 lastLayoutTable = this;
 lastLayoutInputRectangle = rArea;
@@ -816,6 +820,7 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 TableModelNotifyGuard aGuard( mxTable.get() );
 mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
 lastLayoutResultRectangle = rArea;
+rowSizeChanged = false;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-18 Thread merttumer (via logerrit)
 include/svx/sdr/table/tablecontroller.hxx |1 +
 include/svx/selectioncontroller.hxx   |2 ++
 svx/source/svdraw/selectioncontroller.cxx |4 
 svx/source/svdraw/svdview.cxx |   29 -
 svx/source/table/tablecontroller.cxx  |   15 ---
 5 files changed, 43 insertions(+), 8 deletions(-)

New commits:
commit 4d0fb81ce3381011f7c9baf9cd6c416bd4c294a4
Author: merttumer 
AuthorDate: Thu Apr 15 11:25:00 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 19 07:52:22 2021 +0200

Implemented CTRL + A selects all the cells

When the table is selected, ctrl + a should select
all the cells unless text editing is enabled.
The previous behavior was deselecting the table and
marking all the objects. However, for table it should
select all the cells instead.

Change-Id: I9fb512618a61a96ff21daa74c5a4ae9b31e3906e
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114129
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/svx/sdr/table/tablecontroller.hxx 
b/include/svx/sdr/table/tablecontroller.hxx
index 7e438015e907..5edb3666dcbf 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -57,6 +57,7 @@ public:
 SVX_DLLPRIVATE virtual bool DeleteMarked() override;
 
 SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
+SVX_DLLPRIVATE virtual void onSelectAll() override;
 
 SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
 SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ) override;
diff --git a/include/svx/selectioncontroller.hxx 
b/include/svx/selectioncontroller.hxx
index 79c19f60dc61..bc4fbbf5098c 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -50,6 +50,8 @@ public:
 
 virtual void onSelectionHasChanged();
 
+virtual void onSelectAll();
+
 virtual void GetState( SfxItemSet& rSet );
 virtual void Execute( SfxRequest& rReq );
 
diff --git a/svx/source/svdraw/selectioncontroller.cxx 
b/svx/source/svdraw/selectioncontroller.cxx
index 28dda4ed27a2..5f6f51312f4e 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -47,6 +47,10 @@ void SelectionController::onSelectionHasChanged()
 {
 }
 
+void SelectionController::onSelectAll()
+{
+}
+
 void SelectionController::GetState( SfxItemSet& /*rSet*/ )
 {
 }
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 36fd070e1205..bb677b7707e6 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1354,7 +1355,33 @@ void SdrView::MarkAll()
 #endif
 } else if (IsGluePointEditMode()) MarkAllGluePoints();
 else if (HasMarkablePoints()) MarkAllPoints();
-else MarkAllObj();
+else {
+// check for table
+bool bMarkAll = true;
+const SdrMarkList& rMarkList = GetMarkedObjectList();
+if (rMarkList.GetMarkCount() == 1)
+{
+const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
+SdrView* pView(dynamic_cast(this));
+if (pObj && pView && (pObj->GetObjInventor() == 
SdrInventor::Default)
+&& (pObj->GetObjIdentifier() == OBJ_TABLE))
+{
+mxSelectionController.clear();
+mxSelectionController = sdr::table::CreateTableController(
+*pView, static_cast(*pObj),
+mxLastSelectionController);
+
+if (mxSelectionController.is())
+{
+mxLastSelectionController.clear();
+mxSelectionController->onSelectAll();
+bMarkAll = false;
+}
+}
+}
+if ( bMarkAll )
+MarkAllObj();
+}
 }
 
 void SdrView::UnmarkAll()
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 21d7809b3d03..464d8290e572 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -413,6 +413,14 @@ void SvxTableController::onSelectionHasChanged()
 destroySelectionOverlay();
 }
 }
+void SvxTableController::onSelectAll()
+{
+sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
+if ( pTableObj && !pTableObj->IsTextEditActive())
+{
+selectAll();
+}
+}
 
 
 void SvxTableController::GetState( SfxItemSet& rSet )
commit d7981dde529810c4e8f548f7bf2be7c3b005ce99
Author: merttumer 
AuthorDate: Thu Apr 15 11:21:01 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Apr 19 07:52:10 2021 +0200

Fix ESC key selects all the cells of the table object

Selecting the table should not necessarily mean
selecting all the cells. If all the cells are selected
which ESC

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/svx sc/source sd/source svx/sdi svx/source sw/source

2021-04-08 Thread merttumer (via logerrit)
 include/svx/svddrag.hxx|   12 +++
 include/svx/svdoedge.hxx   |2 -
 include/svx/svdview.hxx|2 -
 sc/source/ui/drawfunc/drawsh.cxx   |5 +-
 sd/source/ui/view/drviews2.cxx |6 ++-
 svx/sdi/svx.sdi|2 -
 svx/source/svdraw/svdmrkv.cxx  |   62 ++---
 svx/source/svdraw/svdoedge.cxx |   22 +++--
 svx/source/svdraw/svdview.cxx  |   13 +--
 sw/source/uibase/shells/drawsh.cxx |5 +-
 sw/source/uibase/uiview/view2.cxx  |5 +-
 11 files changed, 96 insertions(+), 40 deletions(-)

New commits:
commit a33f16fd4127030a25b4ef0e4e965b8aa07afcb7
Author: merttumer 
AuthorDate: Fri Apr 2 16:18:05 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Apr 9 08:15:07 2021 +0200

lok: Pass object ord num in the uno command

When multiple objects' glue points collide the ordnum
will be used to decide which glue point to connect to
for the connectors. Without that the default logic chooses
the lowest ordered object which is searched and found in the object list

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

diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
index d1fde32edda0..c1956d56af9f 100644
--- a/include/svx/svddrag.hxx
+++ b/include/svx/svddrag.hxx
@@ -79,6 +79,16 @@ class SVX_DLLPUBLIC SdrDragStat final
 
 sal_Int32 GetPrevPos() const { return mvPnts.size()-(mvPnts.size()>1 ? 2 : 
1); }
 
+// This is passed all the way through to ApplySpecialDrag of the Edge 
Object
+// For LOK, we cannot really specify which glue point to select by default
+// It selects the nearest glue points after DragEnd event.
+// When multiple objects are on top of each other or somehow their glue 
points
+// collide, the glue point is selected from the lowest order numbered 
object
+// We can pass the ord number information inside the draginfo and choose 
the correct shape
+struct {
+sal_Int32 objectOrdNum = -1;
+} mGlueOptions;
+
 public:
 SdrDragStat(){ Reset(); }
 ~SdrDragStat();
@@ -158,6 +168,8 @@ public:
 
 // Also considering 1stPointAsCenter
 void TakeCreateRect(tools::Rectangle& rRect) const;
+
+auto&GetGlueOptions() { return mGlueOptions; }
 };
 
 #endif // INCLUDED_SVX_SVDDRAG_HXX
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index e6399da73bda..56c2f21c66da 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -177,7 +177,7 @@ protected:
 XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const 
tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1,
 const Point& rPt2, long nAngle2, const tools::Rectangle& rBoundRect2, 
const tools::Rectangle& rBewareRect2,
 sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
-static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr);
+static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr, 
SdrDragStat* pDragStat = nullptr);
 static SdrEscapeDirection ImpCalcEscAngle(SdrObject const * pObj, const 
Point& aPt2);
 void ImpSetTailPoint(bool bTail1, const Point& rPt);
 void ImpUndirtyEdgeTrack();  // potential recalculation of the connection 
track
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index e4a6168ef425..5fda8cd58c13 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -243,7 +243,7 @@ public:
 const sal_Char* pDebugName) const;
 
 // Interactive Move Action programmaticaly
-bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint);
+bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, 
const sal_Int32 aObjectOrdNum = -1);
 };
 
 // First of all the app creates a SdrModel.
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 57afdd6da65a..9e28af35c0d1 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -206,16 +206,17 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 case SID_MOVE_SHAPE_HANDLE:
 {
 const SfxItemSet *pArgs = rReq.GetArgs ();
-if (pArgs && pArgs->Count () == 3)
+if (pArgs && pArgs->Count () >= 3)
 {
 const SfxUInt32Item* handleNumItem = 
rReq.GetArg(FN_PARAM_1);
 const SfxUInt32Item* newPosXTwips = 
rReq.GetArg(FN_PARAM_2);
 const SfxUInt32Item* newPosYTwips = 
rReq.GetArg(FN_PARAM_3);
+const SfxInt32Item* OrdNum = 
rReq.GetArg(FN_PARAM_4);
 
 const sal_uLong handleN

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

2021-04-08 Thread merttumer (via logerrit)
 include/svx/svdmrkv.hxx   |1 
 svx/source/svdraw/svdmrkv.cxx |   59 ++
 2 files changed, 60 insertions(+)

New commits:
commit 04c30909215141a1c405b0dcfb8032ee5fa345fe
Author: merttumer 
AuthorDate: Thu Mar 11 12:16:51 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Apr 9 07:10:06 2021 +0200

Get Glue Points in the selection callback

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

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index f080a57d1bbb..160f55fd8ad7 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -149,6 +149,7 @@ private:
 void UndirtyMrkPnt() const;
 
 void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* 
pOtherShell);
+bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree);
 
 protected:
 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index a4af90341b25..c2d4c09282e3 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -703,6 +703,52 @@ OUString lcl_getDragParameterString( const OUString& rCID )
 }
 } // anonymous namespace
 
+bool SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
+{
+bool result = false;
+if (OutputDevice* rOutDev = mpMarkedPV->GetView().GetFirstOutputDevice())
+{
+bool bConvertUnit = false;
+if (rOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+bConvertUnit = true;
+const SdrObjList* pOL = mpMarkedPV->GetObjList();
+const size_t nObjCount = pOL->GetObjCount();
+boost::property_tree::ptree elements;
+for (size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
+{
+const SdrObject* pObj = pOL->GetObj(nObjNum);
+const SdrGluePointList* pGPL = pObj->GetGluePointList();
+if (pGPL != nullptr && pGPL->GetCount())
+{
+boost::property_tree::ptree object;
+boost::property_tree::ptree points;
+for (size_t i = 0; i < pGPL->GetCount(); ++i)
+{
+boost::property_tree::ptree node;
+boost::property_tree::ptree point;
+const SdrGluePoint& rGP = (*pGPL)[i];
+// coordinates are relative to the OBJ snap rect
+Point rPoint = pObj->GetSnapRect().TopLeft();
+rPoint.Move(rGP.GetPos().getX(), rGP.GetPos().getY());
+if (bConvertUnit)
+rPoint = OutputDevice::LogicToLogic(rPoint, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+point.put("x", rPoint.getX());
+point.put("y", rPoint.getY());
+node.put("glueId", rGP.GetId());
+node.add_child("point", point);
+points.push_back(std::make_pair("", node));
+}
+object.put("id", reinterpret_cast(pObj));
+object.add_child("gluepoints", points);
+elements.push_back(std::make_pair("", object));
+result = true;
+}
+}
+rTree.add_child("shapes", elements);
+}
+return result;
+}
+
 void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, 
SfxViewShell* pOtherShell)
 {
 SfxViewShell* pViewShell = GetSfxViewShell();
@@ -755,13 +801,19 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 OString sSelectionText;
 OString sSelectionTextView;
 boost::property_tree::ptree aTableJsonTree;
+boost::property_tree::ptree aGluePointsTree;
 bool bTableSelection = false;
+size_t bConnectorSelection = false;
 
 if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
 {
 auto& rTableObject = 
dynamic_cast(*mpMarkedObj);
 bTableSelection = 
rTableObject.createTableEdgesJson(aTableJsonTree);
 }
+if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_EDGE)
+{
+bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree);
+}
 if (GetMarkedObjectCount())
 {
 SdrMark* pM = GetSdrMarkByIndex(0);
@@ -994,6 +1046,13 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 boost::property_tree::write_json(aStream, responseJSON, 
/*pretty=*/ false);
 handleArrayStr = ", \"handles\":";
 handleArrayStr += aStream.str().c_str();
+if (bConnectorSelection)
+{
+aStream.str("");
+boost::property_tree::write_json(aStream, aGluePo

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

2021-04-08 Thread merttumer (via logerrit)
 svx/source/svdraw/svdglue.cxx |5 +
 svx/source/svdraw/svdpntv.cxx |5 +
 2 files changed, 10 insertions(+)

New commits:
commit dedd720cf7188bb1e70f977099c5cee76e83541d
Author: merttumer 
AuthorDate: Thu Mar 11 10:33:04 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Apr 9 07:09:50 2021 +0200

lok: Don't invalidate GluePoints

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

diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 2f9d53028988..f9a6992a0ec7 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static const Size aGlueHalfSize(4,4);
 
@@ -253,6 +254,8 @@ void SdrGluePoint::Shear(const Point& rRef, double tn, bool 
bVShear, const SdrOb
 
 void SdrGluePoint::Invalidate(vcl::Window& rWin, const SdrObject* pObj) const
 {
+if (comphelper::LibreOfficeKit::isActive())
+return;
 bool bMapMode=rWin.IsMapModeEnabled();
 Point aPt(pObj!=nullptr ? GetAbsolutePos(*pObj) : GetPos());
 aPt=rWin.LogicToPixel(aPt);
@@ -329,6 +332,8 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
 
 void SdrGluePointList::Invalidate(vcl::Window& rWin, const SdrObject* pObj) 
const
 {
+if (comphelper::LibreOfficeKit::isActive())
+return;
 for (auto& xGP : aList)
 xGP->Invalidate(rWin,pObj);
 }
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index ec2a3b1917c5..f4fa2e4783bc 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -823,6 +823,11 @@ bool SdrPaintView::KeyInput(const KeyEvent& /*rKEvt*/, 
vcl::Window* /*pWin*/)
 
 void SdrPaintView::GlueInvalidate() const
 {
+// Do not invalidate GluePoints in Online
+// They are handled on front-end
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 const sal_uInt32 nWindowCount(PaintWindowCount());
 
 for(sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-08 Thread merttumer (via logerrit)
 svx/source/sdr/contact/objectcontactofpageview.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b3b231b7b44fb81efd2ee72cb08deec3997f6431
Author: merttumer 
AuthorDate: Thu Mar 11 09:52:00 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Apr 9 07:09:18 2021 +0200

Hide GluePoints in LOK

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

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 5838a1610e0f..d0756018d7b2 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -348,7 +348,8 @@ namespace sdr
 // Get info about the need to visualize GluePoints
 bool ObjectContactOfPageView::AreGluePointsVisible() const
 {
-return GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
+bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+return !bTiledRendering && 
GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
 }
 
 // check if text animation is allowed.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-29 Thread merttumer (via logerrit)
 svx/source/svdraw/svddrgv.cxx |   13 +
 svx/source/svdraw/svdmrkv.cxx |   25 -
 2 files changed, 33 insertions(+), 5 deletions(-)

New commits:
commit 5da18620f07e9cf389a37794029fdef80aa8b431
Author: merttumer 
AuthorDate: Thu Mar 25 12:44:17 2021 +0300
Commit: Szymon Kłos 
CommitDate: Mon Mar 29 14:06:35 2021 +0200

lok: Send gridOffset of the shape

In core, the gridOffset is calculated based on the LogicRect's TopLeft 
coordinate
In online, we have the SnapRect and we calculate it based on its TopLeft 
coordinate
SnapRect's TopLeft and LogicRect's TopLeft match when there is no rotation
but the rotation is not applied to the LogicRect. Therefore,
what we calculate in online does not match in case of the rotated shape.
Here we can send the correct gridOffset in the selection callback.
whether the shape is rotated or not, we will always have the correct 
gridOffset
Note that the gridOffset is always calculated from the first selected obj

Change-Id: Icc62a94879367f9b55ad05887945393452021777
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113078
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index db05163b1ec4..a4af90341b25 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -710,6 +710,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 tools::Rectangle aSelection(rRect);
 bool bIsChart = false;
 Point addLogicOffset = Point(0,0);
+bool convertMapMode = false;
 if (!rRect.IsEmpty())
 {
 sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -739,7 +740,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 if (OutputDevice* pOutputDevice = 
mpMarkedPV->GetView().GetFirstOutputDevice())
 {
 if (pOutputDevice->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM)
+{
 aSelection = OutputDevice::LogicToLogic(aSelection, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+convertMapMode = true;
+}
 }
 }
 
@@ -780,6 +784,26 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 aExtraInfo.append("\",\"type\":");
 aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
 
+// In core, the gridOffset is calculated based on the LogicRect's 
TopLeft coordinate
+// In online, we have the SnapRect and we calculate it based on 
its TopLeft coordinate
+// SnapRect's TopLeft and LogicRect's TopLeft match unless there 
is rotation
+// but the rotation is not applied to the LogicRect. Therefore,
+// what we calculate in online does not match with the core in 
case of the rotation.
+// Here we can send the correct gridOffset in the selection 
callback, this way
+// whether the shape is rotated or not, we will always have the 
correct gridOffset
+// Note that the gridOffset is calculated from the first selected 
obj
+basegfx::B2DVector aGridOffset(0.0, 0.0);
+if(getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+{
+Point p(aGridOffset.getX(), aGridOffset.getY());
+if (convertMapMode)
+p = OutputDevice::LogicToLogic(p, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+aExtraInfo.append(",\"gridOffsetX\":");
+aExtraInfo.append(OString::number(p.getX()));
+aExtraInfo.append(",\"gridOffsetY\":");
+aExtraInfo.append(OString::number(p.getY()));
+}
+
 if (bWriterGraphic)
 {
 aExtraInfo.append(", \"isWriterGraphic\": true");
@@ -916,7 +940,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, SfxView
 boost::property_tree::ptree poly;
 boost::property_tree::ptree custom;
 boost::property_tree::ptree nodes;
-const bool convertMapMode = 
mpMarkedPV->GetView().GetFirstOutputDevice()->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM;
 for (size_t i = 0; i < maHdlList.GetHdlCount(); i++)
 {
 SdrHdl *pHdl = maHdlList.GetHdl(i);
commit a4081f31d3b058c0016adb8b2cb83a64221cb3bc
Author: merttumer 
AuthorDate: Wed Mar 24 12:06:08 2021 +0300
Commit: Szymon Kłos 
CommitDate: Mon Mar 29 14:06:22 2021 +0200

LOK: Fix Moving drag handles calculates wrong offset

When dragging the shape handles for resizing,
the handle's grid offset must be the shapes grid
offset. In small numbered

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

2021-03-24 Thread merttumer (via logerrit)
 sc/source/ui/view/tabvwsh2.cxx   |2 ++
 sd/source/ui/view/drviewse.cxx   |4 
 sw/source/uibase/uiview/viewdraw.cxx |3 +++
 3 files changed, 9 insertions(+)

New commits:
commit b08066fe16a74b779be63c6a7368e8f6225e4062
Author: merttumer 
AuthorDate: Fri Mar 19 12:31:42 2021 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Mar 24 11:01:55 2021 +0100

Fix Line and Connectors enable interactive drawing

We add them directly for LOK case and have no functionality
for interactive drawing.

Noticed that in Writer we didnt even add them directly
I also implemented that as well.

Change-Id: If90bfc8d2cdf84f200bc7963ae4126ef789524ff
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112703
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index d2efc23d5559..dc48b24dc52c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -230,6 +230,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_ELLIPSE:
 case SID_DRAW_MEASURELINE:
 pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
pDoc, aNewReq));
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
 break;
 
 case SID_DRAW_CAPTION:
@@ -330,6 +331,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 }
 else
 {
+GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, 
SfxCallMode::ASYNCHRON);
 ScViewData& rViewData = GetViewData();
 aInsertPos = rViewData.getLOKVisibleArea().Center();
 if (comphelper::LibreOfficeKit::isCompatFlagSet(
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index e330d0416ce8..6aefeb33e77f 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -608,6 +608,10 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 if(!(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || 
bCreateDirectly)))
 return;
 
+// disable interactive drawing for LOK
+if (bCreateDirectly)
+GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, 
SfxCallMode::ASYNCHRON);
+
 // get SdOptions
 SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
 sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
diff --git a/sw/source/uibase/uiview/viewdraw.cxx 
b/sw/source/uibase/uiview/viewdraw.cxx
index d5c2ff4284c7..507547b0 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -266,6 +266,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_CAPTION:
 case SID_DRAW_CAPTION_VERTICAL:
 pFuncPtr.reset( new ConstRectangle(m_pWrtShell.get(), m_pEditWin, 
this) );
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
 m_nDrawSfxId = nSlotId;
 m_sDrawCustom.clear();
 break;
@@ -349,6 +350,8 @@ void SwView::ExecDraw(SfxRequest& rReq)
 NoRotate();
 if(rReq.GetModifier() == KEY_MOD1 || bCreateDirectly)
 {
+if (bCreateDirectly)
+GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, 
SfxCallMode::ASYNCHRON);
 if(SID_OBJECT_SELECT == m_nDrawSfxId )
 {
 m_pWrtShell->GotoObj(true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-18 Thread merttumer (via logerrit)
 svx/source/sdr/contact/viewobjectcontact.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b4296e1b462ddf626fe2ec2f9f5935993759ff86
Author: merttumer 
AuthorDate: Wed Mar 17 09:01:45 2021 +0300
Commit: Jan Holesovsky 
CommitDate: Thu Mar 18 10:06:10 2021 +0100

LOK: Fix wrong gridOffset when shape is moved on calc

Change-Id: I37501128068943cee8f67a5d91a35ec1a76fe550
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112599
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-by: Jan Holesovsky 

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 882b911a8fab..89e099da71c3 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -234,8 +234,11 @@ void ViewObjectContact::ActionChanged()
 // invalidate current valid range
 GetObjectContact().InvalidatePartOfView(maObjectRange);
 
-// reset ObjectRange, it needs to be recalculated
-maObjectRange.reset();
+// reset gridOffset, it needs to be recalculated
+if (GetObjectContact().supportsGridOffsets())
+resetGridOffset();
+else
+maObjectRange.reset();
 }
 
 // register at OC for lazy invalidate
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-11-14 Thread merttumer (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 92f5d7407341b4eeda4ccf5c9c2c83661313e3b3
Author: merttumer 
AuthorDate: Mon Jun 3 14:20:50 2019 +0300
Commit: Jan Holesovsky 
CommitDate: Thu Nov 14 15:02:51 2019 +0100

Make pressing Ctrl+F twice behave like Desktop

Currently pressing Ctrl+F twice opens up browsers
search bar.
Signed-off-by: merttumer 

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

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 4abc14d62..faa3e0f6f 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1223,13 +1223,18 @@ function onSearch() {
 }
 
 function onSearchKeyDown(e) {
+   var entry = L.DomUtil.get('search-input');
if ((e.keyCode === 71 && e.ctrlKey) || e.keyCode === 114 || e.keyCode 
=== 13) {
if (e.shiftKey) {
-   map.search(L.DomUtil.get('search-input').value, true);
+   map.search(entry.value, true);
} else {
-   map.search(L.DomUtil.get('search-input').value);
+   map.search(entry.value);
}
e.preventDefault();
+   } else if (e.ctrlKey && e.keyCode === 70) {
+   entry.focus();
+   entry.select();
+   e.originalEvent.preventDefault();
} else if (e.keyCode === 27) {
_cancelSearch();
}
___
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/js

2019-10-09 Thread merttumer (via logerrit)
 loleaflet/js/toolbar.js |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit dc0f08ec3a5942d6cb664046f0cf4cd8c5a10c1f
Author: merttumer 
AuthorDate: Mon Aug 26 14:12:08 2019 +0300
Commit: Aron Budea 
CommitDate: Wed Oct 9 14:28:27 2019 +0200

tdf#126205: Fix file format conversion on rename input

Change-Id: I342ed309dfc116389f91886f5e1fd7b6c49178ed
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80125
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 620091e9c..f243d4368 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1339,12 +1339,20 @@ function documentNameConfirm() {
var value = $('#document-name-input').val();
if (value !== null && value != '' && value != map['wopi'].BaseFileName) 
{
if (map['wopi'].UserCanRename && map['wopi'].SupportsRename) {
-   // file name must be without the extension
-   if (value.lastIndexOf('.') > 0)
-   value = value.substr(0, value.lastIndexOf('.'));
-   
-   map.sendUnoCommand('.uno:Save');
-   map._RenameFile = value;
+   if (value.lastIndexOf('.') > 0) {
+   var fname = map['wopi'].BaseFileName;
+   var ext =  
fname.substr(fname.lastIndexOf('.')+1, fname.length);
+   // check format conversion
+   if (ext != 
value.substr(value.lastIndexOf('.')+1, value.length)) {
+   map.saveAs(value);
+   } else {
+   // same extension, just rename the file
+   // file name must be without the 
extension for rename
+   value = value.substr(0, 
value.lastIndexOf('.'));
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
+   }
+   }
} else {
// saveAs for rename
map.saveAs(value);
___
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-0' - loleaflet/js

2019-10-09 Thread merttumer (via logerrit)
 loleaflet/js/toolbar.js |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 8851fd58bcaffa080501f157b348d6748a1ff005
Author: merttumer 
AuthorDate: Mon Aug 26 14:12:08 2019 +0300
Commit: Aron Budea 
CommitDate: Wed Oct 9 14:28:05 2019 +0200

tdf#126205: Fix file format conversion on rename input

Change-Id: I342ed309dfc116389f91886f5e1fd7b6c49178ed
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80097
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index e990b5a80..b5dc4cfb1 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1332,12 +1332,20 @@ function documentNameConfirm() {
var value = $('#document-name-input').val();
if (value !== null && value != '' && value != map['wopi'].BaseFileName) 
{
if (map['wopi'].UserCanRename && map['wopi'].SupportsRename) {
-   // file name must be without the extension
-   if (value.lastIndexOf('.') > 0)
-   value = value.substr(0, value.lastIndexOf('.'));
-   
-   map.sendUnoCommand('.uno:Save');
-   map._RenameFile = value;
+   if (value.lastIndexOf('.') > 0) {
+   var fname = map['wopi'].BaseFileName;
+   var ext =  
fname.substr(fname.lastIndexOf('.')+1, fname.length);
+   // check format conversion
+   if (ext != 
value.substr(value.lastIndexOf('.')+1, value.length)) {
+   map.saveAs(value);
+   } else {
+   // same extension, just rename the file
+   // file name must be without the 
extension for rename
+   value = value.substr(0, 
value.lastIndexOf('.'));
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
+   }
+   }
} else {
// saveAs for rename
map.saveAs(value);
___
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-0' - loleaflet/js loleaflet/src

2019-10-09 Thread merttumer (via logerrit)
 loleaflet/js/toolbar.js  |   10 +-
 loleaflet/src/map/Map.js |3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 11607909fe37af81775d54f20561dfc49be25b2c
Author: merttumer 
AuthorDate: Mon Jun 10 11:36:15 2019 +0300
Commit: Aron Budea 
CommitDate: Wed Oct 9 14:27:47 2019 +0200

Save document before rename for keeping changes

Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80096
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 3cc701119..e990b5a80 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1335,7 +1335,9 @@ function documentNameConfirm() {
// file name must be without the extension
if (value.lastIndexOf('.') > 0)
value = value.substr(0, value.lastIndexOf('.'));
-   map.renameFile(value);
+   
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
} else {
// saveAs for rename
map.saveAs(value);
@@ -2122,6 +2124,12 @@ function onCommandResult(e) {
if (e.success) {
// Saved a new version; the document is modified.
map._everModified = true;
+   
+   // document is saved for rename
+   if (map._RenameFile) {
+   map.renameFile(map._RenameFile);
+   map._RenameFile = '';
+   }
}
var postMessageObj = {
success: e.success
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 2c802d5e9..0e7642925 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -204,6 +204,9 @@ L.Map = L.Evented.extend({
// This becomes true if document was ever modified by the user
this._everModified = false;
 
+   // This becomes new file name if document is renamed which used 
later on uno:Save result
+   this._RenameFile = '';
+
// Document is completely loaded or not
this._docLoaded = false;
 
___
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/js loleaflet/src

2019-10-09 Thread merttumer (via logerrit)
 loleaflet/js/toolbar.js  |   10 +-
 loleaflet/src/map/Map.js |5 -
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 966840daa90ba5f80e9bb8cee840cefd0e5dbf23
Author: merttumer 
AuthorDate: Mon Jun 10 11:36:15 2019 +0300
Commit: Aron Budea 
CommitDate: Wed Oct 9 14:28:18 2019 +0200

Save document before rename for keeping changes

Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80124
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 2dd653d92..620091e9c 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1342,7 +1342,9 @@ function documentNameConfirm() {
// file name must be without the extension
if (value.lastIndexOf('.') > 0)
value = value.substr(0, value.lastIndexOf('.'));
-   map.renameFile(value);
+   
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
} else {
// saveAs for rename
map.saveAs(value);
@@ -2130,6 +2132,12 @@ function onCommandResult(e) {
if (e.success) {
// Saved a new version; the document is modified.
map._everModified = true;
+   
+   // document is saved for rename
+   if (map._RenameFile) {
+   map.renameFile(map._RenameFile);
+   map._RenameFile = '';
+   }
}
var postMessageObj = {
success: e.success
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 774dab848..8720f3c1e 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -218,7 +218,10 @@ L.Map = L.Evented.extend({
// This becomes true if document was ever modified by the user
this._everModified = false;
 
-   // Document is completely loaded or not.
+   // This becomes new file name if document is renamed which used 
later on uno:Save result
+   this._RenameFile = '';
+
+   // Document is completely loaded or not
this._docLoaded = false;
 
// Unlike _docLoaded, this is flagged only once,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-04 Thread merttumer (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit efdc5dbc0894edbb3c3bfa1dc61dedaf0ee26a8e
Author: merttumer 
AuthorDate: Mon Aug 26 14:12:08 2019 +0300
Commit: Aron Budea 
CommitDate: Fri Oct 4 22:23:00 2019 +0200

tdf#126205: Fix file format conversion on rename input

Change-Id: I342ed309dfc116389f91886f5e1fd7b6c49178ed
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80137
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 3c96c905a..3e6a970cb 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1190,12 +1190,20 @@ function documentNameConfirm() {
var value = $('#document-name-input').val();
if (value !== null && value != '' && value != map['wopi'].BaseFileName) 
{
if (map['wopi'].UserCanRename && map['wopi'].SupportsRename) {
-   // file name must be without the extension
-   if (value.lastIndexOf('.') > 0)
-   value = value.substr(0, value.lastIndexOf('.'));
-   
-   map.sendUnoCommand('.uno:Save');
-   map._RenameFile = value;
+   if (value.lastIndexOf('.') > 0) {
+   var fname = map['wopi'].BaseFileName;
+   var ext = 
fname.substr(fname.lastIndexOf('.')+1, fname.length);
+   // check format conversion
+   if (ext != 
value.substr(value.lastIndexOf('.')+1, value.length)) {
+   map.saveAs(value);
+   } else {
+   // same extension, just rename the file
+   // file name must be without the 
extension for rename
+   value = value.substr(0, 
value.lastIndexOf('.'));
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
+   }
+   }
} else {
// saveAs for rename
map.saveAs(value);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-04 Thread merttumer (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |   10 +-
 loleaflet/src/map/Map.js |5 -
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 5570787c708e08388314608631498324a49d1d38
Author: merttumer 
AuthorDate: Mon Jun 10 11:36:15 2019 +0300
Commit: Michael Meeks 
CommitDate: Fri Oct 4 15:06:57 2019 +0200

Save document before rename for keeping changes

Change-Id: Iadd5a93f902f916e1db14c0cafe39b125b531f02
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/80136
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index c38f57045..3c96c905a 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1193,7 +1193,9 @@ function documentNameConfirm() {
// file name must be without the extension
if (value.lastIndexOf('.') > 0)
value = value.substr(0, value.lastIndexOf('.'));
-   map.renameFile(value);
+   
+   map.sendUnoCommand('.uno:Save');
+   map._RenameFile = value;
} else {
// saveAs for rename
map.saveAs(value);
@@ -1958,6 +1960,12 @@ function onCommandResult(e) {
if (e.success) {
// Saved a new version; the document is modified.
map._everModified = true;
+
+   // document is saved for rename
+   if (map._RenameFile) {
+   map.renameFile(map._RenameFile);
+   map._RenameFile = '';
+   }
}
var postMessageObj = {
success: e.success
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 8048889d3..366c62453 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -231,7 +231,10 @@ L.Map = L.Evented.extend({
// This becomes true if document was ever modified by the user
this._everModified = false;
 
-   // Document is completely loaded or not.
+   // This becomes new file name if document is renamed which used 
later on uno:Save result
+   this._RenameFile = '';
+
+   // Document is completely loaded or not
this._docLoaded = false;
 
// Unlike _docLoaded, this is flagged only once,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-20 Thread merttumer (via logerrit)
 loleaflet/src/control/Control.PartsPreview.js |   51 +-
 1 file changed, 50 insertions(+), 1 deletion(-)

New commits:
commit 77a0e0bca34dd65204f0cc81c2b3613bf3b22d6e
Author: merttumer 
AuthorDate: Fri Mar 1 18:11:59 2019 +0300
Commit: Andras Timar 
CommitDate: Fri Sep 20 23:53:49 2019 +0200

Ability to switch slides by arrow up/down keys in edit mode

Change-Id: Ic465636df8a1960364074149a41ea7d0209dbdab
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/68585
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit f3ea0a6ffe03425c557297c53768cb927727b4af)
Reviewed-on: https://gerrit.libreoffice.org/79313
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.PartsPreview.js 
b/loleaflet/src/control/Control.PartsPreview.js
index b46d356c6..92bbd2673 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -8,6 +8,7 @@ L.Control.PartsPreview = L.Control.extend({
options: {
autoUpdate: true
},
+   partsFocused: false,
 
onAdd: function (map) {
this._previewInitialized = false;
@@ -61,6 +62,24 @@ 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) {
+   case 38:
+   this._setPart('prev');
+   break;
+   case 40:
+   this._setPart('next');
+   break;
+   }
+   }
+   }, this);
+
this._scrollContainer = $('#slide-sorter 
.mCSB_container').get(0);
 
// Add a special frame just as a drop-site for 
reordering.
@@ -110,7 +129,10 @@ L.Control.PartsPreview = L.Control.extend({
.on(img, 'click', L.DomEvent.stopPropagation)
.on(img, 'click', L.DomEvent.stop)
.on(img, 'click', this._setPart, this)
-   .on(img, 'click', this._map.focus, this._map);
+   .on(img, 'click', this._map.focus, this._map)
+   .on(img, 'click', function() {
+   this.partsFocused = true;
+   }, this);
 
var topBound = this._previewContTop;
var previewFrameTop = 0;
@@ -150,6 +172,33 @@ L.Control.PartsPreview = L.Control.extend({
},
 
_setPart: function (e) {
+   //helper function to check if the view is in the scrollview 
visible area
+   function isVisible(el) {
+   var elemRect = el.getBoundingClientRect();
+   var elemTop = elemRect.top;
+   var elemBottom = elemRect.bottom;
+   var isVisible = (elemTop >= 0) && (elemBottom <= 
window.innerHeight);
+   return isVisible;
+   }
+   if (e === 'prev' || e === 'next') {
+   this._map.setPart(e);
+   var node = $('#slide-sorter .mCSB_container 
.preview-frame')[this._map.getCurrentPartNumber()];
+   if (!isVisible(node)) {
+   if (e === 'prev') {
+   setTimeout(function () {
+   
$('#slide-sorter').mCustomScrollbar('scrollTo', node);
+   }, 50);
+   } else {
+   var nodeHeight = $(node).height();
+   var sliderHeight= 
$('#slide-sorter').height();
+   var nodePos = $(node).position().top;
+   setTimeout(function () {
+   
$('#slide-sorter').mCustomScrollbar('scrollTo', 
nodePos-(sliderHeight-nodeHeight-nodeHeight/2));
+   }, 50);
+   }
+   }
+   return;
+   }
  

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - comphelper/source desktop/source include/comphelper sc/source sc/uiconfig sc/UIConfig_scalc.mk solenv/sanitizers

2019-09-03 Thread merttumer (via logerrit)
 comphelper/source/misc/lok.cxx|   12 
 desktop/source/lib/init.cxx   |   12 
 include/comphelper/lok.hxx|6 
 sc/UIConfig_scalc.mk  |2 
 sc/source/ui/condformat/condformatdlg.cxx |3 
 sc/source/ui/condformat/condformatdlgentry.cxx|3 
 sc/uiconfig/scalc/ui/conditionalentrymobile.ui|  455 ++
 sc/uiconfig/scalc/ui/conditionalformatdialogmobile.ui |  300 +++
 solenv/sanitizers/ui/modules/scalc.suppr  |   20 
 9 files changed, 811 insertions(+), 2 deletions(-)

New commits:
commit 6d2e25ce53b561f0b5a250f0a1b7e96811b00e17
Author: merttumer 
AuthorDate: Tue Jul 30 15:30:06 2019 +0300
Commit: Andras Timar 
CommitDate: Tue Sep 3 21:42:42 2019 +0200

Added mobile friendly ui design for ConditionalFormattingDialog

[ Miklos: added solenv/ bits to silence the same warnings as the
non-mobile layout. ]

(cherry picked from commit d2b4b608696e7a6ba7ed15c97972aa8ed3707bb2)

Conflicts:
sc/source/ui/condformat/condformatdlg.cxx
sc/source/ui/condformat/condformatdlgentry.cxx
solenv/sanitizers/ui/modules/scalc.suppr

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

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 8b36d066b932..e91e9c35959b 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -98,7 +98,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/colwidthdialog \
sc/uiconfig/scalc/ui/condformatmanager \
sc/uiconfig/scalc/ui/conditionalformatdialog \
+   sc/uiconfig/scalc/ui/conditionalformatdialogmobile \
sc/uiconfig/scalc/ui/conditionalentry \
+   sc/uiconfig/scalc/ui/conditionalentrymobile \
sc/uiconfig/scalc/ui/conditionaliconset \
sc/uiconfig/scalc/ui/conflictsdialog \
sc/uiconfig/scalc/ui/consolidatedialog \
diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 79e0e3f233d6..91ea772d8065 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 
 #include 
@@ -515,7 +516,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, 
SfxChildWindow* pCW,
 vcl::Window* pParent, ScViewData* pViewData,
 const ScCondFormatDlgItem* pItem)
 : ScAnyRefDlg(pB, pCW, pParent, "ConditionalFormatDialog",
-"modules/scalc/ui/conditionalformatdialog.ui")
+
(comphelper::LibreOfficeKit::isMobile()?OUString("modules/scalc/ui/conditionalformatdialogmobile.ui"):OUString("modules/scalc/ui/conditionalformatdialog.ui")))
 , mpViewData(pViewData)
 , mpLastEdit(nullptr)
 , mpDlgItem(static_cast(pItem->Clone()))
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 2483ebe29d7f..4c6682253fa0 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -48,7 +49,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, 
ScDocument* pDoc, const S
 , mpDoc(pDoc)
 , maPos(rPos)
 {
-m_pUIBuilder.reset(new VclBuilder(this, getUIRootDir(), 
"modules/scalc/ui/conditionalentry.ui"));
+m_pUIBuilder.reset(new VclBuilder(this, getUIRootDir(), 
(comphelper::LibreOfficeKit::isMobile()?OUString("modules/scalc/ui/conditionalentrymobile.ui"):OUString("modules/scalc/ui/conditionalentry.ui";
 
 get(maGrid, "grid");
 get(maFtCondNr, "number");
diff --git a/sc/uiconfig/scalc/ui/conditionalentrymobile.ui 
b/sc/uiconfig/scalc/ui/conditionalentrymobile.ui
new file mode 100644
index ..a4f1b39185bd
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/conditionalentrymobile.ui
@@ -0,0 +1,455 @@
+
+
+
+  
+  
+  
+True
+False
+True
+6
+vertical
+7
+
+  
+True
+False
+start
+2
+
+  
+True
+False
+  
+  
+0
+0
+  
+
+
+  
+True
+False
+  
+  
+1
+0
+  
+
+  
+  
+0
+0
+  
+
+
+  
+True
+False
+True
+immediate
+12
+True
+
+  
+True
+False
+False
+
+  All Cells
+  Cell value is
+  Formula is
+  Date is
+
+  
+  

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

2019-08-29 Thread merttumer (via logerrit)
 sc/UIConfig_scalc.mk  |2 
 sc/source/ui/condformat/condformatdlg.cxx |3 
 sc/source/ui/condformat/condformatdlgentry.cxx|3 
 sc/uiconfig/scalc/ui/conditionalentrymobile.ui|  455 ++
 sc/uiconfig/scalc/ui/conditionalformatdialogmobile.ui |  300 +++
 solenv/sanitizers/ui/modules/scalc.suppr  |   12 
 6 files changed, 773 insertions(+), 2 deletions(-)

New commits:
commit d2b4b608696e7a6ba7ed15c97972aa8ed3707bb2
Author: merttumer 
AuthorDate: Tue Jul 30 15:30:06 2019 +0300
Commit: Miklos Vajna 
CommitDate: Thu Aug 29 15:01:23 2019 +0200

Added mobile friendly ui design for ConditionalFormattingDialog

[ Miklos: added solenv/ bits to silence the same warnings as the
non-mobile layout. ]

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

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index f8316293a44c..29131d219c60 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -98,7 +98,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/colwidthdialog \
sc/uiconfig/scalc/ui/condformatmanager \
sc/uiconfig/scalc/ui/conditionalformatdialog \
+   sc/uiconfig/scalc/ui/conditionalformatdialogmobile \
sc/uiconfig/scalc/ui/conditionalentry \
+   sc/uiconfig/scalc/ui/conditionalentrymobile \
sc/uiconfig/scalc/ui/conditionaliconset \
sc/uiconfig/scalc/ui/conflictsdialog \
sc/uiconfig/scalc/ui/consolidatedialog \
diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 018907f5c500..0fc144bf897b 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 
 #include 
@@ -410,7 +411,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, 
SfxChildWindow* pCW,
 weld::Window* pParent, ScViewData* pViewData,
 const ScCondFormatDlgItem* pItem)
 : ScAnyRefDlgController(pB, pCW, pParent,
-"modules/scalc/ui/conditionalformatdialog.ui",
+
(comphelper::LibreOfficeKit::isMobile()?OUString("modules/scalc/ui/conditionalformatdialogmobile.ui"):OUString("modules/scalc/ui/conditionalformatdialog.ui")),
 "ConditionalFormatDialog")
 , mpViewData(pViewData)
 , mpDlgItem(static_cast(pItem->Clone()))
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index a43a82846d8b..2e4039004644 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -41,7 +42,7 @@
 
 ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, 
const ScAddress& rPos)
 : mpParent(pParent)
-, mxBuilder(Application::CreateBuilder(pParent->GetContainer(), 
"modules/scalc/ui/conditionalentry.ui"))
+, mxBuilder(Application::CreateBuilder(pParent->GetContainer(), 
(comphelper::LibreOfficeKit::isMobile()?OUString("modules/scalc/ui/conditionalentrymobile.ui"):OUString("modules/scalc/ui/conditionalentry.ui"
 , mxBorder(mxBuilder->weld_widget("border"))
 , mxGrid(mxBuilder->weld_container("grid"))
 , mxFtCondNr(mxBuilder->weld_label("number"))
diff --git a/sc/uiconfig/scalc/ui/conditionalentrymobile.ui 
b/sc/uiconfig/scalc/ui/conditionalentrymobile.ui
new file mode 100644
index ..a4f1b39185bd
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/conditionalentrymobile.ui
@@ -0,0 +1,455 @@
+
+
+
+  
+  
+  
+True
+False
+True
+6
+vertical
+7
+
+  
+True
+False
+start
+2
+
+  
+True
+False
+  
+  
+0
+0
+  
+
+
+  
+True
+False
+  
+  
+1
+0
+  
+
+  
+  
+0
+0
+  
+
+
+  
+True
+False
+True
+immediate
+12
+True
+
+  
+True
+False
+False
+
+  All Cells
+  Cell value is
+  Formula is
+  Date is
+
+  
+  
+0
+0
+2
+  
+
+
+  
+False
+
+  New Style...
+
+  
+  
+0
+6
+  
+
+
+  
+More Options...
+True
+True
+ 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - wsd/FileServer.cpp wsd/Storage.cpp

2019-08-28 Thread merttumer (via logerrit)
 wsd/FileServer.cpp |   18 +-
 wsd/Storage.cpp|   23 ++-
 2 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit 3ab7e500d83ed814a2d1ba1043df828b1b6c865f
Author: merttumer 
AuthorDate: Wed Aug 21 16:23:40 2019 +0300
Commit: Andras Timar 
CommitDate: Wed Aug 28 14:14:59 2019 +0200

Added reuse cookie option for wopi client

Signed-off-by: merttumer 
(cherry picked from commit 9b8aa96a18ce2eda11b5e51b2df5bb0d8cd822d2)

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

diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 447a23a90..6ce5c7b67 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -569,7 +569,8 @@ constexpr char BRANDING_UNSUPPORTED[] = 
"branding-unsupported";
 
 void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, 
Poco::MemoryInputStream& message, const std::shared_ptr& socket)
 {
-const auto host = ((LOOLWSD::isSSLEnabled() || 
LOOLWSD::isSSLTermination()) ? "wss://" : "ws://") + 
(LOOLWSD::ServerName.empty() ? request.getHost() : LOOLWSD::ServerName);
+const auto host = ((LOOLWSD::isSSLEnabled() || 
LOOLWSD::isSSLTermination()) ? "wss://" : "ws://")
++ (LOOLWSD::ServerName.empty() ? request.getHost() : 
LOOLWSD::ServerName);
 const Poco::URI::QueryParameters params = 
Poco::URI(request.getURI()).getQueryParameters();
 
 // Is this a file we read at startup - if not; its not for serving.
@@ -670,6 +671,20 @@ void FileServerRequestHandler::preprocessFile(const 
HTTPRequest& request, Poco::
 << "X-XSS-Protection: 1; mode=block\r\n"
 << "Referrer-Policy: no-referrer\r\n";
 
+const std::string reuseCookie = form.get("reuse_cookies_for_storage", 
"");
+if (reuseCookie == "true")
+{
+NameValueCollection cookies;
+request.getCookies(cookies);
+std::ostringstream cookieTokens;
+
+for (auto it = cookies.begin(); it != cookies.end(); it++)
+{
+cookieTokens << (*it).first << "=" << (*it).second << 
(std::next(it) != cookies.end() ? ":" : "");
+}
+setenv("LOOL_REUSE_STORAGE_COOKIE", cookieTokens.str().c_str(), 1);
+}
+
 // Document signing: if endpoint URL is configured, whitelist that for
 // iframe purposes.
 std::ostringstream cspOss;
@@ -720,6 +735,7 @@ void FileServerRequestHandler::preprocessFile(const 
HTTPRequest& request, Poco::
 LOG_TRC("Denied all frame ancestors");
 cspOss << "img-src 'self' data: none;";
 }
+
 cspOss << "\r\n";
 // Append CSP to response headers too
 oss << cspOss.str();
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 387a03b50..83466fde7 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -397,6 +397,25 @@ void addStorageDebugCookie(Poco::Net::HTTPRequest& request)
 #endif
 }
 
+void addStorageReuseCookie(Poco::Net::HTTPRequest& request)
+{
+if (std::getenv("LOOL_REUSE_STORAGE_COOKIE"))
+{
+Poco::Net::NameValueCollection nvcCookies;
+std::vector cookies = 
LOOLProtocol::tokenize(std::string(std::getenv("LOOL_REUSE_STORAGE_COOKIE")), 
':');
+for (auto cookie : cookies)
+{
+std::vector cookieTokens = 
LOOLProtocol::tokenize(cookie, '=');
+if (cookieTokens.size() == 2)
+{
+nvcCookies.add(cookieTokens[0], cookieTokens[1]);
+LOG_TRC("Added storage reuse cookie [" << cookieTokens[0] << 
"=" << cookieTokens[1] << "].");
+}
+}
+request.setCookies(nvcCookies);
+}
+}
+
 Poco::Timestamp iso8601ToTimestamp(const std::string& iso8601Time, const 
std::string& name)
 {
 Poco::Timestamp timestamp = Poco::Timestamp::fromEpochTime(0);
@@ -438,7 +457,7 @@ std::unique_ptr 
WopiStorage::getWOPIFileInfo(const Au
 request.set("User-Agent", WOPI_AGENT_STRING);
 auth.authorizeRequest(request);
 addStorageDebugCookie(request);
-
+addStorageReuseCookie(request);
 const auto startTime = std::chrono::steady_clock::now();
 
 std::unique_ptr 
psession(getHTTPClientSession(uriObject));
@@ -645,6 +664,7 @@ std::string WopiStorage::loadStorageFileToLocal(const 
Authorization& auth)
 request.set("User-Agent", WOPI_AGENT_STRING);
 auth.authorizeRequest(request);
 addStorageDebugCookie(request);
+addStorageReuseCookie(request);
 psession->sendRequest(request);
 
 Poco::Net::HTTPResponse response;
@@ -785,6 +805,7 @@ StorageBase::SaveResult 
WopiStorage::saveLocalFileToStorage(const Authorization&
 request.setContentType("application/octet-stream");
 request.setContentLength(size);
 addStorageDebugCookie(request);
+addStorageReuseCookie(request);
 std::ostream& os = pses

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

2019-08-19 Thread merttumer (via logerrit)
 filter/source/pdf/pdfexport.cxx |   57 ++--
 1 file changed, 43 insertions(+), 14 deletions(-)

New commits:
commit 4be6ce6a4888118a10d75cb756b712adb77973a2
Author: merttumer 
AuthorDate: Fri Mar 15 20:11:15 2019 +0300
Commit: Noel Grandin 
CommitDate: Mon Aug 19 09:36:13 2019 +0200

Make pdf export watermarks look like watermarks on online

Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/69317
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/76289
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e6bbfd641c6c65ebdebae92f2382689d3ea4a089)

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

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index eed998112f4d..12dea0a241ca 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1148,7 +1148,25 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 
 void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& 
rPageSize )
 {
-vcl::Font aFont( OUString( "Liberation Sans" ), Size( 0, 40 ) );
+OUString watermark = msTiledWatermark;
+int watermarkLength = watermark.getLength();
+// Maximum number of characters in one line.
+// it is set to 21 to make it look like tiled watermaks as online in 
secure view
+const int lineLength = 21;
+int lnIndex = lineLength;
+int lnCount = watermarkLength / lineLength;
+
+while(lnCount)
+{
+OUString tempstr = watermark;
+watermark = watermark.copy(0, lnIndex);
+watermark += "\n";
+watermark += tempstr.copy(lnIndex);
+lnIndex += lineLength;
+lnCount--;
+}
+
+vcl::Font aFont( "Liberation Sans", Size( 0, 40 ) );
 aFont.SetItalic( ITALIC_NONE );
 aFont.SetWidthType( WIDTH_NORMAL );
 aFont.SetWeight( WEIGHT_NORMAL );
@@ -1161,8 +1179,14 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 pDev->SetFont(aFont);
 pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
 int w = 0;
-long nTextWidth = (rPageSize.Width()-60) / 4;
-while((w = pDev->GetTextWidth(msTiledWatermark)) > nTextWidth)
+int watermarkcount = ((rPageSize.Width()) / 200)+1;
+long nTextWidth = rPageSize.Width() / (watermarkcount*1.5);
+OUString oneLineText = watermark;
+
+if(watermark.getLength() > lineLength)
+oneLineText = watermark.copy(0, lineLength);
+
+while((w = pDev->GetTextWidth(oneLineText)) > nTextWidth)
 {
 if(w==0)
 break;
@@ -1171,27 +1195,32 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 aFont.SetFontHeight(nNewHeight);
 pDev->SetFont( aFont );
 }
+
+// maximum number of watermark count for the width
+if(watermarkcount > 8)
+watermarkcount = 8;
+
 pDev->Pop();
 
 rWriter.Push();
 rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
 rWriter.SetFont(aFont);
 rWriter.SetTextColor( Color(19,20,22) );
-Point aTextPoint;
-tools::Rectangle aTextRect;
-aTextPoint = Point(70,80);
+// center watermarks horizontally
+Point aTextPoint( (rPageSize.Width()/2) - 
(((nTextWidth*watermarkcount)+(watermarkcount-1)*(nTextWidth/2))/2),
+  pDev->GetTextHeight());
 
-for( int i = 0; i < 3; i ++)
+for( int i = 0; i < watermarkcount; i ++)
 {
-while(aTextPoint.getY()+pDev->GetTextHeight() <= rPageSize.Height()-40)
+while(aTextPoint.getY()+pDev->GetTextHeight()*2 <= rPageSize.Height())
 {
-aTextRect = tools::Rectangle(Point(aTextPoint.getX(), 
aTextPoint.getY()-pDev->GetTextHeight()), 
Size(pDev->GetTextWidth(msTiledWatermark),pDev->GetTextHeight()));
+tools::Rectangle aTextRect(aTextPoint, 
Size(nTextWidth,pDev->GetTextHeight()*2));
 
 pDev->Push();
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(19,20,22) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter);
 rWriter.EndTransparencyGroup( aTextRect, 50 );
 pDev->Pop();
 
@@ -1199,14 +1228,14 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(236,235,233) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|

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

2019-07-25 Thread merttumer (via logerrit)
 filter/source/pdf/pdfexport.cxx |   55 ++--
 1 file changed, 42 insertions(+), 13 deletions(-)

New commits:
commit e6bbfd641c6c65ebdebae92f2382689d3ea4a089
Author: merttumer 
AuthorDate: Fri Mar 15 20:11:15 2019 +0300
Commit: Noel Grandin 
CommitDate: Thu Jul 25 14:35:33 2019 +0200

Make pdf export watermarks look like watermarks on online

Change-Id: Ib5af8c61dd9a539c63594a91b8ec17ff07327feb
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/69317
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/76289
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index bae05fe1c394..051f73fc66b8 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1159,6 +1159,24 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 
 void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& 
rPageSize )
 {
+OUString watermark = msTiledWatermark;
+int watermarkLength = watermark.getLength();
+// Maximum number of characters in one line.
+// it is set to 21 to make it look like tiled watermaks as online in 
secure view
+const int lineLength = 21;
+int lnIndex = lineLength;
+int lnCount = watermarkLength / lineLength;
+
+while(lnCount)
+{
+OUString tempstr = watermark;
+watermark = watermark.copy(0, lnIndex);
+watermark += "\n";
+watermark += tempstr.copy(lnIndex);
+lnIndex += lineLength;
+lnCount--;
+}
+
 vcl::Font aFont( "Liberation Sans", Size( 0, 40 ) );
 aFont.SetItalic( ITALIC_NONE );
 aFont.SetWidthType( WIDTH_NORMAL );
@@ -1172,8 +1190,14 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 pDev->SetFont(aFont);
 pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
 int w = 0;
-long nTextWidth = (rPageSize.Width()-60) / 4;
-while((w = pDev->GetTextWidth(msTiledWatermark)) > nTextWidth)
+int watermarkcount = ((rPageSize.Width()) / 200)+1;
+long nTextWidth = rPageSize.Width() / (watermarkcount*1.5);
+OUString oneLineText = watermark;
+
+if(watermark.getLength() > lineLength)
+oneLineText = watermark.copy(0, lineLength);
+
+while((w = pDev->GetTextWidth(oneLineText)) > nTextWidth)
 {
 if(w==0)
 break;
@@ -1182,27 +1206,32 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 aFont.SetFontHeight(nNewHeight);
 pDev->SetFont( aFont );
 }
+
+// maximum number of watermark count for the width
+if(watermarkcount > 8)
+watermarkcount = 8;
+
 pDev->Pop();
 
 rWriter.Push();
 rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
 rWriter.SetFont(aFont);
 rWriter.SetTextColor( Color(19,20,22) );
-Point aTextPoint;
-tools::Rectangle aTextRect;
-aTextPoint = Point(70,80);
+// center watermarks horizontally
+Point aTextPoint( (rPageSize.Width()/2) - 
(((nTextWidth*watermarkcount)+(watermarkcount-1)*(nTextWidth/2))/2),
+  pDev->GetTextHeight());
 
-for( int i = 0; i < 3; i ++)
+for( int i = 0; i < watermarkcount; i ++)
 {
-while(aTextPoint.getY()+pDev->GetTextHeight() <= rPageSize.Height()-40)
+while(aTextPoint.getY()+pDev->GetTextHeight()*2 <= rPageSize.Height())
 {
-aTextRect = tools::Rectangle(Point(aTextPoint.getX(), 
aTextPoint.getY()-pDev->GetTextHeight()), 
Size(pDev->GetTextWidth(msTiledWatermark),pDev->GetTextHeight()));
+tools::Rectangle aTextRect(aTextPoint, 
Size(nTextWidth,pDev->GetTextHeight()*2));
 
 pDev->Push();
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(19,20,22) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter);
 rWriter.EndTransparencyGroup( aTextRect, 50 );
 pDev->Pop();
 
@@ -1210,14 +1239,14 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(236,235,233) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter);
 rWriter.EndTransparencyGroup( aTextRect, 50 );
 pDev->Pop();
 
-aTextPoint.Move(0,(rPageSize.Height()-40)/4);
+aTextPoint.Move(0, pDev->GetTextHeight()*3);
 }
-aTextPoint=Point( aTextPoint.getX(), 80 );
-aTextPoint

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

2019-03-22 Thread merttumer (via logerrit)
 filter/source/pdf/pdfexport.cxx |   52 +++-
 1 file changed, 41 insertions(+), 11 deletions(-)

New commits:
commit 0100258f2d2e24196417784993c2c5801bf00345
Author: merttumer 
AuthorDate: Fri Mar 15 20:11:15 2019 +0300
Commit: Jan Holesovsky 
CommitDate: Fri Mar 22 16:22:48 2019 +0100

Make pdf export watermarks look like watermarks on online

Change-Id: Ib5af8c61dd9a539c63594a91b8ec17ff07327feb
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/69317
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index e815d16aeb3a..31adb9788e1d 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1121,6 +1121,24 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 
 void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& 
rPageSize )
 {
+OUString watermark = msTiledWatermark;
+int watermarkLength = watermark.getLength();
+// Maximum number of characters in one line.
+// it is set to 21 to make it look like tiled watermaks as online in 
secure view
+const int lineLength = 21;
+int lnIndex = lineLength;
+int lnCount = watermarkLength / lineLength;
+
+while(lnCount)
+{
+OUString tempstr = watermark;
+watermark = watermark.copy(0, lnIndex);
+watermark += OUString("\n");
+watermark += tempstr.copy(lnIndex);
+lnIndex += lineLength;
+lnCount--;
+}
+
 vcl::Font aFont( OUString( "Liberation Sans" ), Size( 0, 40 ) );
 aFont.SetItalic( ITALIC_NONE );
 aFont.SetWidthType( WIDTH_NORMAL );
@@ -1134,8 +1152,14 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 pDev->SetFont(aFont);
 pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
 int w = 0;
-long nTextWidth = (rPageSize.Width()-60) / 4;
-while((w = pDev->GetTextWidth(msTiledWatermark)) > nTextWidth)
+int watermarkcount = ((rPageSize.Width()) / 200)+1;
+long nTextWidth = (rPageSize.Width()) / ((watermarkcount)*1.5);
+OUString oneLineText = watermark;
+
+if(watermark.getLength() > lineLength)
+oneLineText = watermark.copy(0, lineLength);
+
+while((w = pDev->GetTextWidth(oneLineText)) > nTextWidth)
 {
 if(w==0)
 break;
@@ -1144,6 +1168,11 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 aFont.SetFontHeight(nNewHeight);
 pDev->SetFont( aFont );
 }
+
+// maximum number of watermark count for the width
+if(watermarkcount > 8)
+watermarkcount = 8;
+
 pDev->Pop();
 
 rWriter.Push();
@@ -1152,19 +1181,20 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 rWriter.SetTextColor( Color(19,20,22) );
 Point aTextPoint;
 tools::Rectangle aTextRect;
-aTextPoint = Point(70,80);
+//center watermarks horizontially
+aTextPoint = 
Point((rPageSize.Width()/2)-(((nTextWidth*(watermarkcount))+(watermarkcount-1)*(nTextWidth/2))/2),
 pDev->GetTextHeight());
 
-for( int i = 0; i < 3; i ++)
+for( int i = 0; i < watermarkcount; i ++)
 {
-while(aTextPoint.getY()+pDev->GetTextHeight() <= rPageSize.Height()-40)
+while(aTextPoint.getY()+pDev->GetTextHeight()*2 <= rPageSize.Height())
 {
-aTextRect = tools::Rectangle(Point(aTextPoint.getX(), 
aTextPoint.getY()-pDev->GetTextHeight()), 
Size(pDev->GetTextWidth(msTiledWatermark),pDev->GetTextHeight()));
+aTextRect = tools::Rectangle(aTextPoint, 
Size(nTextWidth,pDev->GetTextHeight()*2));
 
 pDev->Push();
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(19,20,22) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter);
 rWriter.EndTransparencyGroup( aTextRect, 50 );
 pDev->Pop();
 
@@ -1172,14 +1202,14 @@ void PDFExport::ImplWriteTiledWatermark( 
vcl::PDFWriter& rWriter, const Size& rP
 rWriter.SetClipRegion();
 rWriter.BeginTransparencyGroup();
 rWriter.SetTextColor( Color(236,235,233) );
-rWriter.DrawText(aTextPoint, msTiledWatermark);
+rWriter.DrawText(aTextRect, watermark, 
DrawTextFlags::MultiLine|DrawTextFlags::Center|DrawTextFlags::VCenter);
 rWriter.EndTransparencyGroup( aTextRect, 50 );
 pDev->Pop();
 
-aTextPoint.Move(0,(rPageSize.Height()-40)/4);
+aTextPoint.Move(0, pDev->GetTextHeight()*3);
 }
-aTextPoint=Point( aTextPoint.getX(), 80 );
-aTextPoint.Move( (rPageSize.Width()-120)/3, 0 );
+aTextPoint=Point( aTextPoint.get