summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2001-03-09 17:10:20 +0000
committerMalte Timmermann <mt@openoffice.org>2001-03-09 17:10:20 +0000
commit55c86a92f51518248c8b544034885bd1f8320a4f (patch)
tree03011605a816736dfeec6ebbb54d9c4c4bc52d68
parentc4899f5b7cfa67616d4f41b708d7f7920d67ff60 (diff)
Interface for ForbiddenCharacters
-rw-r--r--svx/inc/forbiddencharacterstable.hxx6
-rw-r--r--svx/source/editeng/editeng.cxx17
-rw-r--r--svx/source/editeng/eerdll.cxx18
-rw-r--r--svx/source/editeng/impedit.hxx12
-rw-r--r--svx/source/editeng/impedit2.cxx17
-rw-r--r--svx/source/editeng/impedit3.cxx16
-rw-r--r--svx/source/outliner/outlin2.cxx19
7 files changed, 85 insertions, 20 deletions
diff --git a/svx/inc/forbiddencharacterstable.hxx b/svx/inc/forbiddencharacterstable.hxx
index 815aba083182..fc16f628125b 100644
--- a/svx/inc/forbiddencharacterstable.hxx
+++ b/svx/inc/forbiddencharacterstable.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: forbiddencharacterstable.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: mt $ $Date: 2001-03-09 16:48:22 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:10:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,7 +91,7 @@ struct ForbiddenCharactersInfo
DECLARE_TABLE( SvxForbiddenCharactersTableImpl, ForbiddenCharactersInfo* )
-class SvxForbiddenCharactersTable : public SvxForbiddenCharactersTableImpl, vos::OReference
+class SvxForbiddenCharactersTable : public SvxForbiddenCharactersTableImpl, public vos::OReference
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 85b3558bf3c1..b5bd2c914029 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editeng.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: mt $ $Date: 2001-03-05 16:24:58 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1749,6 +1749,19 @@ void EditEngine::SetHyphenator( Reference< XHyphenator > & xHyph )
pImpEditEngine->SetHyphenator( xHyph );
}
+void EditEngine::SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars )
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ pImpEditEngine->SetForbiddenCharsTable( xForbiddenChars );
+}
+
+vos::ORef<SvxForbiddenCharactersTable> EditEngine::GetForbiddenCharsTable() const
+{
+ DBG_CHKTHIS( EditEngine, 0 );
+ return pImpEditEngine->GetForbiddenCharsTable( FALSE );
+}
+
+
void EditEngine::SetDefaultLanguage( LanguageType eLang )
{
#if SUPD >= 630
diff --git a/svx/source/editeng/eerdll.cxx b/svx/source/editeng/eerdll.cxx
index 4b5edebf1c14..f2b1429b0f11 100644
--- a/svx/source/editeng/eerdll.cxx
+++ b/svx/source/editeng/eerdll.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: eerdll.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: mt $ $Date: 2001-03-02 16:31:50 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -106,6 +106,9 @@
#include <langitem.hxx>
#include <charscaleitem.hxx>
+#include <forbiddencharacterstable.hxx>
+
+#include <comphelper/processfactory.hxx>
GlobalEditData::GlobalEditData()
{
@@ -194,6 +197,17 @@ SfxPoolItem** GlobalEditData::GetDefItems()
return ppDefItems;
}
+vos::ORef<SvxForbiddenCharactersTable> GlobalEditData::GetForbiddenCharsTable()
+{
+ if ( !xForbiddenCharsTable.isValid() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ xForbiddenCharsTable = new SvxForbiddenCharactersTable( xMSF );
+ }
+ return xForbiddenCharsTable;
+}
+
+
OutputDevice* GlobalEditData::GetStdRefDevice()
{
if ( !pStdRefDevice )
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index d1256cd7d189..43d11e2de978 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit.hxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: mt $ $Date: 2001-03-08 09:27:41 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,6 +109,8 @@
#include <com/sun/star/i18n/WordType.hpp>
#endif
+#include <vos/ref.hxx>
+
DBG_NAMEEX( EditView );
DBG_NAMEEX( EditEngine );
@@ -134,6 +136,8 @@ class SvxSearchItem;
class SvxLRSpaceItem;
class TextRanger;
class SvKeyValueIterator;
+class SvxForbiddenCharactersTable;
+
enum ExchangeType { EXCHANGE_CLIPBOARD, EXCHANGE_DRAGSERVER };
@@ -427,6 +431,8 @@ private:
Link aStatusHdlLink;
Link aImportHdl;
+ vos::ORef<SvxForbiddenCharactersTable> xForbiddenCharsTable;
+
// ================================================================
// Methoden...
@@ -805,6 +811,8 @@ public:
void TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+ vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharsTable( BOOL bGetInternal = TRUE ) const;
+ void SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars );
};
inline long ImpEditEngine::LogicToTwips( long n )
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 8955d593e71c..04e839085b9c 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit2.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: mt $ $Date: 2001-03-09 13:13:53 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -3400,3 +3400,16 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight )
}
}
+vos::ORef<SvxForbiddenCharactersTable> ImpEditEngine::GetForbiddenCharsTable( BOOL bGetInternal ) const
+{
+ vos::ORef<SvxForbiddenCharactersTable> xF = xForbiddenCharsTable;
+ if ( !xF.isValid() && bGetInternal )
+ xF = EE_DLL()->GetGlobalData()->GetForbiddenCharsTable();
+ return xF;
+}
+
+void ImpEditEngine::SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars )
+{
+ EE_DLL()->GetGlobalData()->SetForbiddenCharsTable( xForbiddenChars );
+}
+
diff --git a/svx/source/editeng/impedit3.cxx b/svx/source/editeng/impedit3.cxx
index bd1e286cd696..95bcaedbba23 100644
--- a/svx/source/editeng/impedit3.cxx
+++ b/svx/source/editeng/impedit3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit3.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: mt $ $Date: 2001-03-09 13:11:44 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,8 +91,12 @@
#include <scriptspaceitem.hxx>
#include <charscaleitem.hxx>
+#include <forbiddencharacterstable.hxx>
+
#include <unotools/localedatawrapper.hxx>
+#include <unolingu.hxx>
+
#include <textconv.hxx>
#include <math.h>
@@ -1570,11 +1574,9 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, 1 );
i18n::LineBreakUserOptions aUserOptions;
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- LocaleDataWrapper aWrapper( xMSF, aLocale );
- i18n::ForbiddenCharacters aForbidden = aWrapper.getForbiddenCharacters();
- aUserOptions.forbiddenBeginCharacters = aForbidden.beginLine;
- aUserOptions.forbiddenEndCharacters = aForbidden.endLine;
+ const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( SvxLocaleToLanguage( aLocale ), TRUE );
+ aUserOptions.forbiddenBeginCharacters = pForbidden->beginLine;
+ aUserOptions.forbiddenEndCharacters = pForbidden->endLine;
aUserOptions.applyForbiddenRules = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_FORBIDDENRULES )).GetValue();
aUserOptions.allowPunctuationOutsideMargin = FALSE; // ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HANGINGPUNCTUATION )).GetValue();
aUserOptions.allowHyphenateEnglish = FALSE;
diff --git a/svx/source/outliner/outlin2.cxx b/svx/source/outliner/outlin2.cxx
index a5ec619b6baf..9fc287bb18af 100644
--- a/svx/source/outliner/outlin2.cxx
+++ b/svx/source/outliner/outlin2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outlin2.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mt $ $Date: 2000-12-05 20:30:34 $
+ * last change: $Author: mt $ $Date: 2001-03-09 18:10:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,8 @@
#include <vcl/mapmod.hxx>
#endif
+#include <forbiddencharacterstable.hxx>
+
#define _OUTLINER_CXX
#include <outliner.hxx>
@@ -516,6 +518,19 @@ Reference< XSpellChecker1 > Outliner::GetSpeller()
return pEditEngine->GetSpeller();
}
+void Outliner::SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars )
+{
+ DBG_CHKTHIS(Outliner,0);
+ pEditEngine->SetForbiddenCharsTable( xForbiddenChars );
+}
+
+vos::ORef<SvxForbiddenCharactersTable> Outliner::GetForbiddenCharsTable() const
+{
+ DBG_CHKTHIS(Outliner,0);
+ return pEditEngine->GetForbiddenCharsTable();
+}
+
+
Reference< XHyphenator > Outliner::GetHyphenator() const
{
DBG_CHKTHIS(Outliner,0);