summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-06-01 01:24:23 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-06-01 13:04:13 +0200
commit69a8d81b488aaf3014a508cb518f2de3a32076f6 (patch)
tree943de6055bd242b26390e1cd7cc9342506f50dbc
parent151363ed2e0209e0cb6d78d8e821d23080f2e74b (diff)
sal_uInt16 to sal_Int32, and use -1 as a special case
Change-Id: Iaf90f96665781d3aa43f1f71802538f54409bd4a
-rw-r--r--cui/source/dialogs/hyphen.cxx11
-rw-r--r--cui/source/inc/hyphen.hxx4
-rw-r--r--editeng/source/misc/splwrap.cxx2
-rw-r--r--include/editeng/splwrap.hxx2
-rw-r--r--sw/source/uibase/inc/hyp.hxx2
-rw-r--r--sw/source/uibase/lingu/hyp.cxx4
6 files changed, 12 insertions, 13 deletions
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index a4e08f8d52b1..60300896b733 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -31,7 +31,6 @@
#include <vcl/builderfactory.hxx>
#define HYPH_POS_CHAR '='
-#define CONTINUE_HYPH USHRT_MAX
#define CUR_HYPH_POS_CHAR '-'
@@ -223,16 +222,16 @@ void SvxHyphenWordDialog::InitControls_Impl()
}
-void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos )
+void SvxHyphenWordDialog::ContinueHyph_Impl( sal_Int32 nInsPos )
{
- if ( nInsPos != CONTINUE_HYPH && xPossHyph.is())
+ if ( nInsPos >= 0 && xPossHyph.is() )
{
if (nInsPos)
{
OUString aTmp( aEditWord );
DBG_ASSERT(nInsPos <= aTmp.getLength() - 2, "wrong hyphen position");
- sal_Int16 nIdxPos = -1;
+ sal_Int32 nIdxPos = -1;
for (sal_Int32 i = 0; i <= nInsPos; ++i)
{
if (HYPH_POS_CHAR == aTmp[ i ])
@@ -385,7 +384,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, DeleteHdl_Impl)
if( !bBusy )
{
bBusy = true;
- ContinueHyph_Impl();
+ ContinueHyph_Impl( 0 );
bBusy = false;
}
return 0;
@@ -397,7 +396,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, ContinueHdl_Impl)
if( !bBusy )
{
bBusy = true;
- ContinueHyph_Impl( CONTINUE_HYPH );
+ ContinueHyph_Impl();
bBusy = false;
}
return 0;
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 3bf97672b99b..115c31543245 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -59,7 +59,7 @@ class SvxHyphenWordDialog : public SfxModalDialog
LanguageType nActLanguage; // and its language
sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
sal_uInt16 nHyphPos;
- sal_uInt16 nOldPos;
+ sal_Int32 nOldPos;
sal_Int32 nHyphenationPositionsOffset;
bool bBusy;
@@ -68,7 +68,7 @@ class SvxHyphenWordDialog : public SfxModalDialog
OUString EraseUnusableHyphens_Impl( css::uno::Reference< css::linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos );
void InitControls_Impl();
- void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
+ void ContinueHyph_Impl( sal_Int32 nInsPos = -1 ); // continue by default
sal_uInt16 GetHyphIndex_Impl();
DECL_LINK(Left_Impl, void *);
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index c5a81952fe38..fe5fb575edaa 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -298,7 +298,7 @@ void SvxSpellWrapper::ReplaceAll( const OUString &, sal_Int16 )
{ // Replace Word from the Replace list
}
-void SvxSpellWrapper::InsertHyphen( const sal_uInt16 )
+void SvxSpellWrapper::InsertHyphen( const sal_Int32 )
{ // inserting and deleting Hyphae
}
diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx
index 5e879f453381..e9de2f7a31ec 100644
--- a/include/editeng/splwrap.hxx
+++ b/include/editeng/splwrap.hxx
@@ -136,7 +136,7 @@ protected:
// Wort via Thesaurus ersetzen
virtual void ChangeThesWord( const OUString& rNewWord );
virtual void AutoCorrect( const OUString& rAktStr, const OUString& rNewStr );
- virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen
+ virtual void InsertHyphen( const sal_Int32 nPos ); // Insert hyphen
void SetCurTextObj( SdrObject* pObj ) { mpTextObj = pObj; }
SdrObject* GetCurTextObj() { return mpTextObj; }
diff --git a/sw/source/uibase/inc/hyp.hxx b/sw/source/uibase/inc/hyp.hxx
index f1f144044799..4226ed89adad 100644
--- a/sw/source/uibase/inc/hyp.hxx
+++ b/sw/source/uibase/inc/hyp.hxx
@@ -42,7 +42,7 @@ protected:
virtual bool SpellContinue() SAL_OVERRIDE;
virtual void SpellEnd( ) SAL_OVERRIDE;
virtual bool SpellMore() SAL_OVERRIDE;
- virtual void InsertHyphen( const sal_uInt16 nPos ) SAL_OVERRIDE; // insert hyphen
+ virtual void InsertHyphen( const sal_Int32 nPos ) SAL_OVERRIDE; // insert hyphen
public:
SwHyphWrapper( SwView* pVw,
diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx
index 057bd69d14f2..98dccf7d5e67 100644
--- a/sw/source/uibase/lingu/hyp.cxx
+++ b/sw/source/uibase/lingu/hyp.cxx
@@ -108,10 +108,10 @@ bool SwHyphWrapper::SpellMore()
return false;
}
-void SwHyphWrapper::InsertHyphen( const sal_uInt16 nPos )
+void SwHyphWrapper::InsertHyphen( const sal_Int32 nPos )
{
if( nPos)
- SwEditShell::InsertSoftHyph( nPos + 1); // does nPos == 1 really mean
+ SwEditShell::InsertSoftHyph(nPos + 1); // does nPos == 1 really mean
// insert hyphen after first char?
// (instead of nPos == 0)
else