summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-10-30 09:41:06 +0000
committerOliver Specht <os@openoffice.org>2002-10-30 09:41:06 +0000
commit4c22da9b8685c321a3dd1bd6962135129ceaa099 (patch)
treec094bca8a55f77950c24c2b1fd4c9a1e1e3cd89c /sw
parent18960b061f01c0d0e21685023a4f8da02857be7d (diff)
#98749# enable 'no brackets' in bibliography fields
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/fields/authfld.cxx33
-rw-r--r--sw/source/core/tox/txmsrt.cxx13
-rw-r--r--sw/source/ui/index/cnttab.cxx23
-rw-r--r--sw/source/ui/index/cnttab.hrc5
-rw-r--r--sw/source/ui/index/cnttab.src11
-rw-r--r--sw/source/ui/index/toxmgr.cxx36
6 files changed, 75 insertions, 46 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 232382682ebb..017583b06693 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: authfld.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: fme $ $Date: 2002-06-26 09:30:31 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:38:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -600,7 +600,10 @@ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, BYTE nMId ) const
case FIELD_PROP_PAR1:
case FIELD_PROP_PAR2:
{
- OUString sVal( FIELD_PROP_PAR1 == nMId ? m_cPrefix : m_cSuffix);
+ OUString sVal;
+ sal_Unicode uRet = FIELD_PROP_PAR1 == nMId ? m_cPrefix : m_cSuffix;
+ if(uRet)
+ sVal = OUString(uRet);
rVal <<= sVal;
}
break;
@@ -656,14 +659,15 @@ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, BYTE nMId )
{
case FIELD_PROP_PAR1:
case FIELD_PROP_PAR2:
- if( ::GetString( rAny, sTmp ).Len() )
- {
- if( FIELD_PROP_PAR1 == nMId )
- m_cPrefix = sTmp.GetChar(0);
- else
- m_cSuffix = sTmp.GetChar(0);
- }
- break;
+ {
+ ::GetString( rAny, sTmp );
+ sal_Unicode uSet = sTmp.GetChar(0);
+ if( FIELD_PROP_PAR1 == nMId )
+ m_cPrefix = uSet;
+ else
+ m_cSuffix = uSet;
+ }
+ break;
case FIELD_PROP_PAR3:
SetSortAlgorithm( ::GetString( rAny, sTmp ));
break;
@@ -790,7 +794,9 @@ SwAuthorityField::~SwAuthorityField()
String SwAuthorityField::Expand() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
- String sRet(pAuthType->GetPrefix());
+ String sRet;
+ if(pAuthType->GetPrefix())
+ sRet.Assign(pAuthType->GetPrefix());
if( pAuthType->IsSequence() )
{
@@ -803,7 +809,8 @@ String SwAuthorityField::Expand() const
if(pEntry)
sRet += pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER);
}
- sRet += pAuthType->GetSuffix();
+ if(pAuthType->GetSuffix())
+ sRet += pAuthType->GetSuffix();
return sRet;
}
/*-- 14.09.99 16:21:00---------------------------------------------------
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index f11917a4b672..27f7206c2c6e 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txmsrt.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: fme $ $Date: 2002-08-23 08:14:14 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:38:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -931,8 +931,13 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd,
if(AUTH_FIELD_IDENTIFIER == nAuthField)
{
sText = pField->Expand();
- sText.Erase(0, 1);
- sText.Erase(sText.Len() - 1, 1);
+ const SwAuthorityFieldType* pType = (const SwAuthorityFieldType*)pField->GetTyp();
+ sal_Unicode cChar = pType->GetPrefix();
+ if(cChar && cChar != ' ')
+ sText.Erase(0, 1);
+ cChar = pType->GetSuffix();
+ if(cChar && cChar != ' ')
+ sText.Erase(sText.Len() - 1, 1);
}
else if(AUTH_FIELD_AUTHORITY_TYPE == nAuthField)
{
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index fcfbe507de67..1ba409e00b80 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cnttab.cxx,v $
*
- * $Revision: 1.48 $
+ * $Revision: 1.49 $
*
- * last change: $Author: os $ $Date: 2002-10-25 10:06:11 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:41:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -460,8 +460,11 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
rSh.GetFldType(RES_AUTHORITY, aEmptyStr);
if(pFType)
{
- String sBrackets(pFType->GetPrefix());
- sBrackets += pFType->GetSuffix();
+ String sBrackets;
+ if(pFType->GetPrefix())
+ sBrackets += pFType->GetPrefix();
+ if(pFType->GetSuffix())
+ sBrackets += pFType->GetSuffix();
pDescArr[nArrayIndex]->SetAuthBrackets(sBrackets);
pDescArr[nArrayIndex]->SetAuthSequence(pFType->IsSequence());
}
@@ -1101,6 +1104,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
bFirstCall(sal_True),
pIndexRes(0)
{
+ aBracketLB.InsertEntry(String(ResId(ST_NO_BRACKET)), 0);
FreeResource();
pIndexEntryWrapper = new IndexEntrySupplierWrapper();
@@ -1349,7 +1353,11 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
}
else if(TOX_AUTHORITIES == aCurType.eType)
{
- aBracketLB.SelectEntry(rDesc.GetAuthBrackets());
+ String sBrackets(rDesc.GetAuthBrackets());
+ if(!sBrackets.Len() || sBrackets.EqualsAscii(" "))
+ aBracketLB.SelectEntryPos(0);
+ else
+ aBracketLB.SelectEntry(sBrackets);
aSequenceCB.Check(rDesc.IsAuthSequence());
}
aAutoMarkPB.Enable(aFromFileCB.IsChecked());
@@ -1449,7 +1457,10 @@ void SwTOXSelectTabPage::FillTOXDescription()
break;
case TOX_AUTHORITIES:
{
- rDesc.SetAuthBrackets(aBracketLB.GetSelectEntry());
+ if(aBracketLB.GetSelectEntryPos())
+ rDesc.SetAuthBrackets(aBracketLB.GetSelectEntry());
+ else
+ rDesc.SetAuthBrackets(aEmptyStr);
rDesc.SetAuthSequence(aSequenceCB.IsChecked());
}
break;
diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc
index a83c478c123d..2cd82cb257d5 100644
--- a/sw/source/ui/index/cnttab.hrc
+++ b/sw/source/ui/index/cnttab.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: cnttab.hrc,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2002-08-06 12:40:33 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -258,6 +258,7 @@
#define LB_SORTALG 148
#define IMG_SORTUP_HC 149
#define IMG_SORTDOWN_HC 150
+#define ST_NO_BRACKET 151
#define TO_CONTENT 1
#define TO_INDEX 2
#define TO_ILLUSTRATION 4
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index c16c12176482..7098389fbc1a 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -2,9 +2,9 @@
*
* $RCSfile: cnttab.src,v $
*
- * $Revision: 1.58 $
+ * $Revision: 1.59 $
*
- * last change: $Author: os $ $Date: 2002-09-06 13:48:54 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2256,7 +2256,7 @@ TabPage TP_TOX_SELECT
ListBox LB_BRACKET
{
Pos = MAP_APPFONT ( 75, 84) ;
- Size = MAP_APPFONT ( 20, 50 ) ;
+ Size = MAP_APPFONT ( 40, 50 ) ;
Border = TRUE;
DropDown = TRUE;
StringList =
@@ -2267,6 +2267,11 @@ TabPage TP_TOX_SELECT
< "<>" ;> ;
};
};
+ String ST_NO_BRACKET
+ {
+ Text = "[keine]" ;
+ Text [ ENGLISH ] = "[none]" ;
+ };
FixedLine FL_AUTHORITY
{
Pos = MAP_APPFONT ( 6 , 59) ;
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 50bd488211d4..2d5a53dca3c6 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: toxmgr.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: iha $ $Date: 2002-08-08 13:13:02 $
+ * last change: $Author: os $ $Date: 2002-10-30 10:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -441,22 +441,22 @@ BOOL SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
{
SwAuthorityFieldType* pFType = (SwAuthorityFieldType*)
pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
- if(pFType)
- {
- pFType->SetPreSuffix(rDesc.GetAuthBrackets().GetChar(0),
- rDesc.GetAuthBrackets().GetChar(1));
- pFType->SetSequence(rDesc.IsAuthSequence());
- SwTOXSortKey rArr[3];
- rArr[0] = rDesc.GetSortKey1();
- rArr[1] = rDesc.GetSortKey2();
- rArr[2] = rDesc.GetSortKey3();
- pFType->SetSortKeys(3, rArr);
- pFType->SetSortByDocument(rDesc.IsSortByDocument());
- pFType->SetLanguage(rDesc.GetLanguage());
- pFType->SetSortAlgorithm(rDesc.GetSortAlgorithm());
-
- pFType->UpdateFlds();
- }
+ if(!pFType)
+ pFType = (SwAuthorityFieldType*)pSh->InsertFldType(
+ SwAuthorityFieldType(pSh->GetDoc()));
+ pFType->SetPreSuffix(rDesc.GetAuthBrackets().GetChar(0),
+ rDesc.GetAuthBrackets().GetChar(1));
+ pFType->SetSequence(rDesc.IsAuthSequence());
+ SwTOXSortKey rArr[3];
+ rArr[0] = rDesc.GetSortKey1();
+ rArr[1] = rDesc.GetSortKey2();
+ rArr[2] = rDesc.GetSortKey3();
+ pFType->SetSortKeys(3, rArr);
+ pFType->SetSortByDocument(rDesc.IsSortByDocument());
+ pFType->SetLanguage(rDesc.GetLanguage());
+ pFType->SetSortAlgorithm(rDesc.GetSortAlgorithm());
+
+ pFType->UpdateFlds();
}
// TODO: consider properties of the current TOXType
if(!pCurTOX || (ppBase && !(*ppBase)))