summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_wnd.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-29 11:18:49 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-29 15:40:59 +0000
commitf1eae2c37cb4bbf7a536cf251706147bbac51880 (patch)
tree8eead543163dddefc63a518d9d44b5ca1ee49875 /fpdfsdk/pdfwindow/cpwl_wnd.cpp
parenta0b48aa8043be95e5c6b602e0e261fb163282536 (diff)
downloadpdfium-f1eae2c37cb4bbf7a536cf251706147bbac51880.tar.xz
Converted low-hanging cpwl classes in CFX_ByteTextBuf to ostringstream.
Bug: pdfium:731 Change-Id: I3faf5a4ec4b2af6145348e526f39ccbc2055e62e Reviewed-on: https://pdfium-review.googlesource.com/7050 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_wnd.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_wnd.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_wnd.cpp b/fpdfsdk/pdfwindow/cpwl_wnd.cpp
index d44b219110..a8b5c31254 100644
--- a/fpdfsdk/pdfwindow/cpwl_wnd.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_wnd.cpp
@@ -7,6 +7,7 @@
#include "fpdfsdk/pdfwindow/cpwl_wnd.h"
#include <map>
+#include <sstream>
#include <vector>
#include "fpdfsdk/pdfwindow/cpwl_scroll_bar.h"
@@ -232,39 +233,36 @@ void CPWL_Wnd::InvalidateRectMove(const CFX_FloatRect& rcOld,
InvalidateRect(&rcUnion);
}
-void CPWL_Wnd::GetAppearanceStream(CFX_ByteTextBuf& sAppStream) {
+void CPWL_Wnd::GetAppearanceStream(std::ostringstream* psAppStream) {
if (IsValid() && IsVisible()) {
- GetThisAppearanceStream(sAppStream);
- GetChildAppearanceStream(sAppStream);
+ GetThisAppearanceStream(psAppStream);
+ GetChildAppearanceStream(psAppStream);
}
}
// if don't set,Get default apperance stream
-void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
+void CPWL_Wnd::GetThisAppearanceStream(std::ostringstream* psAppStream) {
CFX_FloatRect rectWnd = GetWindowRect();
if (rectWnd.IsEmpty())
return;
- CFX_ByteTextBuf sThis;
-
if (HasFlag(PWS_BACKGROUND))
- sThis << CPWL_Utils::GetRectFillAppStream(rectWnd, GetBackgroundColor());
+ *psAppStream << CPWL_Utils::GetRectFillAppStream(rectWnd,
+ GetBackgroundColor());
if (HasFlag(PWS_BORDER)) {
- sThis << CPWL_Utils::GetBorderAppStream(
+ *psAppStream << CPWL_Utils::GetBorderAppStream(
rectWnd, (float)GetBorderWidth(), GetBorderColor(),
GetBorderLeftTopColor(GetBorderStyle()),
GetBorderRightBottomColor(GetBorderStyle()), GetBorderStyle(),
GetBorderDash());
}
-
- sAppStream << sThis;
}
-void CPWL_Wnd::GetChildAppearanceStream(CFX_ByteTextBuf& sAppStream) {
+void CPWL_Wnd::GetChildAppearanceStream(std::ostringstream* psAppStream) {
for (CPWL_Wnd* pChild : m_Children) {
if (pChild)
- pChild->GetAppearanceStream(sAppStream);
+ pChild->GetAppearanceStream(psAppStream);
}
}