LibreOffice Module sw (master) 1
|
#include <hhcwrp.hxx>
Public Member Functions | |
SwHHCWrapper (SwView *pView, const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nConvOptions, bool bIsInteractive, bool bStart, bool bOther, bool bSelection) | |
virtual | ~SwHHCWrapper () COVERITY_NOEXCEPT_FALSE override |
void | Convert () |
Public Member Functions inherited from editeng::HangulHanjaConversion | |
HangulHanjaConversion (weld::Widget *pUIParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::lang::Locale &_rSourceLocale, const css::lang::Locale &_rTargetLocale, const vcl::Font *_pTargetFont, sal_Int32 nOptions, bool _bIsInteractive) | |
virtual | ~HangulHanjaConversion () COVERITY_NOEXCEPT_FALSE |
void | ConvertDocument () |
weld::Widget * | GetUIParent () const |
LanguageType | GetSourceLanguage () const |
LanguageType | GetTargetLanguage () const |
const vcl::Font * | GetTargetFont () const |
sal_Int32 | GetConversionOptions () const |
bool | IsInteractive () const |
Private Member Functions | |
bool | ConvNext_impl () |
from SvxSpellWrapper copied and modified More... | |
void | FindConvText_impl () |
former FindSpellError More... | |
void | ConvStart_impl (SwConversionArgs *pConvArgs, SvxSpellArea eSpell) |
former SpellStart More... | |
void | ConvEnd_impl (SwConversionArgs const *pConvArgs) |
former SpellEnd More... | |
bool | ConvContinue_impl (SwConversionArgs *pConvArgs) |
former SpellContinue More... | |
void | SelectNewUnit_impl (const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd) |
void | ChangeText (const OUString &rNewText, std::u16string_view aOrigText, const css::uno::Sequence< sal_Int32 > *pOffsets, SwPaM *pCursor) |
void | ChangeText_impl (const OUString &rNewText, bool bKeepAttributes) |
virtual void | GetNextPortion (OUString &rNextPortion, LanguageType &rLangOfPortion, bool bAllowImplicitChangesForNotConvertibleText) override |
virtual void | HandleNewUnit (const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd) override |
virtual void | ReplaceUnit (const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd, const OUString &rOrigText, const OUString &rReplaceWith, const css::uno::Sequence< sal_Int32 > &rOffsets, ReplacementAction eAction, LanguageType *pNewUnitLanguage) override |
virtual bool | HasRubySupport () const override |
Private Attributes | |
SwView * | m_pView |
SwWrtShell & | m_rWrtShell |
std::unique_ptr< SwConversionArgs > | m_pConvArgs |
object for arguments (and results) needed to find of next convertible text portion More... | |
sal_Int32 | m_nLastPos |
starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPosition by replace operations!) More... | |
sal_Int32 | m_nUnitOffset |
sal_uInt16 | m_nPageCount |
page count for progress bar More... | |
sal_uInt16 | m_nPageStart |
first checked page More... | |
bool | m_bIsDrawObj |
bool | m_bIsOtherContent |
bool | m_bStartChk |
bool | m_bIsSelection |
true if only the selected text should be converted More... | |
bool | m_bStartDone |
bool | m_bEndDone |
Additional Inherited Members | |
Public Types inherited from editeng::HangulHanjaConversion | |
enum | ReplacementAction |
enum | ConversionType |
enum | ConversionDirection |
enum | ConversionFormat |
Static Public Member Functions inherited from editeng::HangulHanjaConversion | |
static bool | IsSimplified (LanguageType nLang) |
static bool | IsTraditional (LanguageType nLang) |
static bool | IsChinese (LanguageType nLang) |
static void | SetUseSavedConversionDirectionState (bool bVal) |
static bool | IsUseSavedConversionDirectionState () |
Public Attributes inherited from editeng::HangulHanjaConversion | |
eExchange | |
eReplacementBracketed | |
eOriginalBracketed | |
eReplacementAbove | |
eOriginalAbove | |
eReplacementBelow | |
eOriginalBelow | |
eConvHangulHanja | |
eConvSimplifiedTraditional | |
eHangulToHanja | |
eHanjaToHangul | |
eSimpleConversion | |
eHangulBracketed | |
eHanjaBracketed | |
eRubyHanjaAbove | |
eRubyHanjaBelow | |
eRubyHangulAbove | |
eRubyHangulBelow | |
virtual void | GetNextPortion (OUString &_rNextPortion, LanguageType &_rLangOfPortion, bool _bAllowImplicitChangesForNotConvertibleText)=0 |
virtual void | HandleNewUnit (const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd)=0 |
virtual void | ReplaceUnit (const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd, const OUString &_rOrigText, const OUString &_rReplaceWith, const css::uno::Sequence< sal_Int32 > &_rOffsets, ReplacementAction _eAction, LanguageType *pNewUnitLanguage)=0 |
virtual bool | HasRubySupport () const=0 |
Definition at line 31 of file hhcwrp.hxx.
SwHHCWrapper::SwHHCWrapper | ( | SwView * | pView, |
const css::uno::Reference< css::uno::XComponentContext > & | rxContext, | ||
LanguageType | nSourceLanguage, | ||
LanguageType | nTargetLanguage, | ||
const vcl::Font * | pTargetFont, | ||
sal_Int32 | nConvOptions, | ||
bool | bIsInteractive, | ||
bool | bStart, | ||
bool | bOther, | ||
bool | bSelection | ||
) |
Definition at line 80 of file hhcwrp.cxx.
|
overridevirtual |
! Note: This also effects the default language of text boxes (EditEngine/EditView) !!
Definition at line 110 of file hhcwrp.cxx.
References EndProgress(), vcl::Font::GetCharSet(), editeng::HangulHanjaConversion::GetConversionOptions(), vcl::Window::GetCursor(), SwDocShell::GetDoc(), SwView::GetDocShell(), vcl::Font::GetFamilyName(), vcl::Font::GetFamilyType(), vcl::Font::GetPitch(), editeng::HangulHanjaConversion::GetSourceLanguage(), vcl::Font::GetStyleName(), editeng::HangulHanjaConversion::GetTargetFont(), editeng::HangulHanjaConversion::GetTargetLanguage(), SfxViewShell::GetWindow(), SwView::GetWrtShell(), SwViewShell::HasDrawView(), editeng::HangulHanjaConversion::IsChinese(), editeng::HangulHanjaConversion::IsInteractive(), m_bIsDrawObj, m_nPageCount, m_pConvArgs, m_pView, RES_CHRATR_CJK_FONT(), RES_CHRATR_CJK_LANGUAGE(), SwViewShell::SetCareDialog(), vcl::Window::SetCursor(), SwDoc::SetDefault(), and SdrHHCWrapper::StartTextConversion().
|
private |
! please see also TextConvWrapper::ChangeText with is a modified ! copy of this code
Definition at line 209 of file hhcwrp.cxx.
References SwPosition::Assign(), ChangeText_impl(), SwCursorShell::ClearMark(), SwPosition::GetContentIndex(), SwCursorShell::GetCursor(), SwPaM::GetMark(), SwPosition::GetNode(), SwPaM::GetPoint(), SwNode::GetTextNode(), SwPaM::HasMark(), m_rWrtShell, nIndex, nPos, and SwPaM::Start().
Referenced by ReplaceUnit().
|
private |
Definition at line 311 of file hhcwrp.cxx.
References SwEditShell::Delete(), SwViewShell::GetAttrPool(), SwPosition::GetContentIndex(), SwEditShell::GetCurAttr(), SwCursorShell::GetCursor(), SwPaM::GetMark(), SwPaM::HasMark(), SwWrtShell::Insert(), m_rWrtShell, SwEditShell::ResetAttr(), SwEditShell::SetAttrSet(), SwPosition::SetContent(), and SwPaM::SetMark().
Referenced by ChangeText().
|
private |
former SpellContinue
Definition at line 671 of file hhcwrp.cxx.
References SwConversionArgs::aConvText, SwView::GetWrtShell(), LANGUAGE_NONE, m_bIsDrawObj, m_bIsSelection, m_nPageCount, m_nPageStart, m_pView, SwConversionArgs::nConvTextLang, and SwEditShell::SpellContinue().
Referenced by FindConvText_impl().
|
private |
former SpellEnd
Definition at line 666 of file hhcwrp.cxx.
References m_pView, and SwView::SpellEnd().
Referenced by Convert(), and FindConvText_impl().
void SwHHCWrapper::Convert | ( | ) |
using a PaM here makes sure we will get only text nodes
Definition at line 503 of file hhcwrp.cxx.
References ConvEnd_impl(), editeng::HangulHanjaConversion::ConvertDocument(), ConvStart_impl(), fnMoveBackward, g_pBreakIt, SwBreakIt::GetBreakIter(), SwCursorShell::GetCursor(), SwDocShell::GetDoc(), SwView::GetDocShell(), SwNodes::GetEndOfContent(), SwBreakIt::GetLocale(), SwDoc::GetNodes(), SwPaM::GetPoint(), editeng::HangulHanjaConversion::GetSourceLanguage(), editeng::HangulHanjaConversion::GetTargetFont(), editeng::HangulHanjaConversion::GetTargetLanguage(), SwNode::GetTextNode(), SwView::GetWrtShell(), GoInDoc(), SwPaM::HasMark(), editeng::HangulHanjaConversion::IsChinese(), SwNode::IsTextNode(), m_bIsOtherContent, m_bStartChk, m_pConvArgs, m_pView, SwPaM::Move(), nPos, and SwPaM::StartEnd().
Referenced by SwView::StartTextConversion().
|
private |
from SvxSpellWrapper copied and modified
former SpellNext
modified version of SvxSpellWrapper::SpellNext
Definition at line 595 of file hhcwrp.cxx.
References ConvStart_impl(), SwEditShell::HasOtherCnt(), m_bEndDone, m_bIsOtherContent, m_bIsSelection, m_bStartChk, m_bStartDone, m_pConvArgs, and m_rWrtShell.
Referenced by FindConvText_impl().
|
private |
former SpellStart
Definition at line 660 of file hhcwrp.cxx.
References m_bEndDone, m_bIsDrawObj, m_bStartDone, m_pView, and SwView::SpellStart().
Referenced by Convert(), and ConvNext_impl().
|
private |
former FindSpellError
modified version of SvxSpellWrapper::FindSpellError
Definition at line 636 of file hhcwrp.cxx.
References ConvContinue_impl(), ConvEnd_impl(), ConvNext_impl(), editeng::HangulHanjaConversion::GetUIParent(), and m_pConvArgs.
Referenced by GetNextPortion().
|
overrideprivatevirtual |
Implements editeng::HangulHanjaConversion.
Definition at line 157 of file hhcwrp.cxx.
References FindConvText_impl(), SwPosition::GetContentIndex(), SwCursorShell::GetCursor(), m_nLastPos, m_nUnitOffset, m_pConvArgs, m_rWrtShell, and SwPaM::Start().
|
overrideprivatevirtual |
Implements editeng::HangulHanjaConversion.
Definition at line 192 of file hhcwrp.cxx.
References SwEditShell::EndAllAction(), lcl_ActivateTextShell(), m_rWrtShell, SelectNewUnit_impl(), and SwEditShell::StartAllAction().
|
overrideprivatevirtual |
Implements editeng::HangulHanjaConversion.
Definition at line 498 of file hhcwrp.cxx.
|
overrideprivatevirtual |
! since Delete, Insert in 'ChangeText' do not set the WrtShells ! bInSelect flag ! back to false we do it now manually in order for the selection ! to be done properly in the following call to Left.
Implements editeng::HangulHanjaConversion.
Definition at line 346 of file hhcwrp.cxx.
References SwPosition::AdjustContent(), ChangeText(), Chars, SwCursorShell::ClearMark(), editeng::HangulHanjaConversion::eExchange, SwEditShell::EndAllAction(), SwWrtShell::EndSelect(), SwEditShell::EndUndo(), editeng::HangulHanjaConversion::eOriginalAbove, editeng::HangulHanjaConversion::eOriginalBelow, editeng::HangulHanjaConversion::eOriginalBracketed, editeng::HangulHanjaConversion::eReplacementAbove, editeng::HangulHanjaConversion::eReplacementBelow, editeng::HangulHanjaConversion::eReplacementBracketed, SwViewShell::GetAttrPool(), vcl::Font::GetCharSet(), SwCursorShell::GetCursor(), vcl::Font::GetFamilyName(), vcl::Font::GetFamilyType(), SwPaM::GetMark(), vcl::Font::GetPitch(), SwCursorShell::GetSelText(), editeng::HangulHanjaConversion::GetSourceLanguage(), vcl::Font::GetStyleName(), editeng::HangulHanjaConversion::GetTargetFont(), editeng::HangulHanjaConversion::GetTargetLanguage(), editeng::HangulHanjaConversion::IsChinese(), LANGUAGE_CHINESE_SIMPLIFIED, LANGUAGE_CHINESE_TRADITIONAL, lcl_ActivateTextShell(), SwWrtShell::Left(), m_nUnitOffset, m_rWrtShell, OVERWRITE, RES_CHRATR_CJK_FONT(), RES_CHRATR_CJK_LANGUAGE(), SelectNewUnit_impl(), SwEditShell::SetAttrItem(), SwEditShell::SetAttrSet(), SvxFontItem::SetCharSet(), SvxFontItem::SetFamily(), SvxFontItem::SetFamilyName(), SwCursorShell::SetMark(), SvxFontItem::SetPitch(), SETRUBYATTR, SvxFontItem::SetStyleName(), SwEditShell::StartAllAction(), and SwEditShell::StartUndo().
|
private |
Definition at line 175 of file hhcwrp.cxx.
References Chars, SwPaM::DeleteMark(), SwWrtShell::EndSelect(), SwCursorShell::GetCursor(), SwPaM::GetPoint(), m_nLastPos, m_nUnitOffset, m_rWrtShell, SwWrtShell::Right(), SwPosition::SetContent(), and SwPaM::SetMark().
Referenced by HandleNewUnit(), and ReplaceUnit().
|
private |
Definition at line 52 of file hhcwrp.hxx.
Referenced by ConvNext_impl(), and ConvStart_impl().
|
private |
Definition at line 47 of file hhcwrp.hxx.
Referenced by ConvContinue_impl(), ConvStart_impl(), and ~SwHHCWrapper().
|
private |
Definition at line 48 of file hhcwrp.hxx.
Referenced by Convert(), and ConvNext_impl().
|
private |
true if only the selected text should be converted
Definition at line 50 of file hhcwrp.hxx.
Referenced by ConvContinue_impl(), and ConvNext_impl().
|
private |
Definition at line 49 of file hhcwrp.hxx.
Referenced by Convert(), and ConvNext_impl().
|
private |
Definition at line 51 of file hhcwrp.hxx.
Referenced by ConvNext_impl(), and ConvStart_impl().
|
private |
starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPosition by replace operations!)
Definition at line 39 of file hhcwrp.hxx.
Referenced by GetNextPortion(), and SelectNewUnit_impl().
|
private |
page count for progress bar
Definition at line 44 of file hhcwrp.hxx.
Referenced by ConvContinue_impl(), and ~SwHHCWrapper().
|
private |
|
private |
Definition at line 42 of file hhcwrp.hxx.
Referenced by GetNextPortion(), ReplaceUnit(), and SelectNewUnit_impl().
|
private |
object for arguments (and results) needed to find of next convertible text portion
Definition at line 36 of file hhcwrp.hxx.
Referenced by Convert(), ConvNext_impl(), FindConvText_impl(), GetNextPortion(), and ~SwHHCWrapper().
|
private |
Definition at line 33 of file hhcwrp.hxx.
Referenced by ConvContinue_impl(), ConvEnd_impl(), Convert(), ConvStart_impl(), and ~SwHHCWrapper().
|
private |
Definition at line 34 of file hhcwrp.hxx.
Referenced by ChangeText(), ChangeText_impl(), ConvNext_impl(), GetNextPortion(), HandleNewUnit(), ReplaceUnit(), and SelectNewUnit_impl().