[Libreoffice-commits] core.git: 11 commits - accessibility/source compilerplugins/clang dbaccess/source editeng/source include/svtools include/svx svtools/inc svtools/source svx/source sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Feb 14 12:23:09 UTC 2017
accessibility/source/extended/accessiblelistbox.cxx | 4
accessibility/source/extended/accessiblelistboxentry.cxx | 4
compilerplugins/clang/unusedenumconstants.py | 4
dbaccess/source/ui/misc/HtmlReader.cxx | 2
dbaccess/source/ui/misc/RtfReader.cxx | 10 -
dbaccess/source/ui/misc/TokenWriter.cxx | 8
editeng/source/editeng/eehtml.cxx | 2
editeng/source/editeng/impedit4.cxx | 4
editeng/source/rtf/svxrtf.cxx | 12 -
include/svtools/ruler.hxx | 2
include/svtools/svparser.hxx | 15 -
include/svtools/treelistbox.hxx | 1
include/svx/dlgctrl.hxx | 5
include/svx/galmisc.hxx | 3
include/svx/paraprev.hxx | 14 -
include/svx/rectenum.hxx | 8
include/svx/ruler.hxx | 1
include/svx/sdr/table/tablecontroller.hxx | 2
svtools/inc/table/tablecontrolinterface.hxx | 9
svtools/source/contnr/contentenumeration.cxx | 8
svtools/source/contnr/contentenumeration.hxx | 3
svtools/source/contnr/fileview.cxx | 15 -
svtools/source/contnr/foldertree.cxx | 2
svtools/source/control/ruler.cxx | 27 --
svtools/source/svhtml/parhtml.cxx | 28 +-
svtools/source/svrtf/parrtf.cxx | 28 +-
svtools/source/svrtf/svparser.cxx | 28 +-
svtools/source/table/mousefunction.cxx | 2
svtools/source/table/tablecontrol_impl.cxx | 14 -
svtools/source/uno/svtxgridcontrol.cxx | 4
svx/source/accessibility/svxrectctaccessiblecontext.cxx | 4
svx/source/dialog/dlgctrl.cxx | 146 +++------------
svx/source/dialog/paraprev.cxx | 14 -
svx/source/dialog/svxruler.cxx | 3
svx/source/gallery2/galtheme.cxx | 4
svx/source/table/tablecontroller.cxx | 4
svx/source/unogallery/unogalitem.cxx | 1
sw/source/filter/html/htmlcss1.cxx | 2
sw/source/filter/html/htmltab.cxx | 30 +--
sw/source/filter/html/swhtml.cxx | 36 +--
40 files changed, 196 insertions(+), 317 deletions(-)
New commits:
commit 2074acd6e3793e38aa6bbf9b9c8e2ba116341e32
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 14:21:46 2017 +0200
remove unused Border from RulerIndentStyle enum
Change-Id: If8d5acdf48278adeb4974c46c8e777e8792ba743
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index aa2fc2c..72e546b 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -517,7 +517,7 @@ struct RulerBorder
};
enum class RulerIndentStyle {
- Top, Bottom, Border
+ Top, Bottom
};
struct RulerIndent
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 874caa5..aaaca43 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -811,13 +811,7 @@ void Ruler::ImplDrawIndents(vcl::RenderContext& rRenderContext, long nMin, long
if ((n >= nMin) && (n <= nMax))
{
- if (nIndentStyle == RulerIndentStyle::Border)
- {
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
- ImplVDrawLine(rRenderContext, n, nVirTop + 1, n, nVirBottom - 1);
- }
- else if (nIndentStyle == RulerIndentStyle::Bottom)
+ if (nIndentStyle == RulerIndentStyle::Bottom)
{
aPoly.SetPoint(Point(n + 0, nVirBottom - nIndentHeight), 0);
aPoly.SetPoint(Point(n - nIndentWidth2, nVirBottom - 3), 1);
@@ -844,19 +838,16 @@ void Ruler::ImplDrawIndents(vcl::RenderContext& rRenderContext, long nMin, long
aPoly[i] = aSet;
}
}
- if (RulerIndentStyle::Border != nIndentStyle)
+ bool bIsHit = false;
+ if(mxCurrentHitTest.get() != nullptr && mxCurrentHitTest->eType == RulerType::Indent)
{
- bool bIsHit = false;
- if(mxCurrentHitTest.get() != nullptr && mxCurrentHitTest->eType == RulerType::Indent)
- {
- bIsHit = mxCurrentHitTest->nAryPos == j;
- }
- else if(mbDrag && meDragType == RulerType::Indent)
- {
- bIsHit = mnDragAryPos == j;
- }
- ImplDrawIndent(rRenderContext, aPoly, bIsHit);
+ bIsHit = mxCurrentHitTest->nAryPos == j;
+ }
+ else if(mbDrag && meDragType == RulerType::Indent)
+ {
+ bIsHit = mnDragAryPos == j;
}
+ ImplDrawIndent(rRenderContext, aPoly, bIsHit);
}
}
}
commit 52305b662033ebbac6e09aa66622f7eef2bfccae
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 12:53:43 2017 +0200
convert SvParserState to scoped enum
and drop unused WAITFORDATA enumerator
Change-Id: I658802d88a19dcc2d378456375810454e7426447
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index a2aaf9d..6ab4050 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -114,7 +114,7 @@ SvParserState OHTMLReader::CallParser()
rInput.ResetError();
SvParserState eParseState = HTMLParser::CallParser();
SetColumnTypes(m_pColumnList,m_pInfoMap);
- return m_bFoundTable ? eParseState : SVPAR_ERROR;
+ return m_bFoundTable ? eParseState : SvParserState::Error;
}
void OHTMLReader::NextToken( int nToken )
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index 4adee97..268845c 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -92,7 +92,7 @@ SvParserState ORTFReader::CallParser()
rInput.ResetError();
SvParserState eParseState = SvRTFParser::CallParser();
SetColumnTypes(m_pColumnList,m_pInfoMap);
- return m_bFoundTable ? eParseState : SVPAR_ERROR;
+ return m_bFoundTable ? eParseState : SvParserState::Error;
}
void ORTFReader::NextToken( int nToken )
@@ -122,11 +122,11 @@ void ORTFReader::NextToken( int nToken )
}
nTmpToken2 = GetNextToken();
}
- while(aToken[0] != ';' && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(aToken[0] != ';' && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_vecColor.push_back(aColor.GetRGBColor());
nTmpToken2 = GetNextToken();
}
- while(nTmpToken2 == RTF_RED && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(nTmpToken2 == RTF_RED && eState != SvParserState::Error && eState != SvParserState::Accepted);
SkipToken();
}
break;
@@ -221,7 +221,7 @@ void ORTFReader::NextToken( int nToken )
{
do
{}
- while(GetNextToken() != RTF_ROW && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(GetNextToken() != RTF_ROW && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_bHead = false;
}
break;
@@ -302,7 +302,7 @@ bool ORTFReader::CreateTable(int nToken)
}
nToken = GetNextToken();
}
- while(nToken != RTF_TROWD && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
+ while(nToken != RTF_TROWD && eState != SvParserState::Error && eState != SvParserState::Accepted);
bool bOk = !m_vDestVector.empty();
if(bOk)
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 8b63406..e2edd92 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -590,7 +590,7 @@ void ORTFImportExport::appendRow(OString* pHorzChar,sal_Int32 _nColumnCount,sal_
bool ORTFImportExport::Read()
{
ODatabaseImportExport::Read();
- SvParserState eState = SVPAR_ERROR;
+ SvParserState eState = SvParserState::Error;
if ( m_pStream )
{
m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
@@ -602,7 +602,7 @@ bool ORTFImportExport::Read()
m_pReader = nullptr;
}
- return eState != SVPAR_ERROR;
+ return eState != SvParserState::Error;
}
const sal_Int16 OHTMLImportExport::nDefaultFontSize[SBA_HTML_FONTSIZES] =
@@ -661,7 +661,7 @@ bool OHTMLImportExport::Write()
bool OHTMLImportExport::Read()
{
ODatabaseImportExport::Read();
- SvParserState eState = SVPAR_ERROR;
+ SvParserState eState = SvParserState::Error;
if ( m_pStream )
{
m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext);
@@ -674,7 +674,7 @@ bool OHTMLImportExport::Read()
m_pReader = nullptr;
}
- return eState != SVPAR_ERROR;
+ return eState != SvParserState::Error;
}
void OHTMLImportExport::WriteHeader()
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index f0f6cd3..b76fbe8 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -73,7 +73,7 @@ SvParserState EditHTMLParser::CallParser(EditEngine* pEE, const EditPaM& rPaM)
{
DBG_ASSERT(pEE, "CallParser: ImpEditEngine ?!");
mpEditEngine = pEE;
- SvParserState _eState = SVPAR_NOTSTARTED;
+ SvParserState _eState = SvParserState::NotStarted;
if ( mpEditEngine )
{
// Build in wrap mimic in RTF import?
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 55e175c..0c45722 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -164,7 +164,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine);
SvParserState eState = xPrsr->CallParser();
- if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
+ if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) )
{
rInput.SetError( EE_READWRITE_WRONGFORMAT );
return aSel.Min();
@@ -179,7 +179,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const OUString& rBaseURL, Edi
EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs );
SvParserState eState = xPrsr->CallParser(pEditEngine, aSel.Max());
- if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
+ if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) )
{
rInput.SetError( EE_READWRITE_WRONGFORMAT );
return aSel.Min();
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index c88070c..0aef5b3 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -107,7 +107,7 @@ SvParserState SvxRTFParser::CallParser()
DBG_ASSERT( pInsPos, "no insertion position");
if( !pInsPos )
- return SVPAR_ERROR;
+ return SvParserState::Error;
if( !aColorTbl.empty() )
ClearColorTbl();
@@ -134,7 +134,7 @@ void SvxRTFParser::Continue( int nToken )
{
SvRTFParser::Continue( nToken );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
SetAllAttrOfStk();
//Regardless of what "color 0" is, word defaults to auto as the default colour.
@@ -328,7 +328,7 @@ void SvxRTFParser::ReadStyleTable()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -486,7 +486,7 @@ void SvxRTFParser::ReadFontTable()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -602,7 +602,7 @@ OUString& SvxRTFParser::GetTextToEndGroup( OUString& rStr )
ReadUnknownData();
int nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
@@ -666,7 +666,7 @@ void SvxRTFParser::ReadInfo()
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break;
}
++_nOpenBrakets;
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index 03da935..ff699e3 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -32,14 +32,13 @@
struct SvParser_Impl;
class SvStream;
-enum SvParserState
+enum class SvParserState
{
- SVPAR_ACCEPTED = 0,
- SVPAR_NOTSTARTED,
- SVPAR_WORKING,
- SVPAR_PENDING,
- SVPAR_WAITFORDATA,
- SVPAR_ERROR
+ Accepted = 0,
+ NotStarted,
+ Working,
+ Pending,
+ Error
};
class SVT_DLLPUBLIC SvParser : public SvRefBase
@@ -123,7 +122,7 @@ public:
sal_uInt32 GetNextChar(); // Return next Unicode codepoint in UTF32.
void RereadLookahead();
- inline bool IsParserWorking() const { return SVPAR_WORKING == eState; }
+ inline bool IsParserWorking() const { return SvParserState::Working == eState; }
Link<LinkParamNone*,void> GetAsynchCallLink() const
{ return LINK( const_cast<SvParser*>(this), SvParser, NewDataRead ); }
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index c09ecc5..9df8cea 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -273,7 +273,7 @@ HTMLParser::~HTMLParser()
SvParserState HTMLParser::CallParser()
{
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
nNextCh = GetNextChar();
SaveState( 0 );
@@ -282,7 +282,7 @@ SvParserState HTMLParser::CallParser()
AddFirstRef();
Continue( 0 );
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // Parser not needed anymore
return eState;
@@ -607,7 +607,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( cChar )
sTmpBuffer.appendUtf32( cChar );
}
- else if( SVPAR_PENDING==eState && '>'!=cBreak )
+ else if( SvParserState::Pending==eState && '>'!=cBreak )
{
// Restart with '&', the remainder is returned as
// text token.
@@ -1080,7 +1080,7 @@ int HTMLParser::GetNextToken_()
if( !IsParserWorking() )
{
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
break;
}
@@ -1188,7 +1188,7 @@ int HTMLParser::GetNextToken_()
break;
}
}
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
}
else
@@ -1212,7 +1212,7 @@ int HTMLParser::GetNextToken_()
bNextCh = false;
break;
}
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
bReadNextChar = bReadNextCharSave;
aToken.clear();
}
@@ -1299,7 +1299,7 @@ int HTMLParser::GetNextToken_()
case sal_Unicode(EOF):
if( rInput.IsEof() )
{
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
nRet = nNextCh;
}
else
@@ -1346,28 +1346,28 @@ scan_text:
bNextCh = 0 == aToken.getLength();
// the text should be processed
- if( !bNextCh && eState == SVPAR_PENDING )
+ if( !bNextCh && eState == SvParserState::Pending )
{
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
bReadNextChar = true;
}
break;
}
- if( bNextCh && SVPAR_WORKING == eState )
+ if( bNextCh && SvParserState::Working == eState )
{
nNextCh = GetNextChar();
- if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet )
+ if( SvParserState::Pending == eState && nRet && HTML_TEXTTOKEN != nRet )
{
bReadNextChar = true;
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
}
}
- } while( !nRet && SVPAR_WORKING == eState );
+ } while( !nRet && SvParserState::Working == eState );
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
nRet = -1; // s.th. invalid
return nRet;
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index d65868c..b822146 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -208,10 +208,10 @@ int SvRTFParser::GetNextToken_()
break;
}
}
- else if( SVPAR_PENDING != eState )
+ else if( SvParserState::Pending != eState )
{
// Bug 34631 - "\ " read on - Blank as character
- // eState = SVPAR_ERROR;
+ // eState = SvParserState::Error;
bNextCh = false;
}
break;
@@ -220,7 +220,7 @@ int SvRTFParser::GetNextToken_()
break;
case sal_Unicode(EOF):
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
nRet = nNextCh;
break;
@@ -278,7 +278,7 @@ int SvRTFParser::GetNextToken_()
if( bNextCh )
nNextCh = GetNextChar();
- } while( !nRet && SVPAR_WORKING == eState );
+ } while( !nRet && SvParserState::Working == eState );
return nRet;
}
@@ -467,7 +467,7 @@ void SvRTFParser::ScanText()
break;
case sal_Unicode(EOF):
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
SAL_FALLTHROUGH;
case '{':
case '}':
@@ -547,8 +547,8 @@ _inSkipGroup++;
}
} while (sal_Unicode(EOF) != nNextCh && IsParserWorking());
- if( SVPAR_PENDING != eState && '}' != nNextCh )
- eState = SVPAR_ERROR;
+ if( SvParserState::Pending != eState && '}' != nNextCh )
+ eState = SvParserState::Error;
_inSkipGroup--;
}
@@ -561,7 +561,7 @@ SvParserState SvRTFParser::CallParser()
sal_Char cFirstCh;
nNextChPos = rInput.Tell();
rInput.ReadChar( cFirstCh ); nNextCh = cFirstCh;
- eState = SVPAR_WORKING;
+ eState = SvParserState::Working;
nOpenBrakets = 0;
SetSrcEncoding( eCodeSet = RTL_TEXTENCODING_MS_1252 );
@@ -570,11 +570,11 @@ SvParserState SvRTFParser::CallParser()
{
AddFirstRef();
Continue( 0 );
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // now parser is not needed anymore
}
else
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
return eState;
}
@@ -595,7 +595,7 @@ void SvRTFParser::Continue( int nToken )
case '}':
if( nOpenBrakets )
goto NEXTTOKEN;
- eState = SVPAR_ACCEPTED;
+ eState = SvParserState::Accepted;
break;
case '{':
@@ -611,7 +611,7 @@ void SvRTFParser::Continue( int nToken )
ReadUnknownData();
nToken = GetNextToken();
if( '}' != nToken )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
break; // move to next token!!
}
}
@@ -646,8 +646,8 @@ NEXTTOKEN:
// continue with new token!
nToken = GetNextToken();
}
- if( SVPAR_ACCEPTED == eState && 0 < nOpenBrakets )
- eState = SVPAR_ERROR;
+ if( SvParserState::Accepted == eState && 0 < nOpenBrakets )
+ eState = SvParserState::Error;
}
void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 0540e17..f7bb5a8 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -67,7 +67,7 @@ SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
, pImplData( nullptr )
, nTokenValue( 0 )
, bTokenHasValue( false )
- , eState( SVPAR_NOTSTARTED )
+ , eState( SvParserState::NotStarted )
, eSrcEnc( RTL_TEXTENCODING_DONTKNOW )
, nNextChPos(0)
, nNextCh(0)
@@ -77,7 +77,7 @@ SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
, nTokenStackSize( nStackSize )
, nTokenStackPos( 0 )
{
- eState = SVPAR_NOTSTARTED;
+ eState = SvParserState::NotStarted;
if( nTokenStackSize < 3 )
nTokenStackSize = 3;
pTokenStack = new TokenStackType[ nTokenStackSize ];
@@ -397,7 +397,7 @@ sal_uInt32 SvParser::GetNextChar()
{
if( ERRCODE_IO_PENDING == rInput.GetError() )
{
- eState = SVPAR_PENDING;
+ eState = SvParserState::Pending;
return c;
}
else
@@ -426,7 +426,7 @@ int SvParser::GetNextToken()
bTokenHasValue = false;
nRet = GetNextToken_();
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
return nRet;
}
@@ -444,15 +444,15 @@ int SvParser::GetNextToken()
nRet = pTokenStackPos->nTokenId;
}
// no, now push actual value on stack
- else if( SVPAR_WORKING == eState )
+ else if( SvParserState::Working == eState )
{
pTokenStackPos->sToken = aToken;
pTokenStackPos->nTokenValue = nTokenValue;
pTokenStackPos->bTokenHasValue = bTokenHasValue;
pTokenStackPos->nTokenId = nRet;
}
- else if( SVPAR_ACCEPTED != eState && SVPAR_PENDING != eState )
- eState = SVPAR_ERROR; // an error occurred
+ else if( SvParserState::Accepted != eState && SvParserState::Pending != eState )
+ eState = SvParserState::Error; // an error occurred
return nRet;
}
@@ -618,8 +618,8 @@ IMPL_LINK_NOARG( SvParser, NewDataRead, LinkParamNone*, void )
{
switch( eState )
{
- case SVPAR_PENDING:
- eState = SVPAR_WORKING;
+ case SvParserState::Pending:
+ eState = SvParserState::Working;
RestoreState();
Continue( pImplData->nToken );
@@ -627,16 +627,12 @@ IMPL_LINK_NOARG( SvParser, NewDataRead, LinkParamNone*, void )
if( ERRCODE_IO_PENDING == rInput.GetError() )
rInput.ResetError();
- if( SVPAR_PENDING != eState )
+ if( SvParserState::Pending != eState )
ReleaseRef(); // ready otherwise!
break;
- case SVPAR_WAITFORDATA:
- eState = SVPAR_WORKING;
- break;
-
- case SVPAR_NOTSTARTED:
- case SVPAR_WORKING:
+ case SvParserState::NotStarted:
+ case SvParserState::Working:
break;
default:
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index bc3dece..6c0e7be 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1715,7 +1715,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL,
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
pStream = nullptr;
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 8de1d9e..f0705e5 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3391,7 +3391,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -3873,7 +3873,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
bHead,
pSaveStruct->IsInSection(),
bHasToFly );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
// nur wenn die Tabelle wirklich zu Ende ist!
if( pSubTable )
@@ -3994,7 +3994,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( bHead ? HTML_TABLEHEADER_ON
: HTML_TABLEDATA_ON, m_pPendStack );
@@ -4111,7 +4111,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4223,7 +4223,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
case HTML_TABLEHEADER_ON:
case HTML_TABLEDATA_ON:
BuildTableCell( pCurTable, true, HTML_TABLEHEADER_ON==nToken );
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
pSaveStruct->bHasCells = true;
bDone = m_pTable->IsOverflowing();
@@ -4283,7 +4283,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_TABLEROW_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -4317,7 +4317,7 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4445,7 +4445,7 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( bHead ? HTML_THEAD_ON
: HTML_TBODY_ON, m_pPendStack );
@@ -4505,7 +4505,7 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -4662,7 +4662,7 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_COL_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -4808,7 +4808,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
{
BuildTable( SVX_ADJUST_END );
}
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
m_pTable = pSaveStruct->m_pTable;
}
@@ -4848,7 +4848,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
nToken = GetNextToken();
}
- if( SVPAR_PENDING==GetStatus() )
+ if( SvParserState::Pending==GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_CAPTION_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -5103,7 +5103,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
delete m_pPendStack;
m_pPendStack = pTmp;
nToken = m_pPendStack ? m_pPendStack->nToken : GetSaveToken();
- bPending = SVPAR_ERROR == eState && m_pPendStack != nullptr;
+ bPending = SvParserState::Error == eState && m_pPendStack != nullptr;
SaveState( nToken );
}
@@ -5227,7 +5227,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
nToken = GetNextToken();
}
- if( SVPAR_PENDING == GetStatus() )
+ if( SvParserState::Pending == GetStatus() )
{
m_pPendStack = new SwPendingStack( HTML_TABLE_ON, m_pPendStack );
m_pPendStack->pData = pSaveStruct;
@@ -5338,7 +5338,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
// kein Show aufgerufen werden, weil sonst waehrend des
// Reschedules der Parser zerstoert wird, wenn noch ein
// DataAvailable-Link kommt. Deshalb: Nur im WORKING-State.
- if( !m_nParaCnt && SVPAR_WORKING == GetStatus() )
+ if( !m_nParaCnt && SvParserState::Working == GetStatus() )
Show();
}
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index fc8bdc9..639b5ca 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -218,9 +218,9 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam,
SvParserState eState = xParser->CallParser();
- if( SVPAR_PENDING == eState )
+ if( SvParserState::Pending == eState )
pStrm->ResetError();
- else if( SVPAR_ACCEPTED != eState )
+ else if( SvParserState::Accepted != eState )
{
const OUString sErr(OUString::number((sal_Int32)xParser->GetLineNr())
+ "," + OUString::number((sal_Int32)xParser->GetLinePos()));
@@ -489,7 +489,7 @@ IMPL_LINK_NOARG( SwHTMLParser, AsyncCallback, void*, void )
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
GetAsynchCallLink().Call(nullptr);
@@ -562,21 +562,21 @@ void SwHTMLParser::Continue( int nToken )
// Wenn der Import (vom SFX) abgebrochen wurde, wird ein Fehler
// gesetzt aber trotzdem noch weiter gemacht, damit vernuenftig
// aufgeraeumt wird.
- OSL_ENSURE( SVPAR_ERROR!=eState,
+ OSL_ENSURE( SvParserState::Error!=eState,
"SwHTMLParser::Continue: bereits ein Fehler gesetzt" );
if( m_xDoc->GetDocShell() && m_xDoc->GetDocShell()->IsAbortingImport() )
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
// Die SwViewShell vom Dokument holen, merken und als aktuelle setzen.
SwViewShell *pInitVSh = CallStartAction();
- if( SVPAR_ERROR != eState && GetMedium() && !m_bViewCreated )
+ if( SvParserState::Error != eState && GetMedium() && !m_bViewCreated )
{
// Beim ersten Aufruf erstmal returnen, Doc anzeigen
// und auf Timer Callback warten.
// An dieser Stelle wurde im CallParser gerade mal ein Zeichen
// gelesen und ein SaveState(0) gerufen.
- eState = SVPAR_PENDING;
+ eState = SvParserState::Pending;
m_bViewCreated = true;
m_xDoc->SetInLoadAsynchron( true );
@@ -609,7 +609,7 @@ void SwHTMLParser::Continue( int nToken )
// Falls ein Pending-Stack existiert aber durch einen Aufruf
// von NextToken dafuer sorgen, dass der Pending-Stack noch
// beendet wird.
- if( SVPAR_ERROR == eState )
+ if( SvParserState::Error == eState )
{
OSL_ENSURE( !m_pPendStack || m_pPendStack->nToken,
"SwHTMLParser::Continue: Pending-Stack ohne Token" );
@@ -627,7 +627,7 @@ void SwHTMLParser::Continue( int nToken )
EndProgress( m_xDoc->GetDocShell() );
bool bLFStripped = false;
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
// noch die letzten Attribute setzen
{
@@ -724,7 +724,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() )
}
}
- if( SVPAR_ACCEPTED == eState )
+ if( SvParserState::Accepted == eState )
{
if( m_nMissingImgMaps )
{
@@ -850,7 +850,7 @@ if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false ).nNode.GetIndex() )
}
}
- if( SVPAR_PENDING != GetStatus() )
+ if( SvParserState::Pending != GetStatus() )
{
delete m_pSttNdIdx;
m_pSttNdIdx = nullptr;
@@ -942,7 +942,7 @@ void SwHTMLParser::NextToken( int nToken )
{
// Was the import cancelled by SFX? If a pending stack
// exists, clean it.
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
OSL_ENSURE( !m_pPendStack || m_pPendStack->nToken,
"SwHTMLParser::NextToken: Pending-Stack without token" );
if( 1 == m_xDoc->getReferenceCount() || !m_pPendStack )
@@ -1492,7 +1492,7 @@ void SwHTMLParser::NextToken( int nToken )
// an error code
if( 1 == m_xDoc->getReferenceCount() )
{
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
break;
@@ -2473,7 +2473,7 @@ void SwHTMLParser::Show()
// - die eiegen View-Shell wieder gesetzt
// - und Start-Action gerufen
- OSL_ENSURE( SVPAR_WORKING==eState, "Show nicht im Working-State - Das kann ins Auge gehen" );
+ OSL_ENSURE( SvParserState::Working==eState, "Show nicht im Working-State - Das kann ins Auge gehen" );
SwViewShell *pOldVSh = CallEndAction();
Application::Reschedule();
@@ -2482,7 +2482,7 @@ void SwHTMLParser::Show()
|| 1 == m_xDoc->getReferenceCount() )
{
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
// Die SwViewShell nochmal holen, denn sie koennte im Reschedule
@@ -2505,7 +2505,7 @@ void SwHTMLParser::ShowStatline()
// - die eiegen View-Shell wieder gesetzt
// - ein Start/End-Action gerufen, wenn gescrollt wurde.
- OSL_ENSURE( SVPAR_WORKING==eState, "ShowStatLine nicht im Working-State - Das kann ins Auge gehen" );
+ OSL_ENSURE( SvParserState::Working==eState, "ShowStatLine nicht im Working-State - Das kann ins Auge gehen" );
// Laufbalkenanzeige
if( !GetMedium() || !GetMedium()->IsRemote() )
@@ -2520,7 +2520,7 @@ void SwHTMLParser::ShowStatline()
if( ( m_xDoc->GetDocShell() && m_xDoc->GetDocShell()->IsAbortingImport() )
|| 1 == m_xDoc->getReferenceCount() )
// wurde der Import vom SFX abgebrochen?
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
SwViewShell *pVSh = CheckActionViewShell();
if( pVSh && pVSh->HasInvalidRect() )
@@ -2606,7 +2606,7 @@ SwViewShell *SwHTMLParser::CallEndAction( bool bChkAction, bool bChkPtr )
// man hier abbrechen und einen Fehler setzen.
if( 1 == m_xDoc->getReferenceCount() )
{
- eState = SVPAR_ERROR;
+ eState = SvParserState::Error;
}
SwViewShell *pVSh = m_pActionViewShell;
commit 5a5940858e1f860101c5cb74921e44f2917b37c8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 10:13:57 2017 +0200
drop unused LIST from SvTreeAccRoleType enum
Change-Id: I378dea43b0c08675419a5399e5999c34441497fe
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index 6933f10..dd96005 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -418,9 +418,7 @@ namespace accessibility
{
SvTreeAccRoleType nType = getListBox()->GetAllEntriesAccessibleRoleType();
if( nType == SvTreeAccRoleType::TREE)
- return AccessibleRole::TREE;
- else if( nType == SvTreeAccRoleType::LIST)
- return AccessibleRole::LIST;
+ return AccessibleRole::TREE;
}
//o is: return AccessibleRole::TREE;
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 3641f9d..3b29710 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -403,9 +403,7 @@ namespace accessibility
{
SvTreeAccRoleType nType = pBox->GetAllEntriesAccessibleRoleType();
if( nType == SvTreeAccRoleType::TREE)
- return AccessibleRole::TREE_ITEM;
- else if( nType == SvTreeAccRoleType::LIST)
- return AccessibleRole::LIST_ITEM;
+ return AccessibleRole::TREE_ITEM;
SvTreeFlags treeFlag = pBox->GetTreeFlags();
if(treeFlag & SvTreeFlags::CHKBTN )
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index c4e9d88..0021742 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -115,7 +115,6 @@ namespace o3tl
enum class SvTreeAccRoleType
{
NONE = 0x00,
- LIST = 0x01,
TREE = 0x02
};
commit 923fd24972e9d3dac4fa5ed863e42bb28cf6605a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 10:00:24 2017 +0200
convert svt::table::TableArea to scoped enum
and drop unused TableAreaDataArea enumerator
Change-Id: I00da558ab899dccbeaa9786c65f7a2831f323b25
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 4db682b..3cc9738 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -122,6 +122,7 @@ for d in definitionSet:
"sw/inc/flddat.hxx",
"sw/source/uibase/config/modcfg.cxx", # InsertConfigProp
"sw/inc/calc.hxx", # SwCalcOper
+ "svtools/source/config/helpopt.cxx", # HelpProperty
# Windows or OSX only
"include/canvas/rendering/icolorbuffer.hxx",
"include/vcl/commandevent.hxx",
diff --git a/svtools/inc/table/tablecontrolinterface.hxx b/svtools/inc/table/tablecontrolinterface.hxx
index 2e5e6d4..d9f37e2 100644
--- a/svtools/inc/table/tablecontrolinterface.hxx
+++ b/svtools/inc/table/tablecontrolinterface.hxx
@@ -142,12 +142,11 @@ namespace svt { namespace table
//= TableArea
- enum TableArea
+ enum class TableArea
{
- TableAreaColumnHeaders,
- TableAreaRowHeaders,
- TableAreaDataArea,
- TableAreaAll
+ ColumnHeaders,
+ RowHeaders,
+ All
};
diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
index bb01268..1cf7f22 100644
--- a/svtools/source/table/mousefunction.cxx
+++ b/svtools/source/table/mousefunction.cxx
@@ -148,7 +148,7 @@ namespace svt { namespace table
requestedWidthLogical = maxWidthLogical;
}
pColumn->setWidth( requestedWidthLogical );
- i_tableControl.invalidate( TableAreaAll );
+ i_tableControl.invalidate( TableArea::All );
}
i_tableControl.setPointer( Pointer() );
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index e7c703b..16e711e 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -500,7 +500,7 @@ namespace svt { namespace table
if ( !m_bUpdatingColWidths )
{
impl_ni_relayout( i_column );
- invalidate( TableAreaAll );
+ invalidate( TableArea::All );
}
nGroup &= ~ColumnAttributeGroup::WIDTH;
@@ -1055,7 +1055,7 @@ namespace svt { namespace table
// if the column widths changed, ensure everything is repainted
if ( anyColumnWidthChanged )
- invalidate( TableAreaAll );
+ invalidate( TableArea::All );
// if the column resizing happened to leave some space at the right, but there are columns
// scrolled out to the left, scroll them in
@@ -1788,19 +1788,15 @@ namespace svt { namespace table
{
switch ( i_what )
{
- case TableAreaColumnHeaders:
+ case TableArea::ColumnHeaders:
m_pDataWindow->Invalidate( calcHeaderRect( true ) );
break;
- case TableAreaRowHeaders:
+ case TableArea::RowHeaders:
m_pDataWindow->Invalidate( calcHeaderRect( false ) );
break;
- case TableAreaDataArea:
- m_pDataWindow->Invalidate( impl_getAllVisibleDataCellArea() );
- break;
-
- case TableAreaAll:
+ case TableArea::All:
m_pDataWindow->Invalidate();
m_pDataWindow->GetParent()->Invalidate( InvalidateFlags::Transparent );
break;
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index 5741809..4fc636c 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -625,7 +625,7 @@ void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event )
// So, just in case, invalidate the column header area, too.
VclPtr< TableControl > pTable = GetAsDynamic< TableControl >();
ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" );
- pTable->getTableControlInterface().invalidate( TableAreaColumnHeaders );
+ pTable->getTableControlInterface().invalidate( TableArea::ColumnHeaders );
}
@@ -637,7 +637,7 @@ void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& )
ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" );
// TODO: we could do better than this - invalidate the header area only
- pTable->getTableControlInterface().invalidate( TableAreaRowHeaders );
+ pTable->getTableControlInterface().invalidate( TableArea::RowHeaders );
}
commit 7bd5d9c81b30609d4d10dba091021352e94a7837
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:56:43 2017 +0200
convert to EnumerationResult to scoped enum
and drop unused RUNNING constant
Change-Id: I498b8b47e172336775b38c953f867f2adc57603e
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 065b0dc..4db682b 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -144,6 +144,7 @@ for d in definitionSet:
"sw/inc/toxe.hxx", # ToxAuthorityType (from UI)
"include/svx/sxekitm.hxx", # SdrEdgeKind (from UI)
"include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI)
+ "include/svx/ctredlin.hxx", # SvxRedlinDateMode (from UI)
# represents constants from an external API
"opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx",
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index fee0254..acc6cc4 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -135,7 +135,7 @@ namespace svt
EnumerationResult FileViewContentEnumerator::enumerateFolderContent()
{
- EnumerationResult eResult = ERROR;
+ EnumerationResult eResult = EnumerationResult::ERROR;
try
{
@@ -298,7 +298,7 @@ namespace svt
bCancelled = m_bCancelled;
}
}
- eResult = SUCCESS;
+ eResult = EnumerationResult::SUCCESS;
}
catch( CommandAbortedException& )
{
@@ -324,12 +324,12 @@ namespace svt
::osl::MutexGuard aGuard( m_aMutex );
pHandler = m_pResultHandler;
if ( m_bCancelled )
- return ERROR;
+ return EnumerationResult::ERROR;
}
{
::osl::MutexGuard aGuard( m_rContentMutex );
- if ( eResult != SUCCESS )
+ if ( eResult != EnumerationResult::SUCCESS )
// clear any "intermediate" and unfinished result
m_rContent.clear();
}
diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx
index 70bfef2..74beb8b 100644
--- a/svtools/source/contnr/contentenumeration.hxx
+++ b/svtools/source/contnr/contentenumeration.hxx
@@ -127,11 +127,10 @@ namespace svt
//= EnumerationResult
- enum EnumerationResult
+ enum class EnumerationResult
{
SUCCESS, /// the enumeration was successful
ERROR, /// the enumeration was unsuccessful
- RUNNING /// the enumeration is still running, and the maximum wait time has passed
};
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index f7fc478..f18e73f 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1449,7 +1449,7 @@ const OUString* NameTranslator_Impl::GetTransTableFileName() const
SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommandEnvironment > const & xEnv, FileViewFlags nFlags, bool bOnlyFolder )
:mpAntiImpl ( pAntiImpl )
- ,m_eAsyncActionResult ( ::svt::ERROR )
+ ,m_eAsyncActionResult ( ::svt::EnumerationResult::ERROR )
,m_bRunningAsyncAction ( false )
,m_bAsyncActionCancelled ( false )
,m_eViewMode ( eDetailedList )
@@ -1535,7 +1535,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
if ( !pAsyncDescriptor )
{
::svt::EnumerationResult eResult = m_xContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList );
- if ( ::svt::SUCCESS == eResult )
+ if ( ::svt::EnumerationResult::SUCCESS == eResult )
{
implEnumerationSuccess();
m_xContentEnumerator.clear();
@@ -1547,7 +1547,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = true;
m_bAsyncActionCancelled = false;
- m_eAsyncActionResult = ::svt::ERROR;
+ m_eAsyncActionResult = ::svt::EnumerationResult::ERROR;
m_aAsyncActionFinished.reset();
// don't (yet) set m_aCurrentAsyncActionHandler to pTimeout->aFinishHandler.
@@ -1606,14 +1606,11 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = false;
switch ( m_eAsyncActionResult )
{
- case ::svt::SUCCESS:
+ case ::svt::EnumerationResult::SUCCESS:
return eSuccess;
- case ::svt::ERROR:
+ case ::svt::EnumerationResult::ERROR:
return eFailure;
-
- case ::svt::RUNNING:
- return eStillRunning;
}
SAL_WARN( "svtools.contnr", "SvtFileView_Impl::GetFolderContent_Impl: unreachable!" );
@@ -1849,7 +1846,7 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult )
m_aAsyncActionFinished.set();
- if ( svt::SUCCESS == eResult )
+ if ( svt::EnumerationResult::SUCCESS == eResult )
implEnumerationSuccess();
if ( m_aCurrentAsyncActionHandler.IsSet() )
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 2d6b8d1..0ea1a21 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -62,7 +62,7 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
EnumerationResult eResult =
xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList );
- if ( SUCCESS == eResult )
+ if ( EnumerationResult::SUCCESS == eResult )
{
for(SortingData_Impl* i : aContent)
{
commit a42554c36cd1ede28960ee04e83f4697c297f51c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:51:34 2017 +0200
remove unused Video from SgaObjKind enum
Change-Id: I10c712f7be1247055f7bd28b25fdd6950da9d50b
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index 6d86a86..98e908b 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -55,7 +55,6 @@ enum class SgaObjKind
NONE = 0, // abstract object
Bitmap = 1, // bitmap object
Sound = 2, // sound object
- Video = 3, // video object
Animation = 4, // animation object
SvDraw = 5, // Svdraw object
Inet = 6 // graphics from the internet
diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx
index aebe96a..a696df7 100644
--- a/svx/source/unogallery/unogalitem.cxx
+++ b/svx/source/unogallery/unogalitem.cxx
@@ -161,7 +161,6 @@ sal_Int8 SAL_CALL GalleryItem::getType()
switch( implGetObject()->eObjKind )
{
case SgaObjKind::Sound:
- case SgaObjKind::Video:
nRet = gallery::GalleryItemType::MEDIA;
break;
commit 712b5e0b69aa9ab94c3ace93fc65435150f1dafa
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:50:20 2017 +0200
remove unused IMPORT_INET from GalleryGraphicImportRet enum
Change-Id: I658ac9675b993bdea46296833f715947056ed9b7
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index df984ee..6d86a86 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -69,7 +69,7 @@ enum class SgaObjKind
enum class GalleryGraphicImportRet
{
- IMPORT_NONE, IMPORT_FILE, IMPORT_INET
+ IMPORT_NONE, IMPORT_FILE
};
#define GALLERY_PROGRESS_RANGE 10000
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 4e65d6c..9ec3adf 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -1102,9 +1102,7 @@ bool GalleryTheme::InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos
if( nImportRet != GalleryGraphicImportRet::IMPORT_NONE )
{
- if ( GalleryGraphicImportRet::IMPORT_INET == nImportRet )
- pNewObj.reset(static_cast<SgaObject*>(new SgaObjectINet( aGraphic, rURL, aFormat )));
- else if ( aGraphic.IsAnimated() )
+ if ( aGraphic.IsAnimated() )
pNewObj.reset(static_cast<SgaObject*>(new SgaObjectAnim( aGraphic, rURL, aFormat )));
else
pNewObj.reset(static_cast<SgaObject*>(new SgaObjectBmp( aGraphic, rURL, aFormat )));
commit 2b2cd4b06ede56a23a564c62b0b68f9df16a5f55
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:49:14 2017 +0200
convert SvxPrevLineSpace to scoped enum
Change-Id: I5903169e1d7728a2f1e547efdff82a75e8d7b6a7
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 50be7db..065b0dc 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -108,6 +108,7 @@ for d in definitionSet:
"vcl/inc/CommonSalLayout.hxx", # VerticalOrientation
"include/tools/fontenum.hxx", # part of GDI file format
"svx/inc/galobj.hxx", # GalSoundType
+ "include/svx/msdffdef.hxx",
# unit test code
"cppu/source/uno/check.cxx",
# general weird nonsense going on
@@ -142,6 +143,7 @@ for d in definitionSet:
"sw/source/uibase/inc/swcont.hxx", # RegionMode, from UI; ContentTypeId, from UI(registry)
"sw/inc/toxe.hxx", # ToxAuthorityType (from UI)
"include/svx/sxekitm.hxx", # SdrEdgeKind (from UI)
+ "include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI)
# represents constants from an external API
"opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx",
diff --git a/include/svx/paraprev.hxx b/include/svx/paraprev.hxx
index 65af556..7b32648 100644
--- a/include/svx/paraprev.hxx
+++ b/include/svx/paraprev.hxx
@@ -23,14 +23,14 @@
#include <editeng/svxenum.hxx>
#include <svx/svxdllapi.h>
-enum SvxPrevLineSpace
+enum class SvxPrevLineSpace
{
- SVX_PREV_LINESPACE_1 = 0,
- SVX_PREV_LINESPACE_15,
- SVX_PREV_LINESPACE_2,
- SVX_PREV_LINESPACE_PROP,
- SVX_PREV_LINESPACE_MIN,
- SVX_PREV_LINESPACE_DURCH
+ N1 = 0,
+ N15,
+ N2,
+ Prop,
+ Min,
+ Leading
};
class SVX_DLLPUBLIC SvxParaPrevWindow : public vcl::Window
diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx
index 817429b..ef7013c 100644
--- a/svx/source/dialog/paraprev.cxx
+++ b/svx/source/dialog/paraprev.cxx
@@ -31,7 +31,7 @@ SvxParaPrevWindow::SvxParaPrevWindow( vcl::Window* pParent, WinBits nBits) :
nLower ( 0 ),
eAdjust ( SVX_ADJUST_LEFT ),
eLastLine ( SVX_ADJUST_LEFT ),
- eLine ( SVX_PREV_LINESPACE_1 ),
+ eLine ( SvxPrevLineSpace::N1 ),
nLineVal ( 0 )
{
@@ -118,17 +118,17 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext)
{
switch (eLine)
{
- case SVX_PREV_LINESPACE_1:
+ case SvxPrevLineSpace::N1:
break;
- case SVX_PREV_LINESPACE_15:
+ case SvxPrevLineSpace::N15:
aPnt.Y() += nH / 2;
break;
- case SVX_PREV_LINESPACE_2:
+ case SvxPrevLineSpace::N2:
aPnt.Y() += nH;
break;
- case SVX_PREV_LINESPACE_PROP:
- case SVX_PREV_LINESPACE_MIN:
- case SVX_PREV_LINESPACE_DURCH:
+ case SvxPrevLineSpace::Prop:
+ case SvxPrevLineSpace::Min:
+ case SvxPrevLineSpace::Leading:
break;
}
}
commit 6abc4f4d86d093d83d2ce6afb731d934fb2aa2bf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:34:38 2017 +0200
drop CTL_STYLE enum
since we only ever use the Rect value
Change-Id: I020f5c126a8703e07cea5739b53e4b9529a1a575
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 33b5250..98e7eca 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -88,7 +88,6 @@ protected:
Point aPtLB, aPtMB, aPtRB;
Point aPtNew;
RectPoint eRP, eDefRP;
- CTL_STYLE eCS;
Bitmap* pBitmap;
CTL_STATE m_nState;
@@ -123,12 +122,12 @@ public:
virtual Size GetOptimalSize() const override;
void Reset();
- RectPoint GetActualRP() const { return eRP;}
+ RectPoint GetActualRP() const { return eRP;}
void SetActualRP( RectPoint eNewRP );
void SetState( CTL_STATE nState );
- sal_uInt8 GetNumOfChildren() const; // returns number of usable radio buttons
+ static const sal_uInt8 NO_CHILDREN = 9; // returns number of usable radio buttons
Rectangle CalculateFocusRectangle() const;
Rectangle CalculateFocusRectangle( RectPoint eRectPoint ) const;
diff --git a/include/svx/rectenum.hxx b/include/svx/rectenum.hxx
index 10b51b8..59e9c14 100644
--- a/include/svx/rectenum.hxx
+++ b/include/svx/rectenum.hxx
@@ -32,14 +32,6 @@ enum class RectPoint
RB // bottom right
};
-enum class CTL_STYLE
-{
- Rect,
- Line,
- Angle,
- Shadow
-};
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index 6076049..d38a9a0 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -141,7 +141,7 @@ SvxRectCtlAccessibleContext::SvxRectCtlAccessibleContext(
mpChildren( nullptr ),
mnClientId( 0 ),
mnSelectedChild( NOCHILDSELECTED ),
- mbAngleMode( rRepr.GetNumOfChildren() == 8 )
+ mbAngleMode( false )
{
{
::SolarMutexGuard aSolarGuard;
@@ -237,7 +237,7 @@ sal_Int32 SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChildCount()
ThrowExceptionIfNotAlive();
- return mpRepr->GetNumOfChildren();
+ return SvxRectCtl::NO_CHILDREN;
}
Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChild( sal_Int32 nIndex )
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index c6283ba..1c26ef9 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -73,7 +73,6 @@ SvxRectCtl::SvxRectCtl(vcl::Window* pParent, RectPoint eRpt,
, nBorderWidth(nBorder)
, nRadius(nCircle)
, eDefRP(eRpt)
- , eCS(CTL_STYLE::Rect)
, pBitmap(nullptr)
, m_nState(CTL_STATE::NONE)
, mbCompleteDisable(false)
@@ -89,7 +88,6 @@ void SvxRectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt
nBorderWidth = nBorder;
nRadius = nCircle;
eDefRP = eRpt;
- eCS = CTL_STYLE::Rect;
Resize_Impl();
}
@@ -125,38 +123,18 @@ void SvxRectCtl::Resize_Impl()
{
aSize = GetOutputSize();
- switch( eCS )
- {
- case CTL_STYLE::Rect:
- case CTL_STYLE::Angle:
- case CTL_STYLE::Shadow:
- aPtLT = Point( 0 + nBorderWidth, 0 + nBorderWidth );
- aPtMT = Point( aSize.Width() / 2, 0 + nBorderWidth );
- aPtRT = Point( aSize.Width() - nBorderWidth, 0 + nBorderWidth );
-
- aPtLM = Point( 0 + nBorderWidth, aSize.Height() / 2 );
- aPtMM = Point( aSize.Width() / 2, aSize.Height() / 2 );
- aPtRM = Point( aSize.Width() - nBorderWidth, aSize.Height() / 2 );
-
- aPtLB = Point( 0 + nBorderWidth, aSize.Height() - nBorderWidth );
- aPtMB = Point( aSize.Width() / 2, aSize.Height() - nBorderWidth );
- aPtRB = Point( aSize.Width() - nBorderWidth, aSize.Height() - nBorderWidth );
- break;
-
- case CTL_STYLE::Line:
- aPtLT = Point( 0 + 3 * nBorderWidth, 0 + nBorderWidth );
- aPtMT = Point( aSize.Width() / 2, 0 + nBorderWidth );
- aPtRT = Point( aSize.Width() - 3 * nBorderWidth, 0 + nBorderWidth );
-
- aPtLM = Point( 0 + 3 * nBorderWidth, aSize.Height() / 2 );
- aPtMM = Point( aSize.Width() / 2, aSize.Height() / 2 );
- aPtRM = Point( aSize.Width() - 3 * nBorderWidth, aSize.Height() / 2 );
-
- aPtLB = Point( 0 + 3 * nBorderWidth, aSize.Height() - nBorderWidth );
- aPtMB = Point( aSize.Width() / 2, aSize.Height() - nBorderWidth );
- aPtRB = Point( aSize.Width() - 3 * nBorderWidth, aSize.Height() - nBorderWidth );
- break;
- }
+ aPtLT = Point( 0 + nBorderWidth, 0 + nBorderWidth );
+ aPtMT = Point( aSize.Width() / 2, 0 + nBorderWidth );
+ aPtRT = Point( aSize.Width() - nBorderWidth, 0 + nBorderWidth );
+
+ aPtLM = Point( 0 + nBorderWidth, aSize.Height() / 2 );
+ aPtMM = Point( aSize.Width() / 2, aSize.Height() / 2 );
+ aPtRM = Point( aSize.Width() - nBorderWidth, aSize.Height() / 2 );
+
+ aPtLB = Point( 0 + nBorderWidth, aSize.Height() - nBorderWidth );
+ aPtMB = Point( aSize.Width() / 2, aSize.Height() - nBorderWidth );
+ aPtRB = Point( aSize.Width() - nBorderWidth, aSize.Height() - nBorderWidth );
+
Reset();
MarkToResetSettings(true, true);
Invalidate();
@@ -255,24 +233,17 @@ void SvxRectCtl::MouseButtonDown( const MouseEvent& rMEvt )
aPtNew = GetApproxLogPtFromPixPt( rMEvt.GetPosPixel() );
- if( aPtNew == aPtMM && ( eCS == CTL_STYLE::Shadow || eCS == CTL_STYLE::Angle ) )
- {
- aPtNew = aPtLast;
- }
- else
- {
- Invalidate( Rectangle( aPtLast - Point( nRadius, nRadius ),
- aPtLast + Point( nRadius, nRadius ) ) );
- Invalidate( Rectangle( aPtNew - Point( nRadius, nRadius ),
- aPtNew + Point( nRadius, nRadius ) ) );
- eRP = GetRPFromPoint( aPtNew );
+ Invalidate( Rectangle( aPtLast - Point( nRadius, nRadius ),
+ aPtLast + Point( nRadius, nRadius ) ) );
+ Invalidate( Rectangle( aPtNew - Point( nRadius, nRadius ),
+ aPtNew + Point( nRadius, nRadius ) ) );
+ eRP = GetRPFromPoint( aPtNew );
- SetActualRP( eRP );
+ SetActualRP( eRP );
- vcl::Window *pTabPage = getNonLayoutParent(this);
- if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
- static_cast<SvxTabPage*>(pTabPage)->PointChanged( this, eRP );
- }
+ vcl::Window *pTabPage = getNonLayoutParent(this);
+ if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
+ static_cast<SvxTabPage*>(pTabPage)->PointChanged( this, eRP );
}
}
@@ -282,7 +253,6 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
if(!IsCompletelyDisabled())
{
RectPoint eNewRP = eRP;
- bool bUseMM = (eCS != CTL_STYLE::Shadow) && (eCS != CTL_STYLE::Angle);
switch( rKeyEvt.GetKeyCode().GetCode() )
{
@@ -292,7 +262,7 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
switch( eNewRP )
{
case RectPoint::LT: eNewRP = RectPoint::LM; break;
- case RectPoint::MT: eNewRP = bUseMM ? RectPoint::MM : RectPoint::MB; break;
+ case RectPoint::MT: eNewRP = RectPoint::MM; break;
case RectPoint::RT: eNewRP = RectPoint::RM; break;
case RectPoint::LM: eNewRP = RectPoint::LB; break;
case RectPoint::MM: eNewRP = RectPoint::MB; break;
@@ -310,7 +280,7 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
case RectPoint::MM: eNewRP = RectPoint::MT; break;
case RectPoint::RM: eNewRP = RectPoint::RT; break;
case RectPoint::LB: eNewRP = RectPoint::LM; break;
- case RectPoint::MB: eNewRP = bUseMM ? RectPoint::MM : RectPoint::MT; break;
+ case RectPoint::MB: eNewRP = RectPoint::MM; break;
case RectPoint::RB: eNewRP = RectPoint::RM; break;
default: ; //prevent warning
}
@@ -324,7 +294,7 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
case RectPoint::MT: eNewRP = RectPoint::LT; break;
case RectPoint::RT: eNewRP = RectPoint::MT; break;
case RectPoint::MM: eNewRP = RectPoint::LM; break;
- case RectPoint::RM: eNewRP = bUseMM ? RectPoint::MM : RectPoint::LM; break;
+ case RectPoint::RM: eNewRP = RectPoint::MM; break;
case RectPoint::MB: eNewRP = RectPoint::LB; break;
case RectPoint::RB: eNewRP = RectPoint::MB; break;
default: ; //prevent warning
@@ -338,7 +308,7 @@ void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
{
case RectPoint::LT: eNewRP = RectPoint::MT; break;
case RectPoint::MT: eNewRP = RectPoint::RT; break;
- case RectPoint::LM: eNewRP = bUseMM ? RectPoint::MM : RectPoint::RM; break;
+ case RectPoint::LM: eNewRP = RectPoint::MM; break;
case RectPoint::MM: eNewRP = RectPoint::RM; break;
case RectPoint::LB: eNewRP = RectPoint::MB; break;
case RectPoint::MB: eNewRP = RectPoint::RB; break;
@@ -404,54 +374,15 @@ void SvxRectCtl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.SetFillColor();
- switch (eCS)
+ if (!IsEnabled())
{
-
- case CTL_STYLE::Rect:
- case CTL_STYLE::Shadow:
- if (!IsEnabled())
- {
- Color aOldCol = rRenderContext.GetLineColor();
- rRenderContext.SetLineColor(rStyles.GetLightColor());
- rRenderContext.DrawRect(Rectangle(aPtLT + aPtDiff, aPtRB + aPtDiff));
- rRenderContext.SetLineColor(aOldCol);
- }
- rRenderContext.DrawRect(Rectangle(aPtLT, aPtRB));
- break;
-
- case CTL_STYLE::Line:
- if (!IsEnabled())
- {
- Color aOldCol = rRenderContext.GetLineColor();
- rRenderContext.SetLineColor(rStyles.GetLightColor());
- rRenderContext. DrawLine(aPtLM - Point(2 * nBorderWidth, 0) + aPtDiff,
- aPtRM + Point(2 * nBorderWidth, 0) + aPtDiff);
- SetLineColor( aOldCol );
- }
- rRenderContext.DrawLine(aPtLM - Point(2 * nBorderWidth, 0),
- aPtRM + Point(2 * nBorderWidth, 0));
- break;
-
- case CTL_STYLE::Angle:
- if (!IsEnabled())
- {
- Color aOldCol = rRenderContext.GetLineColor();
- rRenderContext.SetLineColor(rStyles.GetLightColor());
- rRenderContext.DrawLine(aPtLT + aPtDiff, aPtRB + aPtDiff);
- rRenderContext.DrawLine(aPtLB + aPtDiff, aPtRT + aPtDiff);
- rRenderContext.DrawLine(aPtLM + aPtDiff, aPtRM + aPtDiff);
- rRenderContext.DrawLine(aPtMT + aPtDiff, aPtMB + aPtDiff);
- rRenderContext.SetLineColor(aOldCol);
- }
- rRenderContext.DrawLine(aPtLT, aPtRB);
- rRenderContext.DrawLine(aPtLB, aPtRT);
- rRenderContext.DrawLine(aPtLM, aPtRM);
- rRenderContext.DrawLine(aPtMT, aPtMB);
- break;
-
- default:
- break;
+ Color aOldCol = rRenderContext.GetLineColor();
+ rRenderContext.SetLineColor(rStyles.GetLightColor());
+ rRenderContext.DrawRect(Rectangle(aPtLT + aPtDiff, aPtRB + aPtDiff));
+ rRenderContext.SetLineColor(aOldCol);
}
+ rRenderContext.DrawRect(Rectangle(aPtLT, aPtRB));
+
rRenderContext.SetFillColor(rRenderContext.GetBackground().GetColor());
Size aBtnSize(11, 11);
@@ -473,8 +404,7 @@ void SvxRectCtl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.DrawBitmap(aPtMT - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtRT - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtLM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
- if (eCS == CTL_STYLE::Rect || eCS == CTL_STYLE::Line)
- rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
+ rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtRM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtLB - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtMB - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap);
@@ -488,8 +418,7 @@ void SvxRectCtl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.DrawBitmap(aPtLM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap);
// Center for rectangle and line
- if (eCS == CTL_STYLE::Rect || eCS == CTL_STYLE::Line)
- rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt1, aBtnSize, rBitmap);
+ rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt1, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtRM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap);
rRenderContext.DrawBitmap(aPtLB - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap);
@@ -501,7 +430,7 @@ void SvxRectCtl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
// CompletelyDisabled() added to have a disabled state for SvxRectCtl
if (!IsCompletelyDisabled())
{
- if (IsEnabled() && (eCS != CTL_STYLE::Angle || aPtNew != aPtMM))
+ if (IsEnabled())
{
Point aCenterPt(aPtNew);
aCenterPt -= aToCenter;
@@ -675,11 +604,6 @@ void SvxRectCtl::SetState( CTL_STATE nState )
static_cast<SvxTabPage*>(pTabPage)->PointChanged(this, eRP);
}
-sal_uInt8 SvxRectCtl::GetNumOfChildren() const
-{
- return ( eCS == CTL_STYLE::Angle )? 8 : 9;
-}
-
Rectangle SvxRectCtl::CalculateFocusRectangle() const
{
Size aDstBtnSize( PixelToLogic( Size( 15, 15 ) ) );
commit dbab6f1dd31a23cd0256e89f78eb5c647bca38fa
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:04:41 2017 +0200
remove unused MoveAll from SvxRuler::UpdateType enum
Change-Id: I50fd4bc869d1713f496def49e7a3e967efcb5911
diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index 71d5e78..3c5efe0 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -219,7 +219,6 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
enum class UpdateType
{
- MoveAll,
MoveLeft,
MoveRight
};
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6c25518..531d85d 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1717,9 +1717,6 @@ void SvxRuler::UpdateParaContents_Impl(
case UpdateType::MoveRight:
mpIndents[INDENT_RIGHT_MARGIN].nPos += lDifference;
break;
- case UpdateType::MoveAll:
- mpIndents[INDENT_RIGHT_MARGIN].nPos += lDifference;
- SAL_FALLTHROUGH;
case UpdateType::MoveLeft:
{
mpIndents[INDENT_FIRST_LINE].nPos += lDifference;
commit 5e422f01b632d08f3ac5155ffcd5916157fb189e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Feb 14 09:03:36 2017 +0200
remove unused StartSelection from SvxTableController::TblAction enum
Change-Id: Ic965cb6df890b08083530c5da8d9e217b6f699ed
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 1441c52..40011b1 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -126,7 +126,7 @@ private:
GotoLeftCell, GotoUpCell, GotoRightCell, GotoDownCell,
GotoLastCell, GotoLastColumn, GotoLastRow,
EditCell, StopTextEdit,
- RemoveSelection, StartSelection,
+ RemoveSelection,
HandledByView, Tab
};
SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr );
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 02c5a732..4268e8f 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1718,10 +1718,6 @@ bool SvxTableController::executeAction(TblAction nAction, bool bSelect, vcl::Win
RemoveSelection();
break;
- case TblAction::StartSelection:
- StartSelection( getSelectionStart() );
- break;
-
case TblAction::Tab:
{
if( bSelect )
More information about the Libreoffice-commits
mailing list