summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
Diffstat (limited to 'editeng')
-rw-r--r--editeng/Library_editeng.mk2
-rw-r--r--editeng/qa/unit/core-test.cxx18
-rw-r--r--editeng/source/editeng/editobj.cxx28
-rw-r--r--editeng/source/editeng/editobj2.hxx4
-rw-r--r--editeng/source/editeng/section.cxx (renamed from editeng/source/editeng/sectionattribute.cxx)6
5 files changed, 29 insertions, 29 deletions
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk
index c4a9fbeb9c7d..94e841bca389 100644
--- a/editeng/Library_editeng.mk
+++ b/editeng/Library_editeng.mk
@@ -60,7 +60,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
editeng/source/editeng/impedit3 \
editeng/source/editeng/impedit4 \
editeng/source/editeng/impedit5 \
- editeng/source/editeng/sectionattribute \
+ editeng/source/editeng/section \
editeng/source/editeng/textconv \
editeng/source/items/borderline \
editeng/source/items/bulitem \
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index ebe7b54aef11..b1c100c48380 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -23,7 +23,7 @@
#include "editeng/unofield.hxx"
#include "editeng/wghtitem.hxx"
#include "editeng/postitem.hxx"
-#include "editeng/sectionattribute.hxx"
+#include "editeng/section.hxx"
#include "editeng/editobj.hxx"
#include <com/sun/star/text/textfield/Type.hpp>
@@ -342,7 +342,7 @@ void Test::testAutocorrect()
}
}
-bool hasBold(const editeng::SectionAttribute& rSecAttr)
+bool hasBold(const editeng::Section& rSecAttr)
{
std::vector<const SfxPoolItem*>::const_iterator it = rSecAttr.maAttributes.begin(), itEnd = rSecAttr.maAttributes.end();
for (; it != itEnd; ++it)
@@ -359,7 +359,7 @@ bool hasBold(const editeng::SectionAttribute& rSecAttr)
return false;
}
-bool hasItalic(const editeng::SectionAttribute& rSecAttr)
+bool hasItalic(const editeng::Section& rSecAttr)
{
std::vector<const SfxPoolItem*>::const_iterator it = rSecAttr.maAttributes.begin(), itEnd = rSecAttr.maAttributes.end();
for (; it != itEnd; ++it)
@@ -397,14 +397,14 @@ void Test::testSectionAttributes()
aEngine.QuickSetAttribs(*pSet, ESelection(0,3,0,9)); // 'bbbccc'
boost::scoped_ptr<EditTextObject> pEditText(aEngine.CreateTextObject());
CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get());
- std::vector<editeng::SectionAttribute> aAttrs;
- pEditText->GetAllSectionAttributes(aAttrs);
+ std::vector<editeng::Section> aAttrs;
+ pEditText->GetAllSections(aAttrs);
// Now, we should have a total of 3 sections.
CPPUNIT_ASSERT_MESSAGE("There should be 3 sections.", aAttrs.size() == 3);
// First section should be 0-3 of paragraph 0, and it should only have boldness applied.
- const editeng::SectionAttribute* pSecAttr = &aAttrs[0];
+ const editeng::Section* pSecAttr = &aAttrs[0];
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnEnd);
@@ -447,13 +447,13 @@ void Test::testSectionAttributes()
boost::scoped_ptr<EditTextObject> pEditText(aEngine.CreateTextObject());
CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get());
- std::vector<editeng::SectionAttribute> aAttrs;
- pEditText->GetAllSectionAttributes(aAttrs);
+ std::vector<editeng::Section> aAttrs;
+ pEditText->GetAllSections(aAttrs);
size_t nSecCountCheck = 5;
CPPUNIT_ASSERT_EQUAL(nSecCountCheck, aAttrs.size());
// 1st, 3rd and 5th sections should correspond with 1st, 3rd and 5th paragraphs.
- const editeng::SectionAttribute* pSecAttr = &aAttrs[0];
+ const editeng::Section* pSecAttr = &aAttrs[0];
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnEnd);
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 7377081f142d..0a6700942ad0 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -28,7 +28,7 @@
#include "editeng/fieldupdater.hxx"
#include "editeng/macros.hxx"
-#include "editeng/sectionattribute.hxx"
+#include "editeng/section.hxx"
#include <editobj2.hxx>
#include <editeng/editdata.hxx>
#include <editattr.hxx>
@@ -277,9 +277,9 @@ bool EditTextObject::RemoveCharAttribs( sal_uInt16 nWhich )
return mpImpl->RemoveCharAttribs(nWhich);
}
-void EditTextObject::GetAllSectionAttributes( std::vector<editeng::SectionAttribute>& rAttrs ) const
+void EditTextObject::GetAllSections( std::vector<editeng::Section>& rAttrs ) const
{
- mpImpl->GetAllSectionAttributes(rAttrs);
+ mpImpl->GetAllSections(rAttrs);
}
void EditTextObject::GetStyleSheet(sal_Int32 nPara, OUString& rName, SfxStyleFamily& eFamily) const
@@ -832,24 +832,24 @@ bool EditTextObjectImpl::RemoveCharAttribs( sal_uInt16 _nWhich )
namespace {
-class FindByParagraph : std::unary_function<editeng::SectionAttribute, bool>
+class FindByParagraph : std::unary_function<editeng::Section, bool>
{
size_t mnPara;
public:
FindByParagraph(size_t nPara) : mnPara(nPara) {}
- bool operator() (const editeng::SectionAttribute& rAttr) const
+ bool operator() (const editeng::Section& rAttr) const
{
return rAttr.mnParagraph == mnPara;
}
};
-class FindBySectionStart : std::unary_function<editeng::SectionAttribute, bool>
+class FindBySectionStart : std::unary_function<editeng::Section, bool>
{
size_t mnPara;
size_t mnStart;
public:
FindBySectionStart(size_t nPara, size_t nStart) : mnPara(nPara), mnStart(nStart) {}
- bool operator() (const editeng::SectionAttribute& rAttr) const
+ bool operator() (const editeng::Section& rAttr) const
{
return rAttr.mnParagraph == mnPara && rAttr.mnStart == mnStart;
}
@@ -857,7 +857,7 @@ public:
}
-void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAttribute>& rAttrs ) const
+void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) const
{
typedef std::vector<size_t> SectionBordersType;
typedef std::vector<SectionBordersType> ParagraphsType;
@@ -892,7 +892,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
rBorders.erase(itUniqueEnd, rBorders.end());
}
- std::vector<editeng::SectionAttribute> aAttrs;
+ std::vector<editeng::Section> aAttrs;
// Create storage for each section. Note that this creates storage even
// for unformatted sections. The entries are sorted first by paragraph,
@@ -905,7 +905,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
if (rBorders.size() == 1 && rBorders[0] == 0)
{
// Empty paragraph. Push an empty section.
- aAttrs.push_back(editeng::SectionAttribute(nPara, 0, 0));
+ aAttrs.push_back(editeng::Section(nPara, 0, 0));
continue;
}
@@ -915,7 +915,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
for (++itBorder; itBorder != itBorderEnd; ++itBorder, nPrev = nCur)
{
nCur = *itBorder;
- aAttrs.push_back(editeng::SectionAttribute(nPara, nPrev, nCur));
+ aAttrs.push_back(editeng::Section(nPara, nPrev, nCur));
}
}
@@ -923,7 +923,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
return;
// Go through all formatted paragraphs, and store format items.
- std::vector<editeng::SectionAttribute>::iterator itAttr = aAttrs.begin();
+ std::vector<editeng::Section>::iterator itAttr = aAttrs.begin();
for (size_t nPara = 0; nPara < aContents.size(); ++nPara)
{
const ContentInfo& rC = aContents[nPara];
@@ -941,7 +941,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
continue;
size_t nStart = rXAttr.GetStart(), nEnd = rXAttr.GetEnd();
- std::vector<editeng::SectionAttribute>::iterator itCurAttr = itAttr;
+ std::vector<editeng::Section>::iterator itCurAttr = itAttr;
// Find the container whose start position matches.
itCurAttr = std::find_if(itCurAttr, aAttrs.end(), FindBySectionStart(nPara, nStart));
@@ -951,7 +951,7 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
for (; itCurAttr != aAttrs.end() && itCurAttr->mnParagraph == nPara && itCurAttr->mnEnd <= nEnd; ++itCurAttr)
{
- editeng::SectionAttribute& rSecAttr = *itCurAttr;
+ editeng::Section& rSecAttr = *itCurAttr;
rSecAttr.maAttributes.push_back(pItem);
}
}
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index b243647dccc1..8d7fd6d19dab 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -30,7 +30,7 @@
namespace editeng {
-struct SectionAttribute;
+struct Section;
}
@@ -225,7 +225,7 @@ public:
bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
- void GetAllSectionAttributes( std::vector<editeng::SectionAttribute>& rAttrs ) const;
+ void GetAllSections( std::vector<editeng::Section>& rAttrs ) const;
bool IsFieldObject() const;
const SvxFieldItem* GetField() const;
diff --git a/editeng/source/editeng/sectionattribute.cxx b/editeng/source/editeng/section.cxx
index d8e0e575e1fb..2e19d0db186c 100644
--- a/editeng/source/editeng/sectionattribute.cxx
+++ b/editeng/source/editeng/section.cxx
@@ -7,13 +7,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "editeng/sectionattribute.hxx"
+#include "editeng/section.hxx"
namespace editeng {
-SectionAttribute::SectionAttribute() : mnParagraph(0), mnStart(0), mnEnd(0) {}
+Section::Section() : mnParagraph(0), mnStart(0), mnEnd(0) {}
-SectionAttribute::SectionAttribute(size_t nPara, size_t nStart, size_t nEnd) :
+Section::Section(size_t nPara, size_t nStart, size_t nEnd) :
mnParagraph(nPara), mnStart(nStart), mnEnd(nEnd){}
}