summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoros <os@openoffice.org>2010-11-01 14:16:03 +0100
committeros <os@openoffice.org>2010-11-01 14:16:03 +0100
commit9f7cb00c135c713c2dfaf931b02487f0057320dd (patch)
tree45c8ef64e39d8088a57553e4972f68ee3e511c7d
parentd0e31654bf2d5cbbacce9ed45210dd8881fd3d6a (diff)
#i110287# omit caption separator if caption text is empty
-rw-r--r--sw/source/core/doc/doclay.cxx5
-rw-r--r--sw/source/ui/frmdlg/cption.cxx8
2 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ceb7d6e3463c..cc29cc8406d0 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1474,7 +1474,10 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
aTxt += ' ';
}
xub_StrLen nIdx = aTxt.Len();
- aTxt += rSeparator;
+ if( rTxt.Len() > 0 )
+ {
+ aTxt += rSeparator;
+ }
xub_StrLen nSepIdx = aTxt.Len();
aTxt += rTxt;
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 5e620ce6955c..e92cd4e0ae81 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -382,6 +382,7 @@ IMPL_LINK(SwCaptionDialog, CaptionHdl, PushButton*, EMPTYARG)
void SwCaptionDialog::DrawSample()
{
String aStr;
+ String sCaption = aTextEdit.GetText();
// Nummer
String sFldTypeName = aCategoryBox.GetText();
@@ -436,9 +437,12 @@ void SwCaptionDialog::DrawSample()
}
}
- aStr += aSepEdit.GetText();
+ if( sCaption.Len() > 0 )
+ {
+ aStr += aSepEdit.GetText();
+ }
}
- aStr += aTextEdit.GetText();
+ aStr += sCaption;
// do preview!
aPrevWin.SetPreviewText( aStr );
}