Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1091)

Unified Diff: fpdfsdk/fxedit/fxet_edit.cpp

Issue 2146503002: Remove RichText support from fpdfsdk/fxedit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/fxedit/fxet_pageobjs.cpp » ('j') | fpdfsdk/fxedit/include/fx_edit.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fxedit/fxet_edit.cpp
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 1a3289b26d30b7324f2820a2bbc1f670858c32d8..c39812c13c62f41d76cf9b7a60db8ef11e669e6d 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -788,7 +788,6 @@ CFX_Edit::CFX_Edit(CPDF_VariableText* pVT)
m_bEnableRefresh(TRUE),
m_rcOldContent(0.0f, 0.0f, 0.0f, 0.0f),
m_bEnableUndo(TRUE),
- m_bNotify(TRUE),
m_bOprNotify(FALSE),
m_pGroupUndoItem(nullptr) {
ASSERT(pVT);
@@ -1100,125 +1099,6 @@ void CFX_Edit::SetRichText(FX_BOOL bRichText, FX_BOOL bPaint) {
Paint();
}
-FX_BOOL CFX_Edit::SetRichFontIndex(int32_t nFontIndex) {
- CPVT_WordProps WordProps;
- WordProps.nFontIndex = nFontIndex;
- return SetRichTextProps(EP_FONTINDEX, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize) {
- CPVT_WordProps WordProps;
- WordProps.fFontSize = fFontSize;
- return SetRichTextProps(EP_FONTSIZE, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor) {
- CPVT_WordProps WordProps;
- WordProps.dwWordColor = dwColor;
- return SetRichTextProps(EP_WORDCOLOR, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextScript(CPDF_VariableText::ScriptType nScriptType) {
- CPVT_WordProps WordProps;
- WordProps.nScriptType = nScriptType;
- return SetRichTextProps(EP_SCRIPTTYPE, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold) {
- CPVT_WordProps WordProps;
- if (bBold)
- WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- return SetRichTextProps(EP_BOLD, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic) {
- CPVT_WordProps WordProps;
- if (bItalic)
- WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- return SetRichTextProps(EP_ITALIC, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline) {
- CPVT_WordProps WordProps;
- if (bUnderline)
- WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- return SetRichTextProps(EP_UNDERLINE, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout) {
- CPVT_WordProps WordProps;
- if (bCrossout)
- WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- return SetRichTextProps(EP_CROSSOUT, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace) {
- CPVT_WordProps WordProps;
- WordProps.fCharSpace = fCharSpace;
- return SetRichTextProps(EP_CHARSPACE, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale) {
- CPVT_WordProps WordProps;
- WordProps.nHorzScale = nHorzScale;
- return SetRichTextProps(EP_HORZSCALE, nullptr, &WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading) {
- CPVT_SecProps SecProps;
- SecProps.fLineLeading = fLineLeading;
- return SetRichTextProps(EP_LINELEADING, &SecProps, nullptr);
-}
-
-FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent) {
- CPVT_SecProps SecProps;
- SecProps.fLineIndent = fLineIndent;
- return SetRichTextProps(EP_LINEINDENT, &SecProps, nullptr);
-}
-
-FX_BOOL CFX_Edit::SetRichTextAlignment(int32_t nAlignment) {
- CPVT_SecProps SecProps;
- SecProps.nAlignment = nAlignment;
- return SetRichTextProps(EP_ALIGNMENT, &SecProps, nullptr);
-}
-
-FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps,
- const CPVT_SecProps* pSecProps,
- const CPVT_WordProps* pWordProps) {
- if (!m_pVT->IsValid() || !m_pVT->IsRichText())
- return FALSE;
-
- CPDF_VariableText::Iterator* pIterator = m_pVT->GetIterator();
- CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange();
-
- m_pVT->UpdateWordPlace(wrTemp.BeginPos);
- m_pVT->UpdateWordPlace(wrTemp.EndPos);
- pIterator->SetAt(wrTemp.BeginPos);
-
- BeginGroupUndo(L"");
- FX_BOOL bSet =
- SetSecProps(eProps, wrTemp.BeginPos, pSecProps, pWordProps, wrTemp, TRUE);
-
- while (pIterator->NextWord()) {
- CPVT_WordPlace place = pIterator->GetAt();
- if (place.WordCmp(wrTemp.EndPos) > 0)
- break;
- FX_BOOL bSet1 =
- SetSecProps(eProps, place, pSecProps, pWordProps, wrTemp, TRUE);
- FX_BOOL bSet2 = SetWordProps(eProps, place, pWordProps, wrTemp, TRUE);
-
- if (!bSet)
- bSet = (bSet1 || bSet2);
- }
-
- EndGroupUndo();
-
- if (bSet)
- PaintSetProps(eProps, wrTemp);
-
- return bSet;
-}
-
void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange& wr) {
switch (eProps) {
case EP_LINELEADING:
@@ -1694,7 +1574,7 @@ void CFX_Edit::RearrangePart(const CPVT_WordRange& range) {
}
void CFX_Edit::SetContentChanged() {
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
CFX_FloatRect rcContent = m_pVT->GetContentRect();
if (rcContent.Width() != m_rcOldContent.Width() ||
rcContent.Height() != m_rcOldContent.Height()) {
@@ -1797,7 +1677,7 @@ CFX_FloatRect CFX_Edit::EditToVT(const CFX_FloatRect& rect) const {
}
void CFX_Edit::SetScrollInfo() {
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
CFX_FloatRect rcContent = m_pVT->GetContentRect();
@@ -1824,7 +1704,7 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx) {
m_ptScrollPos.x = fx;
Refresh(RP_NOANALYSE);
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosX(fx);
@@ -1844,7 +1724,7 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy) {
m_ptScrollPos.y = fy;
Refresh(RP_NOANALYSE);
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosY(fy);
@@ -1959,7 +1839,7 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,
m_Refresh.NoAnalyse();
m_ptRefreshScrollPos = m_ptScrollPos;
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = TRUE;
if (const CFX_Edit_RectArray* pRects = m_Refresh.GetRefreshRects()) {
@@ -2073,7 +1953,7 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) {
wordinfo.ptWord.x + wordinfo.fWidth,
lineinfo.ptLine.y + lineinfo.fLineAscent);
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = TRUE;
CFX_FloatRect rcRefresh = VTToEdit(rcWord);
@@ -2087,7 +1967,7 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) {
lineinfo.ptLine.x + lineinfo.fLineWidth,
lineinfo.ptLine.y + lineinfo.fLineAscent);
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
m_bNotifyFlag = TRUE;
CFX_FloatRect rcRefresh = VTToEdit(rcLine);
@@ -2107,7 +1987,7 @@ void CFX_Edit::SetCaret(const CPVT_WordPlace& place) {
}
void CFX_Edit::SetCaretInfo() {
- if (m_bNotify && m_pNotify) {
+ if (m_pNotify) {
if (!m_bNotifyFlag) {
CFX_FloatPoint ptHead(0.0f, 0.0f), ptFoot(0.0f, 0.0f);
@@ -2141,7 +2021,7 @@ void CFX_Edit::SetCaretChange() {
if (m_wpCaret == m_wpOldCaret)
return;
- if (!m_bNotify || !m_pVT->IsRichText() || !m_pNotify)
+ if (!m_pVT->IsRichText() || !m_pNotify)
return;
CPVT_SecProps SecProps;
@@ -2898,10 +2778,6 @@ void CFX_Edit::EnableUndo(FX_BOOL bUndo) {
m_bEnableUndo = bUndo;
}
-void CFX_Edit::EnableNotify(FX_BOOL bNotify) {
- m_bNotify = bNotify;
-}
-
void CFX_Edit::EnableOprNotify(FX_BOOL bNotify) {
m_bOprNotify = bNotify;
}
« no previous file with comments | « no previous file | fpdfsdk/fxedit/fxet_pageobjs.cpp » ('j') | fpdfsdk/fxedit/include/fx_edit.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698