Kaydet (Commit) e6ad7c39 authored tarafından Matteo Casalin's avatar Matteo Casalin

Do not attempt to copy beyond end of OUString

m_pDropCapsField case could probably be simplified, but I don't
have enough background and prefer to stay on the safe side.

Change-Id: I88a604a2a984c7a5c96741164f1903b14d585005
üst 6ea18bab
...@@ -702,7 +702,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) ...@@ -702,7 +702,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
if (!sEdit.isEmpty() && !sPreview.startsWith(sEdit)) if (!sEdit.isEmpty() && !sPreview.startsWith(sEdit))
{ {
sPreview = sEdit.copy(0, sPreview.getLength()); sPreview = sEdit.copy(0, std::min(sEdit.getLength(), sPreview.getLength()));
bSetText = false; bSetText = false;
} }
...@@ -781,7 +781,10 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) ...@@ -781,7 +781,10 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
OUString sText(m_pTextEdit->GetText()); OUString sText(m_pTextEdit->GetText());
if (!m_pWholeWordCB->IsChecked()) if (!m_pWholeWordCB->IsChecked())
sText = sText.copy( 0, m_pDropCapsField->GetValue()); {
sText = sText.copy( 0, std::max<sal_Int32>(
sText.getLength(), m_pDropCapsField->GetValue()) );
}
SfxStringItem aStr(FN_PARAM_1, sText); SfxStringItem aStr(FN_PARAM_1, sText);
rSet.Put( aStr ); rSet.Put( aStr );
......
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