diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-03-18 18:24:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-24 06:14:17 +0000 |
commit | 7916487cf4d9603cdbe4c7ffbe9bb3f28b51ce4e (patch) | |
tree | e3bafe408d8efd97d156521c1ea93d741a5215a8 /sfx2 | |
parent | 9ee2d69c610d94280103e089671e9ba78b070e23 (diff) |
convert ViewShellId to o3tl::strong_int
Change-Id: I45553d11d56aa8c4432aec126ca51f24bd3ead09
Reviewed-on: https://gerrit.libreoffice.org/35421
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/view/viewimp.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 73e29f3994e8..2420b0903578 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -32,7 +32,7 @@ int SfxLokHelper::createView() SfxViewShell* pViewShell = SfxViewShell::Current(); if (!pViewShell) return -1; - return pViewShell->GetViewShellId(); + return (sal_Int32)pViewShell->GetViewShellId(); } void SfxLokHelper::destroyView(int nId) @@ -41,12 +41,12 @@ void SfxLokHelper::destroyView(int nId) if (!pApp) return; - unsigned nViewShellId = nId; + int nViewShellId = nId; SfxViewShellArr_Impl& rViewArr = pApp->GetViewShells_Impl(); for (SfxViewShell* pViewShell : rViewArr) { - if (pViewShell->GetViewShellId() == nViewShellId) + if ((sal_Int32)pViewShell->GetViewShellId() == nViewShellId) { SfxViewFrame* pViewFrame = pViewShell->GetViewFrame(); SfxRequest aRequest(pViewFrame, SID_CLOSEWIN); @@ -62,12 +62,12 @@ void SfxLokHelper::setView(int nId) if (!pApp) return; - unsigned nViewShellId = nId; + int nViewShellId = nId; SfxViewShellArr_Impl& rViewArr = pApp->GetViewShells_Impl(); for (SfxViewShell* pViewShell : rViewArr) { - if (pViewShell->GetViewShellId() == nViewShellId) + if ((sal_Int32)pViewShell->GetViewShellId() == nViewShellId) { if (pViewShell == SfxViewShell::Current()) return; @@ -93,7 +93,7 @@ int SfxLokHelper::getView(SfxViewShell* pViewShell) if (!pViewShell) return -1; - return pViewShell->GetViewShellId(); + return (sal_Int32)pViewShell->GetViewShellId(); } std::size_t SfxLokHelper::getViewsCount() @@ -115,7 +115,7 @@ bool SfxLokHelper::getViewIds(int* pArray, size_t nSize) for (std::size_t i = 0; i < rViewArr.size(); ++i) { SfxViewShell* pViewShell = rViewArr[i]; - pArray[i] = pViewShell->GetViewShellId(); + pArray[i] = (sal_Int32)pViewShell->GetViewShellId(); } return true; } diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 95fdf8260df4..bbf0eb30a48f 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -63,7 +63,7 @@ struct SfxViewShell_Impl /// Set if we are in the middle of a tiled search. bool m_bTiledSearching; static sal_uInt32 m_nLastViewShellId; - const sal_uInt32 m_nViewShellId; + const ViewShellId m_nViewShellId; explicit SfxViewShell_Impl(SfxViewShellFlags const nFlags); ~SfxViewShell_Impl(); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 4a9fabc30724..329ded27bf28 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1486,7 +1486,7 @@ int SfxViewShell::getPart() const return 0; } -sal_uInt32 SfxViewShell::GetViewShellId() const +ViewShellId SfxViewShell::GetViewShellId() const { return pImpl->m_nViewShellId; } @@ -1509,7 +1509,7 @@ void SfxViewShell::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("SfxViewShell")); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("id"), BAD_CAST(OString::number(GetViewShellId()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("id"), BAD_CAST(OString::number((sal_Int32)GetViewShellId()).getStr())); xmlTextWriterEndElement(pWriter); } |