summaryrefslogtreecommitdiff
path: root/starmath/inc
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2021-04-25 00:26:38 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-15 08:15:53 +0200
commit7beb507edbf94627c639483175be730f38f90dcd (patch)
tree115104e08d206986289459d361165e4449b66a20 /starmath/inc
parentcb63fad5a1967d20d067cd4ee2c8ddc7ba8ff1ea (diff)
tdf#130654 editable smeditwindow zoom
Setting only accessible from advanced configuration. Access: org.openoffice.Office.Math.smeditwindowzoom Note that the change won't take immediate effect. LibreOffice has to be restarted to the change to take effect. Math configuration entries are not synced correctly. More detailed explanation can be fond in tdf#132145. Change-Id: I0017ddda73ab2916c6ad1fa238265d57a2a3020e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114616 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath/inc')
-rw-r--r--starmath/inc/cfgitem.hxx2
-rw-r--r--starmath/inc/document.hxx5
-rw-r--r--starmath/inc/smediteng.hxx60
-rw-r--r--starmath/inc/starmath.hrc1
4 files changed, 66 insertions, 2 deletions
diff --git a/starmath/inc/cfgitem.hxx b/starmath/inc/cfgitem.hxx
index 9e1438b68c38..6342d740c35c 100644
--- a/starmath/inc/cfgitem.hxx
+++ b/starmath/inc/cfgitem.hxx
@@ -162,6 +162,8 @@ public:
void SetPrintSize(SmPrintSize eSize);
sal_uInt16 GetPrintZoomFactor() const;
void SetPrintZoomFactor(sal_uInt16 nVal);
+ sal_uInt16 GetSmEditWindowZoomFactor() const;
+ void SetSmEditWindowZoomFactor(sal_uInt16 nVal);
bool IsSaveOnlyUsedSymbols() const;
void SetSaveOnlyUsedSymbols(bool bVal);
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 2c3a9183bf87..588a8d93f1b0 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -58,6 +58,7 @@ namespace oox::formulaimport { class XmlStream; }
class SmDocShell;
class EditEngine;
+class SmEditEngine;
class SmPrinterAccess
{
@@ -82,7 +83,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
SvtLinguOptions maLinguOptions;
std::unique_ptr<SmTableNode> mpTree;
rtl::Reference<SfxItemPool> mpEditEngineItemPool;
- std::unique_ptr<EditEngine> mpEditEngine;
+ std::unique_ptr<SmEditEngine> mpEditEngine;
VclPtr<SfxPrinter> mpPrinter; //q.v. comment to SmPrinter Access!
VclPtr<Printer> mpTmpPrinter; //ditto
sal_uInt16 mnModifyCount;
@@ -210,7 +211,7 @@ public:
void writeFormulaRtf(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding);
void readFormulaOoxml( oox::formulaimport::XmlStream& stream );
- void UpdateEditEngineDefaultFonts(const Color& aTextColor);
+ void UpdateEditEngineDefaultFonts();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/inc/smediteng.hxx b/starmath/inc/smediteng.hxx
new file mode 100644
index 000000000000..c3d3d576467e
--- /dev/null
+++ b/starmath/inc/smediteng.hxx
@@ -0,0 +1,60 @@
+/* This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <editeng/editeng.hxx>
+#include <editeng/fontitem.hxx>
+#include <unotools/lingucfg.hxx>
+
+class SmEditEngine : public EditEngine
+{
+public:
+ SmEditEngine(SfxItemPool* pItemPool);
+ SmEditEngine(const SmEditEngine&) = delete;
+
+public:
+ /**
+ * Runs checkZoom and if true runs updateZoom
+ */
+ void executeZoom(EditView* pEditView = nullptr);
+
+ /**
+ * Sets up default font parameters for the item pool.
+ */
+ static void setSmItemPool(SfxItemPool* mpItemPool, const SvtLinguOptions& maLangOptions);
+
+ // Deal with text scaling
+private:
+ sal_Int32 m_nOldZoom;
+ sal_Int32 m_nNewZoom;
+ sal_Int32 m_nDefaultFontSize;
+
+ /**
+ * Checks if the zoom of smeditwindow has changed.
+ * m_nNewZoom is updated.
+ * @return zoom has changed
+ */
+ bool checkZoom();
+
+ /**
+ * Updates the zoom of smeditwindow.
+ * m_nOldZoom is set to m_nNewZoom.
+ */
+
+ void updateZoom();
+
+ // Gather information for more complex tasks
+private:
+ ESelection m_aAllSelection;
+
+ /**
+ * Finds the ESelection wich contains all the text.
+ */
+ void updateAllESelection();
+};
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 5001b29b0f51..c566783156ca 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -67,6 +67,7 @@
#define SID_SAVE_ONLY_USED_SYMBOLS (SID_SMA_START + 125)
#define SID_ELEMENTSDOCKINGWINDOW (SID_SMA_START + 126)
#define SID_AUTO_CLOSE_BRACKETS (SID_SMA_START + 127)
+#define SID_SMEDITWINDOWZOOM (SID_SMA_START + 129)
#define SID_DEFAULT_SM_SYNTAX_VERSION (SID_SMA_START + 130)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */