summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svl/source/items/IndexedStyleSheets.cxx9
-rw-r--r--writerperfect/CppunitTest_writerperfect_draw.mk3
2 files changed, 10 insertions, 2 deletions
diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx
index 260ae109f791..fa68f494e916 100644
--- a/svl/source/items/IndexedStyleSheets.cxx
+++ b/svl/source/items/IndexedStyleSheets.cxx
@@ -53,7 +53,6 @@ IndexedStyleSheets::IndexedStyleSheets()
}
;}
-
void
IndexedStyleSheets::Register(const SfxStyleSheetBase& style, unsigned pos)
{
@@ -91,6 +90,7 @@ IndexedStyleSheets::GetNumberOfStyleSheets() const
void
IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style)
{
+ assert(!style->GetName().isEmpty());
if (!HasStyleSheet(style)) {
mStyleSheets.push_back(style);
// since we just added an element to the vector, we can safely do -1 as it will always be >= 1
@@ -101,6 +101,7 @@ IndexedStyleSheets::AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& sty
bool
IndexedStyleSheets::RemoveStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style)
{
+ assert(!style->GetName().isEmpty());
rtl::OUString styleName = style->GetName();
std::vector<unsigned> positions = FindPositionsByName(styleName);
bool found = false;
@@ -200,6 +201,7 @@ void
IndexedStyleSheets::Clear(StyleSheetDisposer& disposer)
{
for (VectorType::iterator it = mStyleSheets.begin(); it != mStyleSheets.end(); ++it) {
+ assert(!(*it)->GetName().isEmpty());
disposer.Dispose(*it);
}
mStyleSheets.clear();
@@ -207,7 +209,10 @@ IndexedStyleSheets::Clear(StyleSheetDisposer& disposer)
}
IndexedStyleSheets::~IndexedStyleSheets()
-{;}
+{
+ for (const auto& rStyleSheet : mStyleSheets)
+ assert(!rStyleSheet->GetName().isEmpty());
+}
bool
IndexedStyleSheets::HasStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) const
diff --git a/writerperfect/CppunitTest_writerperfect_draw.mk b/writerperfect/CppunitTest_writerperfect_draw.mk
index 442fef4fa174..24f7ce40b88b 100644
--- a/writerperfect/CppunitTest_writerperfect_draw.mk
+++ b/writerperfect/CppunitTest_writerperfect_draw.mk
@@ -42,4 +42,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_draw,\
writerperfect/qa/unit/WpftDrawFilterTest \
))
+$(call gb_CppunitTest_get_target,writerperfect_draw): \
+ $(call gb_AllLangResTarget_get_target,sd)
+
# vim: set noet sw=4 ts=4: