OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/pdfwindow/PWL_ListBox.h" | 7 #include "fpdfsdk/pdfwindow/PWL_ListBox.h" |
8 | 8 |
9 #include "fpdfsdk/pdfwindow/PWL_Edit.h" | 9 #include "fpdfsdk/pdfwindow/PWL_Edit.h" |
10 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" | 10 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" |
(...skipping 100 matching lines...) Loading... |
111 if (m_pList) { | 111 if (m_pList) { |
112 CFX_FloatRect rcPlate = m_pList->GetPlateRect(); | 112 CFX_FloatRect rcPlate = m_pList->GetPlateRect(); |
113 for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) { | 113 for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) { |
114 CFX_FloatRect rcItem = m_pList->GetItemRect(i); | 114 CFX_FloatRect rcItem = m_pList->GetItemRect(i); |
115 | 115 |
116 if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) | 116 if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) |
117 continue; | 117 continue; |
118 | 118 |
119 CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); | 119 CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); |
120 if (m_pList->IsItemSelected(i)) { | 120 if (m_pList->IsItemSelected(i)) { |
121 sListItems << CPWL_Utils::GetRectFillAppStream( | 121 sListItems << CPWL_Utils::GetRectFillAppStream(rcItem, |
122 rcItem, PWL_DEFAULT_SELBACKCOLOR); | 122 PWL_DEFAULT_SELBACKCOLOR) |
| 123 .AsByteStringC(); |
123 CFX_ByteString sItem = | 124 CFX_ByteString sItem = |
124 CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset); | 125 CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset); |
125 if (sItem.GetLength() > 0) { | 126 if (sItem.GetLength() > 0) { |
126 sListItems << "BT\n" | 127 sListItems << "BT\n" |
127 << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELTEXTCOLOR) | 128 << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELTEXTCOLOR) |
128 << sItem << "ET\n"; | 129 .AsByteStringC() |
| 130 << sItem.AsByteStringC() << "ET\n"; |
129 } | 131 } |
130 } else { | 132 } else { |
131 CFX_ByteString sItem = | 133 CFX_ByteString sItem = |
132 CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset); | 134 CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset); |
133 if (sItem.GetLength() > 0) { | 135 if (sItem.GetLength() > 0) { |
134 sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) | 136 sListItems << "BT\n" |
135 << sItem << "ET\n"; | 137 << CPWL_Utils::GetColorAppStream(GetTextColor()) |
| 138 .AsByteStringC() |
| 139 << sItem.AsByteStringC() << "ET\n"; |
136 } | 140 } |
137 } | 141 } |
138 } | 142 } |
139 } | 143 } |
140 | 144 |
141 if (sListItems.GetLength() > 0) { | 145 if (sListItems.GetLength() > 0) { |
142 CFX_ByteTextBuf sClip; | 146 CFX_ByteTextBuf sClip; |
143 CFX_FloatRect rcClient = GetClientRect(); | 147 CFX_FloatRect rcClient = GetClientRect(); |
144 | 148 |
145 sClip << "q\n"; | 149 sClip << "q\n"; |
(...skipping 378 matching lines...) Loading... |
524 if (zDelta < 0) { | 528 if (zDelta < 0) { |
525 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); | 529 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); |
526 } else { | 530 } else { |
527 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); | 531 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); |
528 } | 532 } |
529 | 533 |
530 FX_BOOL bExit = FALSE; | 534 FX_BOOL bExit = FALSE; |
531 OnNotifySelChanged(FALSE, bExit, nFlag); | 535 OnNotifySelChanged(FALSE, bExit, nFlag); |
532 return TRUE; | 536 return TRUE; |
533 } | 537 } |
OLD | NEW |