summaryrefslogtreecommitdiff
path: root/sw/inc/ToxTextGenerator.hxx
diff options
context:
space:
mode:
authorTobias Lippert <drtl@fastmail.fm>2014-06-01 14:22:48 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-06 08:08:08 +0000
commit26259e0cca3bc4d8f45337b0cafea2eed8eb32f9 (patch)
treecf10c2e896446d838cb6b493339ca02af9881aa7 /sw/inc/ToxTextGenerator.hxx
parent2ac07bb5bfd9a5d7bc591b9bb39c45cab99f304b (diff)
Unittest generation of page number placeholders in table of contents
Conflicts: sw/inc/ToxTextGenerator.hxx sw/source/core/tox/ToxTextGenerator.cxx Change-Id: I15c963b6e1a8823a1fdafd2c123d18ba3dc9f134 Reviewed-on: https://gerrit.libreoffice.org/9611 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/inc/ToxTextGenerator.hxx')
-rw-r--r--sw/inc/ToxTextGenerator.hxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/inc/ToxTextGenerator.hxx b/sw/inc/ToxTextGenerator.hxx
index 853611491dfe..ba79177aed54 100644
--- a/sw/inc/ToxTextGenerator.hxx
+++ b/sw/inc/ToxTextGenerator.hxx
@@ -23,6 +23,7 @@
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "swdllapi.h"
+
#include <boost/shared_ptr.hpp>
#include <vector>
@@ -35,6 +36,7 @@ class SwPageDesc;
class SwTxtAttr;
class SwTxtNode;
struct SwTOXSortTabBase;
+class ToxTextGeneratorTest;
namespace sw {
@@ -82,6 +84,19 @@ private:
static void
ApplyHandledTextToken(const HandledTextToken& htt, SwTxtNode& targetNode);
+ /** Handle a page number token.
+ *
+ * Will return a string of @p numberOfToxSources concatenated '@' signs, separated by commas, and
+ * finished by a '~'.
+ * (The '@' sign is the magic character C_NUM_REPL, the '~' sign is the magic character C_END_PAGE_NUM.
+ *
+ * @internal
+ * The count of similar entries, i.e., nodes in aTOXSources of SwTOXSortTabBase gives the PagerNumber
+ * pattern.
+ */
+ static OUString
+ ConstructPageNumberPlaceholder(size_t numberOfToxSources);
+
/** Collect the attributes of a hint that shall be copied over to the TOX.
*
* Some text attributes are used in the TOX entries. This method defines which attributes are used.
@@ -91,6 +106,19 @@ private:
*/
static boost::shared_ptr<SfxItemSet>
CollectAttributesForTox(const SwTxtAttr& hint, SwAttrPool& pool);
+
+ /** This method will call GetNumStringOfFirstNode() of the first node in the provided SwTOXSortTabBase.
+ *
+ * The parameters @p bUsePrefix and @p nLevel are passed to SwTxtNode::GetNumString()
+ *
+ * @internal
+ * The method is only called if several preconditions for @p rBase are true. Check the implementation
+ * for details.
+ */
+ static OUString
+ GetNumStringOfFirstNode(const SwTOXSortTabBase& rBase, bool bUsePrefix, sal_uInt8 nLevel);
+
+ friend class ::ToxTextGeneratorTest;
};
}