summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app/docstyle.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/app/docstyle.cxx')
-rw-r--r--sw/source/uibase/app/docstyle.cxx34
1 files changed, 27 insertions, 7 deletions
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 31e7b14ab127..59b2d111b0db 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -69,6 +69,7 @@
#include <svx/xfillit0.hxx>
#include <svx/xflftrit.hxx>
#include <svx/drawitem.hxx>
+#include <names.hxx>
using namespace com::sun::star;
@@ -500,9 +501,9 @@ static const SwBoxAutoFormat* lcl_FindCellStyle(SwDoc& rDoc, std::u16string_view
{
const sal_uInt32 nBoxIndex = aTableTemplateMap[nBoxFormat];
const SwBoxAutoFormat& rBoxFormat = rTableStyle.GetBoxFormat(nBoxIndex);
- OUString sBoxFormatName;
- SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::TabStyle);
- sBoxFormatName += rTableStyle.GetTableTemplateCellSubName(rBoxFormat);
+ ProgName sBoxFormatProgName;
+ SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatProgName, SwGetPoolIdFromName::TabStyle);
+ OUString sBoxFormatName = sBoxFormatProgName.toString() + rTableStyle.GetTableTemplateCellSubName(rBoxFormat);
if (rName == sBoxFormatName)
pFormat = &rBoxFormat;
}
@@ -2620,6 +2621,25 @@ void SwDocStyleSheet::SetHelpId( const OUString& r, sal_uInt32 nId )
}
}
+sal_Int32 SwDocStyleSheet::GetSpotlightId()
+{
+ if (nFamily == SfxStyleFamily::Para)
+ {
+ SwTextFormatColl* pColl = m_pColl ?
+ m_pColl : m_rDoc.FindTextFormatCollByName(aName);
+ return pColl ? m_rDoc.GetTextFormatColls()->GetPos(pColl) : -1;
+ }
+
+ if (nFamily == SfxStyleFamily::Char)
+ {
+ SwCharFormat* pCharFormat = m_pCharFormat
+ ? m_pCharFormat : m_rDoc.FindCharFormatByName(aName);
+ return pCharFormat ? m_rDoc.GetCharFormats()->GetPos(pCharFormat) : -1;
+ }
+
+ return SfxStyleSheetBase::GetSpotlightId();
+}
+
// methods for DocStyleSheetPool
SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, bool bOrg )
: SfxStyleSheetBasePool(rDocument.GetAttrPool())
@@ -3100,7 +3120,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
{
if( !bIsSearchUsed || rDoc.getIDocumentStylePoolAccess().IsPoolTextCollUsed( *pPoolIds ) )
{
- s = SwStyleNameMapper::GetUIName( *pPoolIds, s );
+ s = SwStyleNameMapper::GetUIName( *pPoolIds, ProgName(s) );
m_aLst.Append( SfxStyleFamily::Para, s);
}
++pPoolIds;
@@ -3245,9 +3265,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
{
const sal_uInt32 nBoxIndex = aTableTemplateMap[nBoxFormat];
const SwBoxAutoFormat& rBoxFormat = rTableStyle.GetBoxFormat(nBoxIndex);
- OUString sBoxFormatName;
- SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::TabStyle);
- sBoxFormatName += rTableStyle.GetTableTemplateCellSubName(rBoxFormat);
+ ProgName sBoxFormatProgName;
+ SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatProgName, SwGetPoolIdFromName::TabStyle);
+ OUString sBoxFormatName = sBoxFormatProgName.toString() + rTableStyle.GetTableTemplateCellSubName(rBoxFormat);
m_aLst.Append( SfxStyleFamily::Cell, sBoxFormatName );
}
}