Hi Stephan,
thank you for your feedback. Please find my comments inline:
On 04/17/07 17:54, Stephan Bergmann wrote:
Frank Meies wrote:
- A SmartTagRecognizer is used to find smart tags in a document.
Usually there are a couple of SmartTagRecognizer components installed.
- A SmartTagAction defines actions associated with smart tags. Usually
there are a couple of SmartTagAction components installed.
Why are those two constructor-less services needed? Who creates
instances of those services, and how are different service
implementations discriminated? (Frank, please ignore this or any of the
following if we already clarified it back then, I simply cannot remember.)
Usually there are more than one instances of these services available.
These instances are created and collected by an internal SmartTagManager
object like this:
Reference< container::XContentEnumerationAccess > rContent( xMSF,
UNO_QUERY );
Reference < container::XEnumeration > rEnum =
rContent->createContentEnumeration(
C2U("com.sun.star.smarttags.SmartTagRecognizer"));
Reference< beans::XPropertySet > xPropSet = Reference<
beans::XPropertySet>(xMSF, UNO_QUERY);
const Any aAny = xPropSet->getPropertyValue( C2U("DefaultContext"));
Reference< XComponentContext> xContext;
aAny >>= xContext;
while( rEnum->hasMoreElements())
{
const Any a = rEnum->nextElement();
Reference< lang::XSingleComponentFactory > xSCF;
Reference< lang::XServiceInfo > xsInfo;
if (a >>= xsInfo)
xSCF = Reference< lang::XSingleComponentFactory >(xsInfo,
UNO_QUERY);
else
continue;
Reference< smarttags::XSmartTagRecognizer > xLib ( xSCF->
createInstanceWithContext(xContext), UNO_QUERY );
xLib->initialize( Sequence< Any >() );
maRecognizerList.push_back(xLib);
}
- SmartTagRecognizerMode defines some constants which are used to
specify the type of text (paragraph, cell content, single word) passed
to the recognize function of the SmartTagRecognizer service.
Should that be an enum? (If not, long would probably be more natural
than short.) Are combinations of those values of interest (since the
values are 2^0, 2^1, ... instead of 0, 1, ...)?
Agreed, I'll change this to 'enum'.
XSmartTagRecognizer.recognize parameters nStartPos, nLength: UNO
strings are arbitrary-length sequences of Unicode scalar values. How
shall nStartPos and nLength be interpreted? (The optimization to pass
complete string plus index range instead of just substring might be
great for non-bridged UNO calls, but can be a pessimization in general.)
The reason for the parameters nStartPos and nLength is that the
XTextMarkup.commitTextMarkup method (which is called from
XSmartTagRecognizer.recognize) requires a start position and a length,
denoting the region of text to highlight in the paragraph represented by
XTextMarkup. I'll change the documentation to reflect that the string is
UFT16 encoded.
- The XTextMarkup interface provides functionality to highlight the
text of a paragraph. This interface is used by the recognize function
of the SmartTagRecognizer service to mark text as smart tags.
- TextMarkupType defines some constants to specify the type of the
highlighted text (smart tag, spell check, grammar check).
Enum and long vs. short: questions as above.
Agreed, I'll change this to 'enum'.
Inconsistent spelling of URL, ID vs. Xml.
Agreed, thank you very much.
Regards,
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]