Kaydet (Commit) 7080d629 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#37044 two different TransliterationChgData structs

There are two structs called TransliterationChgData with different
layout. The crashes on MacOSX must be due to this. Rename them
so they've different names.

Change-Id: I887a33bed26b339e229b7fb1ef8dddd192f6fae3
üst c1324a51
...@@ -2673,16 +2673,17 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW ...@@ -2673,16 +2673,17 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW
Help::ShowQuickHelp( pActiveView->GetWindow(), Rectangle(), String(), 0 ); Help::ShowQuickHelp( pActiveView->GetWindow(), Rectangle(), String(), 0 );
} }
namespace
struct TransliterationChgData
{ {
struct eeTransliterationChgData
{
sal_uInt16 nStart; sal_uInt16 nStart;
xub_StrLen nLen; xub_StrLen nLen;
EditSelection aSelection; EditSelection aSelection;
String aNewText; String aNewText;
uno::Sequence< sal_Int32 > aOffsets; uno::Sequence< sal_Int32 > aOffsets;
}; };
}
EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ) EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode )
{ {
...@@ -2736,8 +2737,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2736,8 +2737,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
//! This way the offsets for the yet to be changed words will be //! This way the offsets for the yet to be changed words will be
//! left unchanged by the already replaced text. //! left unchanged by the already replaced text.
//! For this we temporarily save the changes to be done in this vector //! For this we temporarily save the changes to be done in this vector
std::vector< TransliterationChgData > aChanges; std::vector< eeTransliterationChgData > aChanges;
TransliterationChgData aChgData; eeTransliterationChgData aChgData;
if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE) if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE)
{ {
...@@ -2960,7 +2961,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2960,7 +2961,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
// yet unchanged text parts remain the same. // yet unchanged text parts remain the same.
for (size_t i = 0; i < aChanges.size(); ++i) for (size_t i = 0; i < aChanges.size(); ++i)
{ {
TransliterationChgData& rData = aChanges[ aChanges.size() - 1 - i ]; eeTransliterationChgData& rData = aChanges[ aChanges.size() - 1 - i ];
bChanges = sal_True; bChanges = sal_True;
if (rData.nLen != rData.aNewText.Len()) if (rData.nLen != rData.aNewText.Len())
......
...@@ -1543,13 +1543,16 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf ) ...@@ -1543,13 +1543,16 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
return sal_False; return sal_False;
} }
struct TransliterationChgData namespace
{ {
struct swTransliterationChgData
{
xub_StrLen nStart; xub_StrLen nStart;
xub_StrLen nLen; xub_StrLen nLen;
String sChanged; String sChanged;
Sequence< sal_Int32 > aOffsets; Sequence< sal_Int32 > aOffsets;
}; };
}
// change text to Upper/Lower/Hiragana/Katagana/... // change text to Upper/Lower/Hiragana/Katagana/...
void SwTxtNode::TransliterateText( void SwTxtNode::TransliterateText(
...@@ -1572,8 +1575,8 @@ void SwTxtNode::TransliterateText( ...@@ -1572,8 +1575,8 @@ void SwTxtNode::TransliterateText(
//! This way the offsets for the yet to be changed words will be //! This way the offsets for the yet to be changed words will be
//! left unchanged by the already replaced text. //! left unchanged by the already replaced text.
//! For this we temporarily save the changes to be done in this vector //! For this we temporarily save the changes to be done in this vector
std::vector< TransliterationChgData > aChanges; std::vector< swTransliterationChgData > aChanges;
TransliterationChgData aChgData; swTransliterationChgData aChgData;
if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE) if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE)
{ {
...@@ -1771,7 +1774,7 @@ void SwTxtNode::TransliterateText( ...@@ -1771,7 +1774,7 @@ void SwTxtNode::TransliterateText(
// yet unchanged text parts remain the same. // yet unchanged text parts remain the same.
for (size_t i = 0; i < aChanges.size(); ++i) for (size_t i = 0; i < aChanges.size(); ++i)
{ {
TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; swTransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
if (pUndo) if (pUndo)
pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets ); pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets );
ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets ); ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment