Kaydet (Commit) dfbef666 authored tarafından Matteo Casalin's avatar Matteo Casalin

Prefer OUString primitives to handwritten code

Change-Id: I5be917b92eab92be32d8f1cf672ecf4a67b35383
üst c24855bc
...@@ -966,42 +966,18 @@ namespace sw ...@@ -966,42 +966,18 @@ namespace sw
return nKey; return nKey;
} }
sal_Bool IsPreviousAM(OUString& rParams, sal_Int32 nPos){ sal_Bool IsPreviousAM(OUString& rParams, sal_Int32 nPos)
sal_uInt16 nPos1 = nPos - 1; {
sal_uInt16 nPos2 = nPos - 2; return nPos>=2 && rParams.matchIgnoreAsciiCase("am", nPos-2);
if(nPos1 > nPos || nPos2 > nPos){
return sal_False;
}else{
return (
( rParams[nPos1] == 'M' || rParams[nPos1] == 'm' ) &&
( rParams[nPos2] == 'A' || rParams[nPos2] == 'a' )
);
}
} }
sal_Bool IsNextPM(OUString& rParams, sal_Int32 nPos){ sal_Bool IsNextPM(OUString& rParams, sal_Int32 nPos)
sal_Int32 nPos1 = nPos + 1; {
sal_Int32 nPos2 = nPos + 2; return nPos+2<rParams.getLength() && rParams.matchIgnoreAsciiCase("pm", nPos+1);
if(nPos1 >= rParams.getLength() - 1 || nPos2 > rParams.getLength() - 1){
return sal_False;
}else{
return (
( rParams[nPos1] == 'P' || rParams[nPos1] == 'p' ) &&
( rParams[nPos2] == 'M' || rParams[nPos2] == 'm' )
);
}
} }
bool IsNotAM(OUString& rParams, sal_Int32 nPos) bool IsNotAM(OUString& rParams, sal_Int32 nPos)
{ {
return ( ++nPos;
(nPos == rParams.getLength() - 1) || return nPos>=rParams.getLength() || (rParams[nPos]!='M' && rParams[nPos]!='m');
(
(rParams[nPos+1] != 'M') &&
(rParams[nPos+1] != 'm')
)
);
} }
void SwapQuotesInField(OUString &rFmt) void SwapQuotesInField(OUString &rFmt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment