Issue 66254 - Super Error
Summary: Super Error
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows, all
: P5 (lowest) Trivial
Target Milestone: ---
Assignee: jsc
QA Contact: issues@api
URL:
Keywords: needmoreinfo, oooqa
Depends on:
Blocks:
 
Reported: 2006-06-08 17:57 UTC by guiris
Modified: 2013-02-24 21:08 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
File whith problem (13.50 KB, application/vnd.ms-excel)
2006-06-09 12:44 UTC, guiris
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description guiris 2006-06-08 17:57:54 UTC
When i search into a xsheet whith xreplaceable interface for obtain a 
indexaccess to elements for example: xIndexAccess = xReplaceable.findAll
(xReplaceDescriptor); I obtain minus elements. Example i search "pepe" in the 
sheet(there are 2 ocurrences of "pepe") and i obtain 1 ocurrence of 
pepe. "pepe" is in the same column (example in the range A3 and A4)
Comment 1 Rainer Bielefeld 2006-06-08 19:17:40 UTC
WONTFIX because of obsolete OOo version.

@guiris:
Pls. attach sample document!
Pls. contribute meaningful Summary.

Pls. check with the current Version 2.0 (or at least 1.1.5) whether the problem
still is actual and reopen the issue if you find out that the problem still exists.

Thanks

Rainer
Comment 2 guiris 2006-06-09 12:44:01 UTC
Created attachment 37028 [details]
File whith problem
Comment 3 guiris 2006-06-09 12:48:00 UTC
The problem is the same whit version 2.0 My code is: I find text in a sheet 
whit a regular expresion patron

private void generateDocumentExcel(XComponent xComponent,ITagTranslator 
tagtranslator)
	throws ISPACException
	{
    	XReplaceable xReplaceable = null;
    	XReplaceDescriptor xReplaceDescriptor = null;
		XIndexAccess xIndexAccess_ = null;
		XSpreadsheetDocument xDocument = (XSpreadsheetDocument)
UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent);
		//CARGAMOS LA COLECCION DE HOJAS DEL LIBRO	
		com.sun.star.sheet.XSpreadsheets xSheets = xDocument.getSheets
();
		com.sun.star.sheet.XSpreadsheet xSheet= null; 
		String[] names = xSheets.getElementNames();
        xIndexAccess_ = (XIndexAccess)UnoRuntime.queryInterface
(XIndexAccess.class, xSheets );
        //ACCEDEMOS A CADA UNA DE LAS HOJAS PARA BUSCAR LOS TAGS DECLARADOS Y 
SUSTITUIRLOS POR SU VALOR
        for (int x = 0; x < xIndexAccess_.getCount(); x++){
        	try {
        		xSheet = (XSpreadsheet) UnoRuntime.queryInterface
(XSpreadsheet.class, xIndexAccess_.getByIndex(x));
        	} catch (IndexOutOfBoundsException e1) {
				e1.printStackTrace();
        	} catch (WrappedTargetException e1) {
				e1.printStackTrace();
        	} 
        		//cargamos todas la celdas de la hoja 
     			com.sun.star.table.XCellRange xCellRange = 
xSheet.getCellRangeByName("A1:IV32000");
     			xReplaceable = (XReplaceable) UnoRuntime.queryInterface
( XReplaceable.class, xCellRange);
     			// Descriptor to set properies for replace
     			xReplaceDescriptor = (XReplaceDescriptor) 
xReplaceable.createReplaceDescriptor();
     			xReplaceDescriptor.setSearchString(ISPACTAG);
//private static final String ISPACTAG="<[ \\t\\n\\x0B\\f\\r]*ispactag[ 
\\t\\n\\x0B\\f\\r]+[^(/>)]*/>";
     			Object object = new Boolean(true);
     			
     			try
					{
     					xReplaceDescriptor.setPropertyValue
("SearchRegularExpression", object);
					}catch(Exception e)
					{
						throw new ISPACException(e);
					}
				XIndexAccess xIndexAccess = null;
				XTextRange xTextRange = null;
				
				String strTag = null;
				String strValue = null;
				Object tag;
				
				// Busca todos los tags declarados en el 
documento
				 
				
				xIndexAccess = xReplaceable.findAll
(xReplaceDescriptor);
				
				
				
				
				ArrayList tagslist = new ArrayList();
				//Comprobamos que hay Tags declarados en la 
hoja activa antes de recorrerla
				if (xIndexAccess!=null){

					for (int i = 0; i < 
xIndexAccess.getCount(); i++)
						{
							try
							{
							
							tag = 
xIndexAccess.getByIndex(i);
							}catch(Exception e)
							{
								throw new 
ISPACException(e);
							}

						    xTextRange = (XTextRange) 
UnoRuntime.queryInterface(XTextRange.class,tag);
							
							
							
							strTag = 
xTextRange.getString();
							if (strTag!=null)
							tagslist.add(strTag);
						}

						List translatedtags = 
tagtranslator.translateTags(tagslist);

						object = new Boolean(false);
					try
					{
					
	xReplaceDescriptor.setPropertyValue("SearchRegularExpression", object);
					}catch(Exception e)
					{
						throw new ISPACException(e);
					}

						// Los dos conjuntos estan 
ordenados.
					Iterator it = tagslist.iterator();
					Iterator ittranslated = 
translatedtags.iterator();

					while (ittranslated.hasNext()
&&it.hasNext())
						{

						String stagvalue =(String) 
ittranslated.next();
						if (stagvalue==null)
							stagvalue="";

					
	xReplaceDescriptor.setSearchString((String) it.next());
					
	xReplaceDescriptor.setReplaceString(stagvalue);
						xReplaceable.replaceAll
(xReplaceDescriptor);
						}
				}//fin de if que comprobueba que hay tags 
declarados
       } //final del recorrido de todas las hojas del libro (primer for abierto 
en la funcion)
     
}//FIN FUNCION generateDocumentExcel
Comment 4 Rainer Bielefeld 2006-06-09 15:27:00 UTC
Good grief, it's a really great idea to attach some .XLS without any basic macro
in it.

Pls. feel free to reopen this issue if you can contribute a OOo document with a
Starbasic function in it and a completely clear documentation why you believe
what should be done by any Basic statement. 

I belive you should discuss this problem in an user mailing list.

And, please, you also should also read our guidelines on
<http://qa.openoffice.org/issue_handling/pre_submission.html> before you continue.
Comment 5 jsc 2006-06-15 08:12:14 UTC
closed