diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 17:53:33 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 18:26:54 +0200 |
commit | ef2c0e73630d3c74f6fc3eda8416488356ff1b7d (patch) | |
tree | fa2e682ec371c6d985ed8317f9bcd35dd577307b | |
parent | 229b3a3e0a74c8fa3a1629fc1dbf858dcf2a9c50 (diff) |
loplugin:salunicodeliteral: vcl
Change-Id: I4a982da10ad76f8ae05355cec9629b906c95afdb
-rw-r--r-- | include/vcl/mnemonic.hxx | 2 | ||||
-rw-r--r-- | include/vcl/strhelper.hxx | 2 | ||||
-rw-r--r-- | vcl/osx/salframe.cxx | 34 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/sgvtext.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/fontmetric.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/app/i18n_cb.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 4 |
12 files changed, 42 insertions, 42 deletions
diff --git a/include/vcl/mnemonic.hxx b/include/vcl/mnemonic.hxx index a3aa33ea9a0a..26e4e5e15458 100644 --- a/include/vcl/mnemonic.hxx +++ b/include/vcl/mnemonic.hxx @@ -45,7 +45,7 @@ (MNEMONIC_RANGE_3_END-MNEMONIC_RANGE_3_START+1)+\ (MNEMONIC_RANGE_4_END-MNEMONIC_RANGE_4_START+1)) -#define MNEMONIC_CHAR ((sal_Unicode)'~') +#define MNEMONIC_CHAR u'~' #define MNEMONIC_INDEX_NOTFOUND ((sal_uInt16)0xFFFF) diff --git a/include/vcl/strhelper.hxx b/include/vcl/strhelper.hxx index 5f3c21647dbd..61cd9aa29cea 100644 --- a/include/vcl/strhelper.hxx +++ b/include/vcl/strhelper.hxx @@ -46,7 +46,7 @@ namespace psp // parses the first double in the string; decimal is '.' only inline double StringToDouble( const OUString& rStr ) { - return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); + return rtl::math::stringToDouble(rStr, u'.', u'\0'); } inline double StringToDouble(const OString& rStr) diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 28284b4a73fc..9283a1fe7149 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -962,20 +962,20 @@ OUString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode ) aKeyMap[ i ] = aKey.makeStringAndClear(); } - aKeyMap[ KEY_DOWN ] = OUString( sal_Unicode( 0x21e3 ) ); - aKeyMap[ KEY_UP ] = OUString( sal_Unicode( 0x21e1 ) ); - aKeyMap[ KEY_LEFT ] = OUString( sal_Unicode( 0x21e0 ) ); - aKeyMap[ KEY_RIGHT ] = OUString( sal_Unicode( 0x21e2 ) ); - aKeyMap[ KEY_HOME ] = OUString( sal_Unicode( 0x2196 ) ); - aKeyMap[ KEY_END ] = OUString( sal_Unicode( 0x2198 ) ); - aKeyMap[ KEY_PAGEUP ] = OUString( sal_Unicode( 0x21de ) ); - aKeyMap[ KEY_PAGEDOWN ] = OUString( sal_Unicode( 0x21df ) ); - aKeyMap[ KEY_RETURN ] = OUString( sal_Unicode( 0x21a9 ) ); + aKeyMap[ KEY_DOWN ] = OUString( u'\x21e3' ); + aKeyMap[ KEY_UP ] = OUString( u'\x21e1' ); + aKeyMap[ KEY_LEFT ] = OUString( u'\x21e0' ); + aKeyMap[ KEY_RIGHT ] = OUString( u'\x21e2' ); + aKeyMap[ KEY_HOME ] = OUString( u'\x2196' ); + aKeyMap[ KEY_END ] = OUString( u'\x2198' ); + aKeyMap[ KEY_PAGEUP ] = OUString( u'\x21de' ); + aKeyMap[ KEY_PAGEDOWN ] = OUString( u'\x21df' ); + aKeyMap[ KEY_RETURN ] = OUString( u'\x21a9' ); aKeyMap[ KEY_ESCAPE ] = "esc"; - aKeyMap[ KEY_TAB ] = OUString( sal_Unicode( 0x21e5 ) ); - aKeyMap[ KEY_BACKSPACE ]= OUString( sal_Unicode( 0x232b ) ); - aKeyMap[ KEY_SPACE ] = OUString( sal_Unicode( 0x2423 ) ); - aKeyMap[ KEY_DELETE ] = OUString( sal_Unicode( 0x2326 ) ); + aKeyMap[ KEY_TAB ] = OUString( u'\x21e5' ); + aKeyMap[ KEY_BACKSPACE ]= OUString( u'\x232b' ); + aKeyMap[ KEY_SPACE ] = OUString( u'\x2423' ); + aKeyMap[ KEY_DELETE ] = OUString( u'\x2326' ); aKeyMap[ KEY_ADD ] = "+"; aKeyMap[ KEY_SUBTRACT ] = "-"; aKeyMap[ KEY_DIVIDE ] = "/"; @@ -985,7 +985,7 @@ OUString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode ) aKeyMap[ KEY_LESS ] = "<"; aKeyMap[ KEY_GREATER ] = ">"; aKeyMap[ KEY_EQUAL ] = "="; - aKeyMap[ KEY_OPEN ] = OUString( sal_Unicode( 0x23cf ) ); + aKeyMap[ KEY_OPEN ] = OUString( u'\x23cf' ); aKeyMap[ KEY_TILDE ] = "~"; aKeyMap[ KEY_BRACKETLEFT ] = "["; aKeyMap[ KEY_BRACKETRIGHT ] = "]"; @@ -1022,13 +1022,13 @@ OUString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode ) if( it != aKeyMap.end() ) { if( (nKeyCode & KEY_SHIFT) != 0 ) - aResult.append( sal_Unicode( 0x21e7 ) ); + aResult.append( u'\x21e7' ); if( (nKeyCode & KEY_MOD1) != 0 ) - aResult.append( sal_Unicode( 0x2318 ) ); + aResult.append( u'\x2318' ); // we do not really handle Alt (see below) // we map it to MOD3, which is actually Command if( (nKeyCode & (KEY_MOD2|KEY_MOD3)) != 0 ) - aResult.append( sal_Unicode( 0x2325 ) ); + aResult.append( u'\x2325' ); aResult.append( it->second ); } diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 1915cc3e8e32..d943c82064bc 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -718,22 +718,22 @@ void AquaSalMenu::SetAccelerator( unsigned /*nPos*/, SalMenuItem* pSalMenuItem, nCommandKey=';'; break; case KEY_BACKSPACE: - nCommandKey=sal_Unicode( 0x232b ); + nCommandKey=u'\x232b'; break; case KEY_PAGEUP: - nCommandKey=sal_Unicode( 0x21de ); + nCommandKey=u'\x21de'; break; case KEY_PAGEDOWN: - nCommandKey=sal_Unicode( 0x21df ); + nCommandKey=u'\x21df'; break; case KEY_UP: - nCommandKey=sal_Unicode( 0x21e1 ); + nCommandKey=u'\x21e1'; break; case KEY_DOWN: - nCommandKey=sal_Unicode( 0x21e3 ); + nCommandKey=u'\x21e3'; break; case KEY_RETURN: - nCommandKey=sal_Unicode( 0x21a9 ); + nCommandKey=u'\x21a9'; break; case KEY_BRACKETLEFT: nCommandKey='['; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index cc8959373cfb..c24ce0339a42 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1124,7 +1124,7 @@ Size ComboBox::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - long nCharWidth = GetTextWidth(OUString(static_cast<sal_Unicode>('x'))); + long nCharWidth = GetTextWidth(OUString(u'x')); if ( !IsDropDownBox() ) { Size aOutSz = m_pImpl->m_pImplLB->GetMainWindow()->GetOutputSizePixel(); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0a778b86148f..393d12740cea 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -441,7 +441,7 @@ OUString Edit::ImplGetText() const if ( mcEchoChar ) cEchoChar = mcEchoChar; else - cEchoChar = sal_Unicode(0x2022); + cEchoChar = u'\x2022'; OUStringBuffer aText; comphelper::string::padToLength(aText, maText.getLength(), cEchoChar); return aText.makeStringAndClear(); diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 14478398fd11..d5ce9c988b3b 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -608,7 +608,7 @@ sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c) } else { - ChrWidth=(sal_uInt16)rOut.GetTextWidth(OUString(static_cast<sal_Unicode>('A'))); + ChrWidth=(sal_uInt16)rOut.GetTextWidth(OUString(u'A')); } } return ChrWidth; diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index b397684136e0..a255d0403847 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -324,7 +324,7 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev ) bool bCentered = true; if (MsLangId::isCJK(rFont.GetLanguage())) { - const OUString sFullstop( sal_Unicode( 0x3001 ) ); // Fullwidth fullstop + const OUString sFullstop( u'\x3001' ); // Fullwidth fullstop tools::Rectangle aRect; pDev->GetTextBoundRect( aRect, sFullstop ); const sal_uInt16 nH = rFont.GetFontSize().Height(); @@ -335,7 +335,7 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev ) } SetFullstopCenteredFlag( bCentered ); - mnBulletOffset = ( pDev->GetTextWidth( OUString( sal_Unicode( 0x20 ) ) ) - pDev->GetTextWidth( OUString( sal_Unicode( 0xb7 ) ) ) ) >> 1 ; + mnBulletOffset = ( pDev->GetTextWidth( OUString( u' ' ) ) - pDev->GetTextWidth( OUString( u'\x00b7' ) ) ) >> 1 ; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index aaa8f9710ef2..d97948b666a6 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -7591,19 +7591,19 @@ static void escapeStringXML( const OUString& rStr, OUString &rValue) { switch( *pUni ) { - case sal_Unicode('&'): + case u'&': rValue += "&"; break; - case sal_Unicode('<'): + case u'<': rValue += "<"; break; - case sal_Unicode('>'): + case u'>': rValue += ">"; break; - case sal_Unicode('\''): + case u'\'': rValue += "'"; break; - case sal_Unicode('"'): + case u'"': rValue += """; break; default: @@ -7630,7 +7630,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata() aMetadataStream.append( "<?xpacket begin=\"" ); // these lines write Unicode "zero width non-breaking space character" (U+FEFF) // (aka byte-order mark ) used as a byte-order marker. - aMetadataStream.append( OUStringToOString( OUString( sal_Unicode( 0xFEFF ) ), RTL_TEXTENCODING_UTF8 ) ); + aMetadataStream.append( OUStringToOString( OUString( u'\xFEFF' ), RTL_TEXTENCODING_UTF8 ) ); aMetadataStream.append( "\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n" ); aMetadataStream.append( "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\">\n" ); aMetadataStream.append( " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n" ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index f793b852e4da..c3ef73c60b3c 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -245,7 +245,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MapUnit::Map100thMM ), MapMode( eUnit ) ) ); OUString aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) ); aBuf.append( aNumText ) - .append( sal_Unicode( ' ' ) ); + .append( u' ' ); aBuf.appendAscii( eUnit == MapUnit::MapMM ? "mm" : "in" ); if( !i_rPaperName.isEmpty() ) { @@ -257,7 +257,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits ); aBuf.append( aNumText ) - .append( sal_Unicode( ' ' ) ); + .append( u' ' ); aBuf.appendAscii( eUnit == MapUnit::MapMM ? "mm" : "in" ); maVertDim->SetText( aBuf.makeStringAndClear() ); diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index 1ab6c61b08aa..d62ca0ad75bf 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -112,7 +112,7 @@ Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) } // NULL-terminate the string - ptext->pUnicodeBuffer[ptext->nLength] = (sal_Unicode)0; + ptext->pUnicodeBuffer[ptext->nLength] = u'\0'; } // reallocate the textbuffer with sufficiently large size 2^x @@ -220,7 +220,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) pText->nLength += howmany; // NULL-terminate the string - pText->pUnicodeBuffer[pText->nLength] = (sal_Unicode)0; + pText->pUnicodeBuffer[pText->nLength] = u'\0'; } // Handle the change of attributes in a preedit_draw_callback diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 39142e456ffd..03a52f055e41 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -3204,12 +3204,12 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) } else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 ) { - if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) ) + if( appendUnicodeSequence( u'0' + sal_Unicode(nSeqKeyCode - KEY_0) ) ) return 1; } else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F ) { - if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) ) + if( appendUnicodeSequence( u'a' + sal_Unicode(nSeqKeyCode - KEY_A) ) ) return 1; } else |