Save Calc CSV as Displayed Ignoring Hidden Rows and Columns

File, Save as, Text CSV with Edit filter settings, Save cell content as shown, Quote all text cells saves hidden cells. Is there any way to ignore hidden rows and columns?

(Selecting fixed column width ignores zero-width columns but is not really csv.)

csv-with-hidden-rows-and-column.ods

It seems a bug for Save cell content as shown given hidden or no-height rows and columns are not shown - https://bugs.documentfoundation.org/show_bug.cgi?id=142553

This macro will do copy of the active sheet and in this copy it removes the hidden rows or rows with zero height, and then it removes the hidden columns or columns with zero width.

Sub copyOnlyVisibleCells 'it do copy of active sheet and remove from this copy the hidden rows/columns and rows/columns with zero width/height
	dim oDoc as object, oSheets as object, oSheet as object, oCur as object, i&, o as object
	oDoc=ThisComponent
	oSheets=oDoc.Sheets
	oSheet=oDoc.CurrentController.ActiveSheet
	s=oSheet.Name & "-COPY" 'name of copied sheet
	oSheets.copyByName(oSheet.Name, s, oSheets.Count)
	oSheet=oSheets.getbyName(s) 'copied sheet
	oCur=oSheet.createCursor
	oCur.goToEndOfUsedArea(false)
	for i=0 to oCur.RangeAddress.EndRow 'remove hidden or no-height rows
		o=oSheet.Rows.getByIndex(i)
		if o.isVisible=false OR o.Height=0 then
			oSheet.Rows.removeByIndex(i, 1)
		end if
	next i
	for i=0 to oCur.RangeAddress.EndColumn 'remove hidden or no-width columns
		o=oSheet.Columns.getByIndex(i)
		if o.isVisible=false OR o.Width=0 then
			oSheet.Columns.removeByIndex(i, 1)
		end if		
	next i
End Sub