summaryrefslogtreecommitdiff
path: root/configmgr/source/pad.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'configmgr/source/pad.cxx')
-rw-r--r--configmgr/source/pad.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx
index b2b639f0dd7c..5bd5c6e5a9f9 100644
--- a/configmgr/source/pad.cxx
+++ b/configmgr/source/pad.cxx
@@ -43,10 +43,7 @@ void Pad::add(char const * begin, sal_Int32 length) {
OSL_ASSERT(
begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
if (length != 0) {
- if (span_.is()) {
- buffer_.append(span_.begin, span_.length);
- span_.clear();
- }
+ flushSpan();
if (buffer_.getLength() == 0) {
span_ = Span(begin, length);
} else {
@@ -55,6 +52,15 @@ void Pad::add(char const * begin, sal_Int32 length) {
}
}
+void Pad::addEphemeral(char const * begin, sal_Int32 length) {
+ OSL_ASSERT(
+ begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
+ if (length != 0) {
+ flushSpan();
+ buffer_.append(begin, length);
+ }
+}
+
void Pad::clear() {
OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
span_.clear();
@@ -77,4 +83,11 @@ Span Pad::get() const {
}
}
+void Pad::flushSpan() {
+ if (span_.is()) {
+ buffer_.append(span_.begin, span_.length);
+ span_.clear();
+ }
+}
+
}