summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-30 09:08:43 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-30 10:43:43 +0000
commitb18b1e80e9f3359fdfc06dc36dd4f0c15e9344af (patch)
treefdddf4fde93715d21a53a68a38f1104fbed151bb /starmath
parentsw: reindent etc. SwContentTree::ExecCommand (diff)
downloadcore-b18b1e80e9f3359fdfc06dc36dd4f0c15e9344af.tar.gz
core-b18b1e80e9f3359fdfc06dc36dd4f0c15e9344af.zip
sw: use auto when initializing with a cast to avoid duplicating the type name
Change-Id: Ide7bd0f1f444824b78aa53cfe1db0129cbca1a5d Reviewed-on: https://gerrit.libreoffice.org/31397 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/rtfexport.cxx8
-rw-r--r--starmath/source/unofilter.cxx4
-rw-r--r--starmath/source/wordexportbase.cxx2
3 files changed, 7 insertions, 7 deletions
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index b0e947d15b81..9acd9d494a1d 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -54,7 +54,7 @@ void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/)
if (pNode->GetToken().eType == TTEXT) // literal text
m_pBuffer->append(LO_STRING_SVTOOLS_RTF_MNOR " ");
- const SmTextNode* pTemp = static_cast<const SmTextNode*>(pNode);
+ auto pTemp = static_cast<const SmTextNode*>(pNode);
SAL_INFO("starmath.rtf", "Text: " << pTemp->GetText());
for (sal_Int32 i = 0; i < pTemp->GetText().getLength(); i++)
{
@@ -180,7 +180,7 @@ namespace
OString mathSymbolToString(const SmNode* node, rtl_TextEncoding nEncoding)
{
assert(node->GetType() == NMATH || node->GetType() == NMATHIDENT);
- const SmTextNode* txtnode = static_cast<const SmTextNode*>(node);
+ auto txtnode = static_cast<const SmTextNode*>(node);
if (txtnode->GetText().isEmpty())
return OString();
assert(txtnode->GetText().getLength() == 1);
@@ -405,7 +405,7 @@ void SmRtfExport::HandleBrace(const SmBraceNode* pNode, int nLevel)
std::vector< const SmNode* > subnodes;
if (pNode->Body()->GetType() == NBRACEBODY)
{
- const SmBracebodyNode* body = static_cast<const SmBracebodyNode*>(pNode->Body());
+ auto body = static_cast<const SmBracebodyNode*>(pNode->Body());
bool separatorWritten = false; // assume all separators are the same
for (int i = 0; i < body->GetNumSubNodes(); ++i)
{
@@ -413,7 +413,7 @@ void SmRtfExport::HandleBrace(const SmBraceNode* pNode, int nLevel)
if (subnode->GetType() == NMATH || subnode->GetType() == NMATHIDENT)
{
// do not write, but write what separator it is
- const SmMathSymbolNode* math = static_cast<const SmMathSymbolNode*>(subnode);
+ auto math = static_cast<const SmMathSymbolNode*>(subnode);
if (!separatorWritten)
{
m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MSEPCHR " ");
diff --git a/starmath/source/unofilter.cxx b/starmath/source/unofilter.cxx
index 95fc3e8e0968..d24d0b2d3e93 100644
--- a/starmath/source/unofilter.cxx
+++ b/starmath/source/unofilter.cxx
@@ -67,9 +67,9 @@ sal_Bool MathTypeFilter::filter(const uno::Sequence<beans::PropertyValue>& rDesc
// Is this a MathType Storage?
if (aStorage->IsStream("Equation Native"))
{
- if (SmModel* pModel = dynamic_cast<SmModel*>(m_xDstDoc.get()))
+ if (auto pModel = dynamic_cast<SmModel*>(m_xDstDoc.get()))
{
- SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
+ auto pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell());
OUString aText = pDocShell->GetText();
MathType aEquation(aText);
bSuccess = aEquation.Parse(aStorage.get());
diff --git a/starmath/source/wordexportbase.cxx b/starmath/source/wordexportbase.cxx
index 61c1d973fbf4..a5136a729220 100644
--- a/starmath/source/wordexportbase.cxx
+++ b/starmath/source/wordexportbase.cxx
@@ -51,7 +51,7 @@ void SmWordExportBase::HandleNode(const SmNode* pNode, int nLevel)
break;
case NSPECIAL:
{
- const SmTextNode* pText= static_cast< const SmTextNode* >(pNode);
+ auto pText= static_cast<const SmTextNode*>(pNode);
//if the token str and the result text are the same then this
//is to be seen as text, else assume it's a mathchar
if (pText->GetText() == pText->GetToken().aText)