summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-09 10:43:28 +0000
committerMichael Stahl <mstahl@redhat.com>2015-02-09 16:34:38 +0000
commitd7947489a5d624adab6add560429235e357ac92d (patch)
tree2cec8e8e69681634f1d77eca2d27e91a733c9f06
parent5b48d5e25c8e7918f4669195144afb1fae049d41 (diff)
Resolves: tdf#88933 Labeling of images impossible without category
(cherry picked from commit 1fac71668ac8a32633a7ee31698c0f4fe78e4d31) Change-Id: I8b618d5cd6b3e9d5e42e04e215592a7b748dbb9f Reviewed-on: https://gerrit.libreoffice.org/14383 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/ui/frmdlg/cption.cxx7
-rw-r--r--sw/source/uibase/inc/cption.hxx8
2 files changed, 11 insertions, 4 deletions
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 93424cf6fcc7..dbd3543e0f58 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -85,7 +85,7 @@ OUString SwCaptionDialog::our_aSepTextSave(": "); // Caption separator text
//Resolves: fdo#47427 disallow typing *or* pasting content into the category box
OUString TextFilterAutoConvert::filter(const OUString &rText)
{
- if (!SwCalc::IsValidVarName(rText))
+ if (rText != m_sNone && !SwCalc::IsValidVarName(rText))
return m_sLastGoodText;
m_sLastGoodText = rText;
return rText;
@@ -94,6 +94,7 @@ OUString TextFilterAutoConvert::filter(const OUString &rText)
SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
SvxStandardDialog( pParent, "InsertCaptionDialog", "modules/swriter/ui/insertcaption.ui" ),
m_sNone( SW_RESSTR(SW_STR_NONE) ),
+ m_aTextFilter(m_sNone),
rView( rV ),
pMgr( new SwFldMgr(rView.GetWrtShellPtr()) ),
bCopyAttributes( false ),
@@ -283,7 +284,7 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
{
OUString sFldTypeName = m_pCategoryBox->GetText();
if(sFldTypeName == m_sNone)
- sFldTypeName.clear();
+ sFldTypeName = OUString();
SwSequenceOptionDialog aDlg( pButton, rView, sFldTypeName );
aDlg.SetApplyBorderAndShadow(bCopyAttributes);
aDlg.SetCharacterStyle( sCharacterStyle );
@@ -319,6 +320,8 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl)
SwFieldType* pType = (bCorrectFldName && !bNone)
? rSh.GetFldType( RES_SETEXPFLD, sFldTypeName )
: 0;
+ fprintf(stderr, "pType is %p\n", pType);
+ fprintf(stderr, "bCorrectFldName is %d\n", bCorrectFldName);
m_pOKButton->Enable( bCorrectFldName &&
(!pType ||
((SwSetExpFieldType*)pType)->GetType() == nsSwGetSetExpType::GSE_SEQ) );
diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx
index 08f31a4f2649..98ed59d65c0d 100644
--- a/sw/source/uibase/inc/cption.hxx
+++ b/sw/source/uibase/inc/cption.hxx
@@ -52,7 +52,12 @@ class TextFilterAutoConvert : public TextFilter
{
private:
OUString m_sLastGoodText;
+ OUString m_sNone;
public:
+ TextFilterAutoConvert(const OUString &rNone)
+ : m_sNone(rNone)
+ {
+ }
virtual OUString filter(const OUString &rText) SAL_OVERRIDE;
};
@@ -60,6 +65,7 @@ class SwCaptionDialog : public SvxStandardDialog
{
Edit* m_pTextEdit;
ComboBox* m_pCategoryBox;
+ OUString m_sNone;
TextFilterAutoConvert m_aTextFilter;
FixedText* m_pFormatText;
ListBox* m_pFormatBox;
@@ -76,8 +82,6 @@ class SwCaptionDialog : public SvxStandardDialog
SwCaptionPreview* m_pPreview;
- OUString m_sNone;
-
SwView &rView; // search per active, avoid View
SwFldMgr *pMgr; // pointer to save the include
SelectionType eType;