summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-12-22 12:00:49 +0900
committerKohei Yoshida <libreoffice@kohei.us>2015-12-31 17:43:25 +0000
commiteb65936f1996cc37632f7241cf07fc85ff633049 (patch)
tree55f1e531287229230a87bcdd553e1b0d4b3f4ea2
parent054b25c9ce96eb50d80177cb48cd9b10513806c3 (diff)
starmath: Manage SmDocShell's pCursor via std::unique_ptr
Change-Id: Id9c67638e5c2e535cc06e9566c9a169471f55da8 Reviewed-on: https://gerrit.libreoffice.org/20856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r--starmath/inc/document.hxx5
-rw-r--r--starmath/source/document.cxx17
2 files changed, 10 insertions, 12 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 67ef680e79c6..2cda3759af52 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -32,6 +32,7 @@
#include <oox/core/filterbase.hxx>
#include <oox/mathml/import.hxx>
+#include <memory>
#include <set>
#include "format.hxx"
@@ -102,7 +103,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
VclPtr<Printer> pTmpPrinter; //ditto
sal_uInt16 nModifyCount;
bool bIsFormulaArranged;
- SmCursor *pCursor;
+ std::unique_ptr<SmCursor> pCursor;
std::set< OUString > aUsedSymbols; // to export used symbols only when saving
@@ -219,7 +220,7 @@ public:
/** True, if cursor have previously been requested and thus
* has some sort of position.
*/
- bool HasCursor() { return pCursor != nullptr; }
+ bool HasCursor();
};
#endif
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index dae21759c0b2..9657bf6b89d4 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -489,17 +489,19 @@ Size SmDocShell::GetSize()
}
void SmDocShell::InvalidateCursor(){
- delete pCursor;
- pCursor = nullptr;
+ pCursor.reset();
}
SmCursor& SmDocShell::GetCursor(){
if(!pCursor)
- pCursor = new SmCursor(pTree, this);
+ pCursor.reset(new SmCursor(pTree, this));
return *pCursor;
}
-
+bool SmDocShell::HasCursor()
+{
+ return pCursor.get() != nullptr;
+}
SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
{
@@ -656,8 +658,6 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags )
, nModifyCount(0)
, bIsFormulaArranged(false)
{
- pCursor = nullptr;
-
SetPool(&SfxGetpApp()->GetPool());
SmModule *pp = SM_MOD();
@@ -676,10 +676,7 @@ SmDocShell::~SmDocShell()
EndListening(aFormat);
EndListening(*pp->GetConfig());
-
- delete pCursor;
- pCursor = nullptr;
-
+ pCursor.reset();
delete pEditEngine;
SfxItemPool::Free(pEditEngineItemPool);
delete pTree;
c6e35b2d87adb39ad44ba287c9a01 2015-12-04tdf#92925 Remove PBM, PGM, and PPM ExportBryan Quigley Remove export for all the netpbm formats. Import still works but these filetypes don't preserve good quality anyway. Change-Id: If4b47f749275a9d3d663f61872f448e01112f6b5 Reviewed-on: https://gerrit.libreoffice.org/20361 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0 2015-11-06merged graphic import/export into a single libraryOliver Specht instead of egi, eme, epb, epg, epp, eps, ept, era, eti, exp, icd, idx, ime, ipb, ipd, ips, ipt, ipx, ira, itg, iti, there is now one graphic import export lib (gie) Change-Id: I20c0dd94e5857bb6e2e8cc8ac175ff500c6bbdfc Reviewed-on: https://gerrit.libreoffice.org/19756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de> 2015-10-30UNO: no need to use OUString constructor when calling createInstanceNoel Grandin Change-Id: I37da28539b94706574116d0fff5f008aabfb5526 Reviewed-on: https://gerrit.libreoffice.org/19682 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> 2015-10-27loplugin:unusedmethodsNoel Grandin Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861 Reviewed-on: https://gerrit.libreoffice.org/19231 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2015-09-29loplugin:removeunusedmethods, remove unused stuffNoel Grandin Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350 2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> 2014-04-02Kill superfluous vertical whitespaceTor Lillqvist Change-Id: I81ce8fd7022bf283db668705efdfb0666f87bde9 2014-03-12Simplify linear searches in FilterConfigCacheAlex Henrie No change in functionality, just eliminated a redundant comparison like FilterConfigCache::GetImportFormatNumberForExtension already does. Change-Id: I7b04eae2ae7e79f0804ad958d61771758545bf0a Reviewed-on: https://gerrit.libreoffice.org/8502 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2014-02-26Removed unnecessary comment decorations from VCL sourcesChris Sherlock Conflicts: vcl/headless/svpgdi.cxx vcl/source/app/dbggui.cxx vcl/source/app/help.cxx vcl/source/app/idlemgr.cxx vcl/source/app/settings.cxx vcl/source/app/stdtext.cxx vcl/source/app/svdata.cxx vcl/source/app/svmain.cxx vcl/source/control/fixed.cxx vcl/source/control/ilstbox.cxx vcl/source/control/spinbtn.cxx vcl/source/filter/sgfbram.cxx vcl/source/filter/sgvmain.cxx vcl/source/filter/sgvtext.cxx vcl/source/filter/wmf/emfwr.hxx vcl/source/filter/wmf/winmtf.hxx vcl/source/filter/wmf/wmfwr.hxx vcl/source/fontsubset/cff.cxx vcl/source/fontsubset/fontsubset.cxx vcl/source/fontsubset/xlat.cxx Change-Id: Ifc4fa21e552a8b031645eb883bdc23563eebb602 Reviewed-on: https://gerrit.libreoffice.org/8357 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2014-02-23Remove unneccessary commentsAlexander Wilms Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb Reviewed-on: https://gerrit.libreoffice.org/8182 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2014-02-21vcl: sal_Bool -> boolStephan Bergmann Change-Id: I2a3e3d3e3266ea0f0fafdd91362076a4aa160f0e