| 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 "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
| 8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
| 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" |
| 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); | 178 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); |
| 179 if (IPVT_FontMap* pFontMap = pEdit->GetFontMap()) { | 179 if (IPVT_FontMap* pFontMap = pEdit->GetFontMap()) { |
| 180 if (pRange) | 180 if (pRange) |
| 181 pIterator->SetAt(pRange->BeginPos); | 181 pIterator->SetAt(pRange->BeginPos); |
| 182 else | 182 else |
| 183 pIterator->SetAt(0); | 183 pIterator->SetAt(0); |
| 184 | 184 |
| 185 CPVT_WordPlace oldplace; | 185 CPVT_WordPlace oldplace; |
| 186 | |
| 187 while (pIterator->NextWord()) { | 186 while (pIterator->NextWord()) { |
| 188 CPVT_WordPlace place = pIterator->GetAt(); | 187 CPVT_WordPlace place = pIterator->GetAt(); |
| 189 if (pRange && place.WordCmp(pRange->EndPos) > 0) | 188 if (pRange && place.WordCmp(pRange->EndPos) > 0) |
| 190 break; | 189 break; |
| 191 | 190 |
| 192 if (wrSelect.IsExist()) { | 191 if (wrSelect.IsExist()) { |
| 193 bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && | 192 bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && |
| 194 place.WordCmp(wrSelect.EndPos) <= 0; | 193 place.WordCmp(wrSelect.EndPos) <= 0; |
| 195 if (bSelect) { | 194 crCurFill = bSelect ? crWhite : crTextFill; |
| 196 crCurFill = crWhite; | |
| 197 } else { | |
| 198 crCurFill = crTextFill; | |
| 199 } | |
| 200 } | 195 } |
| 201 if (pSystemHandler && pSystemHandler->IsSelectionImplemented()) { | 196 if (pSystemHandler && pSystemHandler->IsSelectionImplemented()) { |
| 202 crCurFill = crTextFill; | 197 crCurFill = crTextFill; |
| 203 crOldFill = crCurFill; | 198 crOldFill = crCurFill; |
| 204 } | 199 } |
| 205 CPVT_Word word; | 200 CPVT_Word word; |
| 206 if (pIterator->GetWord(word)) { | 201 if (pIterator->GetWord(word)) { |
| 207 if (bSelect) { | 202 if (bSelect) { |
| 208 CPVT_Line line; | 203 CPVT_Line line; |
| 209 pIterator->GetLine(line); | 204 pIterator->GetLine(line); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 CFX_FloatRect rcUnderline = GetUnderLineRect(word); | 623 CFX_FloatRect rcUnderline = GetUnderLineRect(word); |
| 629 rcUnderline.left += ptOffset.x; | 624 rcUnderline.left += ptOffset.x; |
| 630 rcUnderline.right += ptOffset.x; | 625 rcUnderline.right += ptOffset.x; |
| 631 rcUnderline.top += ptOffset.y; | 626 rcUnderline.top += ptOffset.y; |
| 632 rcUnderline.bottom += ptOffset.y; | 627 rcUnderline.bottom += ptOffset.y; |
| 633 AddRectToPageObjects(pObjectHolder, color, rcUnderline); | 628 AddRectToPageObjects(pObjectHolder, color, rcUnderline); |
| 634 } | 629 } |
| 635 } | 630 } |
| 636 } | 631 } |
| 637 } | 632 } |
| OLD | NEW |