summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-29 00:59:50 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-29 01:43:29 +0100
commit8482af46bdf62cafa808d32fd1748dde14c495e2 (patch)
tree9d63a6b6f53baa731769b493747d2e114b11994e
parent12c795caed2132e6026b90486575f5af70c82a42 (diff)
our little MSVC cant read C++11 proper and has special needs instead ...feature/unostyles
Change-Id: Ibc5ed9406679f469a7d4855f08f1a8c23c7239ef
-rw-r--r--sw/source/core/unocore/unostyle.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 734f075ec621..d789611f3c21 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -115,22 +115,23 @@ namespace
{}
};
static const std::vector<StyleFamilyEntry>* our_pStyleFamilyEntries;
- constexpr sal_uInt16 nPoolChrNormalRange = RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN;
- constexpr sal_uInt16 nPoolChrHtmlRange = RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN;
- constexpr sal_uInt16 nPoolCollTextRange = RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN;
- constexpr sal_uInt16 nPoolCollListsRange = RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN;
- constexpr sal_uInt16 nPoolCollExtraRange = RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN;
- constexpr sal_uInt16 nPoolCollRegisterRange = RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN;
- constexpr sal_uInt16 nPoolCollDocRange = RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN;
- constexpr sal_uInt16 nPoolCollHtmlRange = RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN;
- constexpr sal_uInt16 nPoolFrameRange = RES_POOLFRM_END - RES_POOLFRM_BEGIN;
- constexpr sal_uInt16 nPoolPageRange = RES_POOLPAGE_END - RES_POOLPAGE_BEGIN;
- constexpr sal_uInt16 nPoolNumRange = RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN;
- constexpr sal_uInt16 nPoolCollListsStackedStart = nPoolCollTextRange;
- constexpr sal_uInt16 nPoolCollExtraStackedStart = nPoolCollListsStackedStart + nPoolCollListsRange;
- constexpr sal_uInt16 nPoolCollRegisterStackedStart = nPoolCollExtraStackedStart + nPoolCollExtraRange;
- constexpr sal_uInt16 nPoolCollDocStackedStart = nPoolCollRegisterStackedStart + nPoolCollRegisterRange;
- constexpr sal_uInt16 nPoolCollHtmlStackedStart = nPoolCollDocStackedStart + nPoolCollDocRange;
+ // these should really be constexprs, but MSVC still is apparently too stupid for them
+ #define nPoolChrNormalRange (RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN)
+ #define nPoolChrHtmlRange (RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN)
+ #define nPoolCollTextRange ( RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN)
+ #define nPoolCollListsRange ( RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN)
+ #define nPoolCollExtraRange ( RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN)
+ #define nPoolCollRegisterRange ( RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN)
+ #define nPoolCollDocRange ( RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN)
+ #define nPoolCollHtmlRange ( RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN)
+ #define nPoolFrameRange ( RES_POOLFRM_END - RES_POOLFRM_BEGIN)
+ #define nPoolPageRange ( RES_POOLPAGE_END - RES_POOLPAGE_BEGIN)
+ #define nPoolNumRange ( RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN)
+ #define nPoolCollListsStackedStart ( nPoolCollTextRange)
+ #define nPoolCollExtraStackedStart ( nPoolCollListsStackedStart + nPoolCollListsRange)
+ #define nPoolCollRegisterStackedStart ( nPoolCollExtraStackedStart + nPoolCollExtraRange)
+ #define nPoolCollDocStackedStart ( nPoolCollRegisterStackedStart + nPoolCollRegisterRange)
+ #define nPoolCollHtmlStackedStart ( nPoolCollDocStackedStart + nPoolCollDocRange)
}
static const std::vector<StyleFamilyEntry>* lcl_GetStyleFamilyEntries();
@@ -397,7 +398,7 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc&, OUString*, sal_Int32);
template<>
sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_CHAR>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
{
- constexpr sal_Int32 nBaseCount = nPoolChrHtmlRange + nPoolCollTextRange;
+ const sal_uInt16 nBaseCount = nPoolChrHtmlRange + nPoolCollTextRange;
nIndex -= nBaseCount;
sal_Int32 nCount = 0;
for(auto pFormat : *rDoc.GetCharFormats())
@@ -423,7 +424,7 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_CHAR>(const SwDoc& rDoc, OUString*
template<>
sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PARA>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
{
- constexpr sal_Int32 nBaseCount = nPoolCollHtmlStackedStart + nPoolCollHtmlRange;
+ const sal_uInt16 nBaseCount = nPoolCollHtmlStackedStart + nPoolCollHtmlRange;
nIndex -= nBaseCount;
sal_Int32 nCount = 0;
for(auto pColl : *rDoc.GetTextFormatColls())