summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-11-28 23:34:50 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2016-11-29 01:04:31 +0000
commit4130c8def811d1dcc87eacaa8ae48ba02738a790 (patch)
tree74aad48c737f03dc13acf7c3d4bffaa8468b9ef5 /starmath/source
parent2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf (diff)
starmath: these static functions can be local
Change-Id: I5babffab846a9f17cd14cbf8ffd3b34b6bb27abd Reviewed-on: https://gerrit.libreoffice.org/31322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/node.cxx10
-rw-r--r--starmath/source/utility.cxx20
2 files changed, 18 insertions, 12 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index ba7f5c1fcc33..11ff7bcb0512 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -669,8 +669,9 @@ void SmUnHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
/**************************************************************************/
+namespace {
-void SmRootNode::GetHeightVerOffset(const SmRect &rRect,
+void lcl_GetHeightVerOffset(const SmRect &rRect,
long &rHeight, long &rVerOffset)
// calculate height and vertical offset of root sign suitable for 'rRect'
{
@@ -682,7 +683,7 @@ void SmRootNode::GetHeightVerOffset(const SmRect &rRect,
}
-Point SmRootNode::GetExtraPos(const SmRect &rRootSymbol,
+Point lcl_GetExtraPos(const SmRect &rRootSymbol,
const SmRect &rExtra)
{
const Size &rSymSize = rRootSymbol.GetSize();
@@ -704,6 +705,7 @@ Point SmRootNode::GetExtraPos(const SmRect &rRootSymbol,
return aPos;
}
+}
void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
{
@@ -721,7 +723,7 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
long nHeight,
nVerOffset;
- GetHeightVerOffset(*pBody, nHeight, nVerOffset);
+ lcl_GetHeightVerOffset(*pBody, nHeight, nVerOffset);
nHeight += rFormat.GetDistance(DIS_ROOT)
* GetFont().GetFontSize().Height() / 100L;
@@ -741,7 +743,7 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
{ pExtra->SetSize(Fraction(rFormat.GetRelSize(SIZ_INDEX), 100));
pExtra->Arrange(rDev, rFormat);
- aPos = GetExtraPos(*pRootSym, *pExtra);
+ aPos = lcl_GetExtraPos(*pRootSym, *pExtra);
pExtra->MoveTo(aPos);
}
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index cadb88e1c6fc..b0ad1db76143 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -59,7 +59,9 @@ vcl::Font SmFontPickList::Get(sal_uInt16 nPos) const
return nPos < aFontVec.size() ? aFontVec[nPos] : vcl::Font();
}
-bool SmFontPickList::CompareItem(const vcl::Font & rFirstFont, const vcl::Font & rSecondFont)
+namespace {
+
+bool lcl_CompareItem(const vcl::Font & rFirstFont, const vcl::Font & rSecondFont)
{
return rFirstFont.GetFamilyName() == rSecondFont.GetFamilyName() &&
rFirstFont.GetFamilyType() == rSecondFont.GetFamilyType() &&
@@ -68,7 +70,7 @@ bool SmFontPickList::CompareItem(const vcl::Font & rFirstFont, const vcl::Font &
rFirstFont.GetItalic() == rSecondFont.GetItalic();
}
-OUString SmFontPickList::GetStringItem(const vcl::Font &rFont)
+OUString lcl_GetStringItem(const vcl::Font &rFont)
{
OUStringBuffer aString(rFont.GetFamilyName());
@@ -86,10 +88,12 @@ OUString SmFontPickList::GetStringItem(const vcl::Font &rFont)
return aString.makeStringAndClear();
}
+}
+
void SmFontPickList::Insert(const vcl::Font &rFont)
{
for (size_t nPos = 0; nPos < aFontVec.size(); nPos++)
- if (CompareItem( aFontVec[nPos], rFont))
+ if (lcl_CompareItem( aFontVec[nPos], rFont))
{
aFontVec.erase( aFontVec.begin() + nPos );
break;
@@ -149,10 +153,10 @@ SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList)
*static_cast<SmFontPickList *>(this) = rList;
for (nPos = 0; nPos < aFontVec.size(); nPos++)
- InsertEntry(GetStringItem(aFontVec[nPos]), nPos);
+ InsertEntry(lcl_GetStringItem(aFontVec[nPos]), nPos);
if (aFontVec.size() > 0)
- SelectEntry(GetStringItem(aFontVec.front()));
+ SelectEntry(lcl_GetStringItem(aFontVec.front()));
return *this;
}
@@ -161,9 +165,9 @@ void SmFontPickListBox::Insert(const vcl::Font &rFont)
{
SmFontPickList::Insert(rFont);
- RemoveEntry(GetStringItem(aFontVec.front()));
- InsertEntry(GetStringItem(aFontVec.front()), 0);
- SelectEntry(GetStringItem(aFontVec.front()));
+ RemoveEntry(lcl_GetStringItem(aFontVec.front()));
+ InsertEntry(lcl_GetStringItem(aFontVec.front()), 0);
+ SelectEntry(lcl_GetStringItem(aFontVec.front()));
while (GetEntryCount() > nMaxItems)
RemoveEntry(GetEntryCount() - 1);