summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-10-28 18:02:46 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-10-29 09:36:39 +0100
commit3d872ecc51e47e02e70732c848964274b2aad29e (patch)
tree4ce0312c0b02a5f9d10f153e1f63644d242154d4 /svx
parent4bfa790236b9c0d70c28101858547c616e75e9e4 (diff)
tdf#110357: Impress table looses selection when clicking on ...
... Increase \ decrease font button Change-Id: I52cf853de01b06c6c9db9779f15174f895789da8 Reviewed-on: https://gerrit.libreoffice.org/43962 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx6
-rw-r--r--svx/source/table/tablecontroller.cxx46
2 files changed, 52 insertions, 0 deletions
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx
index 0fc2d526e1c1..e8e6383e3a8c 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -119,6 +119,12 @@ bool SelectionController::setCursorLogicPosition(const Point& /*rPosition*/, boo
return false;
}
+
+bool SelectionController::ChangeFontSize(bool /*bGrow*/, const FontList* /*pFontList*/)
+{
+ return false;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index f12b7b1d4e67..0677bccbb892 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -72,6 +72,7 @@
#include <cppuhelper/implbase.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
+#include <editeng/editview.hxx>
using ::editeng::SvxBorderLine;
using namespace sdr::table;
@@ -2029,6 +2030,51 @@ void SvxTableController::setSelectedCells( const CellPos& rStart, const CellPos&
}
+bool SvxTableController::ChangeFontSize(bool bGrow, const FontList* pFontList)
+{
+ if (mxTable.is())
+ {
+ if (mpView->IsTextEdit())
+ return true;
+
+ CellPos aStart, aEnd;
+ if(hasSelectedCells())
+ {
+ getSelectedCells(aStart, aEnd);
+ }
+ else
+ {
+ aStart.mnRow = 0;
+ aStart.mnCol = 0;
+ aEnd.mnRow = mxTable->getRowCount() - 1;
+ aEnd.mnCol = mxTable->getColumnCount() - 1;
+ }
+
+ for (sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++)
+ {
+ for (sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++)
+ {
+ CellRef xCell(dynamic_cast< Cell* >(mxTable->getCellByPosition(nCol, nRow).get()));
+ if (xCell.is())
+ {
+ if (mpModel && mpModel->IsUndoEnabled())
+ xCell->AddUndo();
+
+ SfxItemSet aCellSet(xCell->GetItemSet());
+ if (EditView::ChangeFontSize(bGrow, aCellSet, pFontList))
+ {
+ xCell->SetMergedItemSetAndBroadcast(aCellSet, false);
+ }
+ }
+ }
+ }
+ UpdateTableShape();
+ return true;
+ }
+ return false;
+}
+
+
void SvxTableController::UpdateSelection( const CellPos& rPos )
{
maCursorLastPos = rPos;